MCP Server Integration

AgentQL Model Context Protocol (MCP) server integrates AgentQL's data extraction capabilities with AI-powered automation, enabling seamless retrieval of structured data from web pages. It enhances AI agents by providing real-time, context-aware access to the web, supporting use cases like market monitoring, research, and automation workflows​​​.

Installation

To use AgentQL MCP Server to extract data from web pages, you need to install it via npm, get an API key, and configure it in your favorite app that supports MCP.

terminal
npm install -g agentql-mcp

Set up AgentQL with MCP

Configure Claude

  1. Open Claude Desktop Settings via +, (don't confuse with Claude Account Settings)
  2. Go to Developer sidebar section
  3. Click Edit Config and open claude_desktop_config.json.
  4. Add agentql server inside mcpServers dictionary.
  5. Restart the application.
{
  "mcpServers": {
    "agentql": {
      "command": "npx",
      "args": ["-y", "agentql-mcp"],
      "env": {
        "AGENTQL_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Read more about MCP configuration in Claude here.

Configure Cursor

  1. Open Cursor Settings.
  2. Navigate to MCP > MCP Servers.
  3. Click + Add new MCP Server.
  4. Enter the following:
    • Name: agentql
    • Type: command
    • Command: env AGENTQL_API_KEY=YOUR_API_KEY npx -y agentql-mcp

Read more about MCP configuration in Cursor here.

Configure Windsurf

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

Read more about MCP configuration in Windsurf here.

Configure Goose

  1. Open Goose Desktop's Advanced Settings via the ... menu in the upper right corner of the interface.
  2. Select Add custom extension.
  3. Fill out the form:
  • ID: agentql
  • Name: AgentQL
  • Description: Extract data from web pages
  • Command: npx -y agentql-mcp
  1. Under Environment Variables, add your AgentQL key using as "AGENTQL_API_KEY" as the variable name, and your key as its value.
  2. Add the custom extention and you're ready to go!

Read more about using custom extensions with Goose here.

Usage

Once configured, your AI agent can extract web data using AgentQL MCP tools. Use this prompt to test it out:

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.

Tip: MCP is a new technology! If your agent complains about loading content from the web instead of using AgentQL, try adding "use tools" or "use agentql tool" in your prompt.

Here are some other examples:

  • Get the social links from agentql.com
  • Return the top international news articles from ground.news into a CSV

And, in our opinion AgentQL’s “killer usecase”—using Claude as a cookbook:

terminal
Get this recipe for me: https://www.justonecookbook.com/pressure-cooker-japanese-curry/

Development

AgentQL MCP server is opensource and open to contribution on GitHub.