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.

AD 4nXdGnJ WJRInPRFLJOucGW 1oWtWzRiCYGDpnv8Zh3QLAF1AsHUELzEtUffAlTBmIzjXafjJAht0O2vocBMDlkWu K3vAvUhjz hb zOIRjj u WDEH6jhK2w0J GXiQLJ YrTF6ng?key=Vx0i2LQtM02 27ZfBc6YGSE9
Implementation of a context protocol server of the agentql model (MCP) 9

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.

AD 4nXdMuIsO3FNd MYEC4LeT85EyXs88ksB4UqXZC KRBNtN9IzS1j8ve9rMfWSsMqIrRr4LUEX VsiwhlQeuA yXe UvExtUvlsmxbs3 sYJ7JrKpmfLNSdshriJBkIyPltNAbTl6 CA?key=Vx0i2LQtM02 27ZfBc6YGSE9
AD 4nXcALfA3DpKz3RamSVtHH3RD3TcwsO89RCLhHAsuZ 5WJUcuJrH0ZXzr0t8cl TE5mXRjk0l8gvHebGPJwkv1WivnFbQTC2Ks5ktc5JI4OpcXIg9FnJMkT7CtJMPJjvPRAhWJxTyIw?key=Vx0i2LQtM02 27ZfBc6YGSE9
Implementation of a context protocol server of the agentql model (MCP) 10
AD 4nXc5EfIJDrCMxP6vuDBPKRbooSlzWlV6Vp4I4GuRSliHQEHInpLVhcgYlSNSc9oaaaNqdvZeSHGfumXQ4WAY1weRMHkr5bOWZbMmscFoMGv5O7pkoOXczd8hWCuRD53nRaFatseEgA?key=Vx0i2LQtM02 27ZfBc6YGSE9
Implementation of a context protocol server of the agentql model (MCP) 11
AD 4nXezvEJ1SDv5FcLNKVmCZmPpKVcnGz2JaVq1mt2puakjp4uoitN fs515vlUzn0o2EFo27UI1VAi22vRSgZHh7LEVBEICO23lFTcesYvHVkEDaRvUyInHMn29rKYdqgO8eTWQW aAQ?key=Vx0i2LQtM02 27ZfBc6YGSE9
Implementation of a context protocol server of the agentql model (MCP) 12

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:


PASSPORT SIZE PHOTO

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.