# AgentQL

Use your AgentQL credentials to extract data from webpages

Command:npxUpdated: 7/4/2025

[AgentX](https://www.agentx.so/) allows you connect AI agents with thousands of the most popular apps through MCP, so you can automate your AI workflow and have more time for what matters most — no code required.

## Installation

Run AgentQL MCP server on AgentX without a single line of code.

Or run AgentQL MCP server on your terminal:

`npx -y agentql-mcp`

Run this command to start the AgentQL MCP server.

## Required Environment Variables

AGENTQL_API_KEYRequired

Make sure to set these environment variables before running the server.

## Command Arguments

→

-y

→

agentql-mcp

## Server Information

Commandnpx

Arguments2

Env Variables1

Order26

Last Updated7/4/2025

Created5/8/2025

## Documentation

# AgentQL MCP Server

This is a Model Context Protocol (MCP) server that integrates [AgentQL](https://agentql.com/)'s data extraction capabilities.

## Features

### Tools

- `extract-web-data` - extract structured data from a given 'url', using 'prompt' as a description of actual data and its fields to extract.

## Installation

To use AgentQL MCP Server to extract data from web pages, you need to install it via npm, get an API key from our [Dev Portal](https://dev.agentql.com/), and configure it in your favorite app that supports MCP.

### Install the package

```
npm install -g agentql-mcp
```

### Configure Claude

- Open Claude Desktop **Settings** via `⌘`+`,` (don't confuse with Claude Account Settings)
- Go to **Developer** sidebar section
- Click **Edit Config** and open `claude_desktop_config.json` file
- Add `agentql` server inside `mcpServers` dictionary in the config file
- Restart the app

```
{
  "mcpServers": {
    "agentql": {
      "command": "npx",
      "args": ["-y", "agentql-mcp"],
      "env": {
        "AGENTQL_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}
```

Read more about MCP configuration in Claude [here](https://modelcontextprotocol.io/quickstart/user).

### Configure VS Code

For one-click installation, click one of the install buttons below:

#### Manual Installation

Click the install buttons at the top of this section for the quickest installation method. For manual installation, follow these steps:

Add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing `Ctrl + Shift + P` and typing `Preferences: Open User Settings (JSON)`.

```
{
  "mcp": {
    "inputs": [
      {
        "type": "promptString",
        "id": "apiKey",
        "description": "AgentQL API Key",
        "password": true
      }
    ],
    "servers": {
      "agentql": {
        "command": "npx",
        "args": ["-y", "agentql-mcp"],
        "env": {
          "AGENTQL_API_KEY": "${input:apiKey}"
        }
      }
    }
  }
}
```

### Validate MCP integration

Give your agent a task that will require extracting data from the web. For example:

```
Extract the list of videos from the page https://www.youtube.com/results?search_query=agentql, every video should have a title, an author name, a number of views and a url to the video. Make sure to exclude ads items. Format this as a markdown table.
```

## Development

Install dependencies:

```
npm install
```

Build the server:

```
npm run build
```

For development with auto-rebuild:

```
npm run watch
```

### Debugging

Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the [MCP Inspector](https://github.com/modelcontextprotocol/inspector), which is available as a package script:

```
npm run inspector
```

The Inspector will provide a URL to access debugging tools in your browser.
