AgentQL MCP server

Extracts structured data from web pages based on natural language descriptions, converting website content into JSON format without custom scraping code.
Back to servers
Setup instructions
Provider
Tiny Fish
Release date
Mar 15, 2025
Language
TypeScript
Package
Stats
4.8K downloads
96 stars

AgentQL MCP Server enables you to extract structured data from web pages using Model Context Protocol integration. It provides powerful data extraction capabilities through the AgentQL service, allowing AI assistants to gather and process information from websites when prompted.

Installation

Installing the Package

Install the AgentQL MCP server package globally using npm:

npm install -g agentql-mcp

Getting an API Key

You'll need to obtain an API key from the AgentQL Dev Portal before using the service.

Configuration

Claude Desktop Configuration

To configure the MCP server in Claude Desktop:

  1. Open Claude Desktop Settings via +,
  2. Go to Developer sidebar section
  3. Click Edit Config to open claude_desktop_config.json
  4. Add the AgentQL server configuration to the mcpServers dictionary
  5. Restart Claude Desktop
{
  "mcpServers": {
    "agentql": {
      "command": "npx",
      "args": ["-y", "agentql-mcp"],
      "env": {
        "AGENTQL_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

VS Code Configuration

One-Click Installation

For the simplest installation in VS Code, use the install buttons provided in the original documentation.

Manual Installation

To manually configure VS Code:

  1. Press Ctrl + Shift + P and type Preferences: Open User Settings (JSON)
  2. Add the following configuration:
{
  "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}"
        }
      }
    }
  }
}

Alternatively, you can create a .vscode/mcp.json file in your workspace with the following content:

{
  "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}"
      }
    }
  }
}

Cursor Configuration

To configure the MCP server in Cursor:

  1. Open Cursor Settings
  2. Go to MCP > MCP Servers
  3. Click + Add new MCP Server
  4. Configure with the following details:
    • Name: "agentql" (or your preferred name)
    • Type: "command"
    • Command: env AGENTQL_API_KEY=YOUR_API_KEY npx -y agentql-mcp

Windsurf Configuration

To configure the MCP server in Windsurf:

  1. Open Windsurf: MCP Configuration Panel
  2. Click Add custom server+
  3. Alternatively, open ~/.codeium/windsurf/mcp_config.json directly
  4. Add the AgentQL server configuration:
{
  "mcpServers": {
    "agentql": {
      "command": "npx",
      "args": ["-y", "agentql-mcp"],
      "env": {
        "AGENTQL_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Usage

Available Tools

The AgentQL MCP server provides the following tool:

  • extract-web-data: Extracts structured data from a given URL using a prompt that describes the data and fields to extract

Testing Your Integration

To verify that your MCP integration is working correctly, give your agent a task that requires web data extraction, such as:

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.

Usage Tips

If your agent seems unable to use the AgentQL tools, try adding a specific hint like "use tools" or "use agentql tool" in your prompt.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "agentql" '{"command":"npx","args":["-y","agentql-mcp"],"env":{"AGENTQL_API_KEY":"YOUR_API_KEY"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

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

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

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

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later