Tuesday, May 6, 2025

Implementing an AgentQL Mannequin Context Protocol (MCP) Server

AgentQL permits you to scrape any web site with unstructured knowledge by defining the precise form of the data you need. It provides you constant, structured outcomes—even from pages with dynamic content material or ceaselessly altering layouts.

On this tutorial, we’ll implement an AgentQL MCP server inside Claude Desktop, and use Claude’s built-in visualization capabilities to discover the info. Particularly, we’ll scrape an Amazon search outcomes web page for AI books, extracting particulars like value, score, and variety of critiques.

Step 1: Establishing dependencies

Node JS

We’d like npx to run the AgentQL server, which comes with Node.js.

  • Obtain the newest model of Node.js from nodejs.org
  • Run the installer.
  • Depart all settings as default and full the set up

Claude Desktop

Obtain Claude utilizing https://claude.ai/obtain.

AGENTQL API

Create your AgentQL API key at dev.agentql.com/api-keys and retailer it securely — you’ll want it later on this tutorial.

Step 2: Putting in the packages

As soon as Node.js is put in, open your terminal and run the next command:

npm set up -g agentql-mcp

Step 3: Configuring the MCP Server

Subsequent, configure Claude to hook up with your MCP server. Open the claude_desktop_config.json file positioned within the Claude set up listing utilizing any textual content editor. If the file doesn’t exist, you possibly can create it manually. As soon as opened, enter the next code:

{
    "mcpServers": {
      "agentql": {
        "command": "npx",
        "args": ("-y", "agentql-mcp"),
        "env": {
          "AGENTQL_API_KEY": ""
        }
      }
    }
  }

Substitute with the important thing you generated.

Step 4: Working the server

As soon as the MCP configuration is full, your server ought to seem in Claude. The AgentQL server features a single highly effective software — extract_web_data — which takes a URL and a pure language description of the info construction you need to extract.

You should use any URL you need to scrape. For this tutorial, I used an Amazon search outcomes web page for AI books and requested Claude to visualise the extracted knowledge. Claude supplies an interactive terminal the place it generates code to course of and visualize the info — and you may edit that code as wanted. As soon as the code was finalized, Claude introduced a bar chart with interactive choices to discover costs, scores, overview counts, and even a value vs. score scatter plot, together with key abstract statistics.

AgentQL can be utilized to scrape web sites, and we are able to join it with different servers like Notion or GitHub to robotically ship structured knowledge for documentation, monitoring, or additional automation.

This makes AgentQL a robust software for turning unstructured net content material into actionable insights — all inside a easy, pure language workflow.


Right here’s a quick overview of what we’re constructing at Marktechpost:


I’m a Civil Engineering Graduate (2022) from Jamia Millia Islamia, New Delhi, and I’ve a eager curiosity in Knowledge Science, particularly Neural Networks and their utility in varied areas.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles