Implementation of a context protocol server of the agentql model (MCP)

by Brenden Burgess

When you buy through links on our site, we may earn a commission at no extra cost to you. However, this does not influence our evaluations.

Agentql Allows you to scratch any website with unstructured data by defining the exact shape of the information you want. It gives you consistent and structured results, even from pages with dynamic content or frequently modified provisions.

In this tutorial, we will implement an MCP agentql server in Claude Desktop and use Claude's integrated visualization capacities to explore the data. More specifically, we will scratch a page of Amazon search results for IA booksExtraction of details such as the price, the notation and the number of criticisms.

Step 1: Control of dependencies

JS knot

We need NPX to execute the agentql server, which is delivered with NODE.JS.

  • Download the latest version of Node.js from nodejs.org
  • Run the installation program.
  • Leave all the default settings and complete the installation

Claude Desktop

Download Claude using https://claude.ai/download.

API Agentql

Create your API agentql key to dev.agentql.com/api- Keys And store it safely – you will need it later in this tutorial.

Step 2: Installation of packages

Once node.js have installed, open your terminal and run the following command:

npm install -g agentql-mcp

Step 3: Configuration of the MCP server

Then configure Claude to connect to your MCP server. Open it claude_desktop_config.json File located in the Claude installation directory using any text editor. If the file does not exist, you can create it manually. Once open, enter the following code:

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

Replace With the key you have generated.

Step 4: Execute the server

Once the MCP configuration is complete, your server must appear in Claude. The agentql server has a single powerful tool – extract_web_data – which takes a URL and a description of the natural language of the data structure you want to extract.

You can use any URL you want to scratch. For this tutorial, I used an Amazon search results page for AI books and asked Claude to view the extracted data. Claude provides an interactive terminal where it generates code to process and view the data – and you can change this code if necessary. Once the code was finalized, Claude presented a bar graph with interactive options to explore prices, notes, examination counts and even a price route compared to rating, as well as key summary statistics.

Agentql can be used to scrape the websites, and we can connect it with other servers such as the concept or the GitHub to automatically send structured data for documentation, monitoring or additional automation.

This makes agentql a powerful tool for transforming unstructured web content into usable information – all in a workflow in simple natural language.


Here is a brief overview of what we build on Marktechpost:


I graduated in Civil Engineering (2022) by Jamia Millia Islamia, New Delhi, and I have a great interest in data science, in particular neural networks and their application in various fields.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.