Get the FREE Ultimate OpenClaw Setup Guide →

agentql

Model Context Protocol server that integrates AgentQL's data extraction capabilities.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio tinyfish-io-agentql-mcp npx -y agentql-mcp \
  --env AGENTQL_API_KEY="YOUR_API_KEY"

How to use

This MCP server integrates AgentQL's data extraction capabilities into the Model Context Protocol. The server exposes a tool named extract-web-data that, given a URL and a prompt describing the desired data and its fields, returns structured results extracted from the web page. This enables your agents to fetch, parse, and structure information from web sources without writing custom scraping logic. The server relies on an API key to authenticate with AgentQL's services, so ensure AGENTQL_API_KEY is set in your MCP configuration.

You can invoke the extract-web-data tool through your MCP-enabled workflow by providing the target URL and a descriptive prompt. The tool will return a structured dataset (e.g., JSON) containing the fields you requested, such as titles, authors, dates, or any other data the prompt specifies. If you need to reuse credentials or share configurations, include the AGENTQL_API_KEY in your MCP env so all clients can access the service consistently.

How to install

Prerequisites:

  • Node.js installed on your machine (recommended: LTS version)
  • npm installed (comes with Node.js)
  • An AgentQL API key (from the AgentQL Dev Portal)
  1. Install the MCP server globally via npm:
npm install -g agentql-mcp
  1. Obtain and configure your API key:
  • Get your API key from the AgentQL Dev Portal.
  • Store it securely; you will pass it to the MCP config as an environment variable AGENTQL_API_KEY.
  1. Run the MCP server (example using npx as the launcher is shown in the repo):
npx -y agentql-mcp
  1. If you are configuring within an editor or IDE, ensure the mcp_config.json (or equivalent) includes the agentql server with the AGENTQL_API_KEY env var as shown in the configuration example.

  2. For development builds or custom paths, you can point to a local build:

{
  "mcpServers": {
    "agentql": {
      "command": "/path/to/agentql-mcp/dist/index.js",
      "env": {
        "AGENTQL_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}
  1. Verify the integration by starting your MCP client and issuing a test request that uses extract-web-data against a sample URL.

Additional notes

Key points and tips:

  • Always provide AGENTQL_API_KEY in the MCP server environment to authenticate requests.
  • If you encounter authentication issues, double-check the API key visibility in your editor or CI environment.
  • The server uses stdio for MCP communication; use the MCP Inspector (npm run inspector) for debugging and to inspect messages exchanged between the client and server.
  • If you switch between environments (CLI, VS Code, Windsurf, Cursor), keep the AGENTQL_API_KEY reference consistent to avoid misconfigurations.
  • When upgrading AgentQL MCP, revalidate your mcp_config to ensure the command and arguments remain compatible with the new package version.

Related MCP Servers

Sponsor this space

Reach thousands of developers