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.
Install the AgentQL MCP server package globally using npm:
npm install -g agentql-mcp
You'll need to obtain an API key from the AgentQL Dev Portal before using the service.
To configure the MCP server in Claude Desktop:
⌘
+,
claude_desktop_config.json
mcpServers
dictionary{
"mcpServers": {
"agentql": {
"command": "npx",
"args": ["-y", "agentql-mcp"],
"env": {
"AGENTQL_API_KEY": "YOUR_API_KEY"
}
}
}
}
For the simplest installation in VS Code, use the install buttons provided in the original documentation.
To manually configure VS Code:
Ctrl + Shift + P
and type 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}"
}
}
}
}
}
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}"
}
}
}
}
To configure the MCP server in Cursor:
env AGENTQL_API_KEY=YOUR_API_KEY npx -y agentql-mcp
To configure the MCP server in Windsurf:
~/.codeium/windsurf/mcp_config.json
directly{
"mcpServers": {
"agentql": {
"command": "npx",
"args": ["-y", "agentql-mcp"],
"env": {
"AGENTQL_API_KEY": "YOUR_API_KEY"
}
}
}
}
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 extractTo 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.
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.
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.
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.
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"
}
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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