BaseQL

MCP Server with context & capabilities for agents to query Base chain data (mainnet) using CDP SQL API
  • typescript

3

GitHub Stars

typescript

Language

4 months ago

First Indexed

3 weeks ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "jnix2007-baseql-mcp": {
      "command": "npx",
      "args": [
        "baseql-mcp"
      ],
      "env": {
        "CDP_API_KEY_ID": "your-key-id",
        "CDP_WALLET_SECRET": "your-wallet-secret",
        "CDP_API_KEY_SECRET": "your-secret"
      }
    }
  }
}

You can use the BaseQL MCP Server to query Base chain data via SQL API in real time. It equips your agent with contract addresses, SQL schema context, pre-built query templates, ENS/Basename lookups, and safe execution of SQL against the Coinbase CDP SQL API, all so you can fetch relevant Base data quickly with natural language prompts.

How to use

You interact with the BaseQL MCP Server through a local MCP client or an HTTP-enabled agent. Start by ensuring your MCP server is running, then connect your client with the provided tool set and environment variables. Use the pre-built query templates to compose your requests, and rely on the forward/Reverse ENS lookups to translate names to addresses (and Basenames to addresses) when needed. Retrieve real-time data such as token transfers, NFT activity, or gas analysis and combine it with live price data from Coinbase CEX to craft comprehensive answers.

How to install

# prerequisites: Node.js installed (recommended LTS)
# install the MCP server globally
npm install -g baseql-mcp

# run in stdio mode using the provided CLI path
# The server will be invoked via npx baseql-mcp from the Claude Desktop example

Configuration and usage notes

Configure your MCP client to point at your local stdio-based server. The Claude Desktop example uses an isolated configuration where the server is started via npx baseql-mcp and environment variables are supplied for CDP credentials.

{
  "mcpServers": {
    "baseql": {
      "command": "npx",
      "args": ["baseql-mcp"],
      "env": {
        "CDP_API_KEY_ID": "your-key-id",
        "CDP_API_KEY_SECRET": "your-secret",
        "CDP_WALLET_SECRET": "your-wallet-secret"
      }
    }
  }
}

Usage with ChatGPT or other agents

Deploy the MCP server to a URL if you plan to use it with an HTTP agent. Then add the MCP server in your agent’s app connectors with the server URL and a descriptive name. After that, start a new chat and instruct the agent to use the BaseQL MCP server for anything related to Base chain data and ENS/Basename lookups.

Testing locally

You can test available tools and the SQL execution flow locally. First list available tools, then perform a sample SQL query against the BaseQL data sources.

# list available tools (example)
curl http://localhost:4000/tools

# query USDC transfers in the last hour (example of a SQL query call)
curl -X POST http://localhost:4000/call \
  -H "Content-Type: application/json" \
  -d '{"tool":"run_sql_query","params":{"sql":"SELECT COUNT(*) as count FROM base.transfers WHERE token_address = '\''0x833589fcd6edb6e08f4c7c32d4f71b54bda02913'\'' AND block_timestamp > NOW() - INTERVAL 1 HOUR"}}'

Available tools

get_schema

Return complete Base SQL table schemas with correct column names and best practices, including notes on common mistakes.

get_contract

Resolve Base contract addresses by token symbol for a given network (mainnet or sepolia).

run_sql_query

Execute a SQL query against the CDP SQL API and return on-chain results.

get_query_template

Provide pre-built SQL templates for common analyses such as whale transfers, token holders, NFT mints, and gas analysis.

get_query_templates

List all available query templates and their purposes.

ENS_lookup

Perform forward resolution from a name to an address and reverse lookup for .eth names where supported.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational