HomeArtificial IntelligenceImplementing an AgentQL Mannequin Context Protocol (MCP) Server

Implementing an AgentQL Mannequin Context Protocol (MCP) Server


AgentQL permits you to scrape any web site with unstructured information by defining the precise form of the knowledge you need. It offers 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, ranking, and variety of opinions.

Step 1: Organising 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.
  • Go away 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 connect with your MCP server. Open the claude_desktop_config.json file situated within the Claude set up listing utilizing any textual content editor. If the file doesn’t exist, you’ll be able to 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: Operating 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 instrument — extract_web_data — which takes a URL and a pure language description of the info construction you wish to extract.

You need to use any URL you wish to scrape. For this tutorial, I used an Amazon search outcomes web page for AI books and requested Claude to visualise the extracted information. 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, evaluation counts, and even a value vs. ranking 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 routinely ship structured information for documentation, monitoring, or additional automation.

This makes AgentQL a strong instrument for turning unstructured internet content material into actionable insights — all inside a easy, pure language workflow.


Right here’s a short 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 numerous areas.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments