AgentQL MCP
AgentQL MCP is a server that extracts structured web data using customizable prompts, enhancing data extraction workflows. It integrates AgentQL's capabilities for precise, automated web content retrieval.
How to Install and Use AgentQL MCP
AgentQL MCP is a powerful tool that helps you extract structured data from web pages easily. If you want to make your apps smarter by grabbing info from the internet, this guide will show you how to install and use AgentQL MCP step by step.
Installing AgentQL MCP
First, you need to get AgentQL MCP on your computer. This tool is available via npm, which is a package manager for JavaScript.
Here is how to install it:
- Open your command line or terminal.
- Type the following command and press Enter:
npm install -g agentql-mcp
This command downloads and installs AgentQL MCP globally on your machine, so you can use it anywhere.
Getting an API Key
To use AgentQL MCP, you must have an API key from AgentQL’s Dev Portal. This key lets you access their web data extraction service.
Here is what to do:
- Visit the AgentQL Dev Portal.
- Sign up or log in if you already have an account.
- Find your API key on your dashboard.
- Keep this key handy as you will need it to configure AgentQL MCP.
Configuring AgentQL MCP in Your App
AgentQL MCP works by running as a server, and many apps that support MCP can use it. Let’s see how to configure it in Claude Desktop first, then VS Code and other tools.
Configuring in Claude Desktop
To connect AgentQL MCP to Claude:
- Open Claude Desktop and press
⌘ + ,to open Settings. - Go to the Developer side panel.
- Click Edit Config to open the file called
claude_desktop_config.json. - Add this block inside the
"mcpServers"section, replacing"YOUR_API_KEY"with your real API key:
{
"agentql": {
"command": "npx",
"args": ["-y", "agentql-mcp"],
"env": {
"AGENTQL_API_KEY": "YOUR_API_KEY"
}
}
}
- Save and restart Claude to activate the connection.
Configuring in VS Code
You can also use AgentQL MCP with Visual Studio Code easily.
- Open your User Settings in VS Code by pressing
Ctrl + Shift + Pand typingPreferences: Open User Settings (JSON). - Add this JSON snippet to the settings:
{
"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}"
}
}
}
}
}
- Optionally, you can save this configuration in the
.vscode/mcp.jsonfile in your project folder.
Running Example Tasks with AgentQL MCP
Once you have installed and configured AgentQL MCP, you can test it by giving your agent a web data extraction task.
For example, try this prompt:
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.
This asks AgentQL MCP to pull information about YouTube videos related to AgentQL, and show it neatly.
Summary
- Install AgentQL MCP using
npm install -g agentql-mcp. - Get your API key from the AgentQL Dev Portal.
- Configure your MCP server for Claude, VS Code, or other tools using the example JSON.
- Test your setup by asking your agent to extract data with a clear task.
With these steps, you can quickly start using AgentQL MCP to extract structured data from the web and build smarter applications!