Docs
Search⌘ K
  • Home
  • About The Graph
  • Supported Networks
  • Protocol Contracts
  • Subgraphs
    • Substreams
      • Token API
        • Hypergraph
          • AI Suite
            • Indexing
              • Graph Horizon
                • Resources
                  AI Suite > Token API MCP

                  2 minutes

                  Token API MCP Introduction

                  Token API MCP server is an open-source implementation of Anthropic’s Model Context Protocol⁠.

                  This MCP server makes on-chain token data, including metadata, balances, transfers, and holder statistics, accessible through a set of MCP tools. Any compatible client can use these tools to fetch and analyze token information through a standardized interface. It connects to The Graph’s hosted Token API database, enabling AI assistants to query blockchain data using natural language requests.

                  There are two types of MCP available for use:

                  • A REST-based MCP, the default, that communicates with the Token API.
                  • A SQL-based MCP, for advanced users, that allows for communicating with the backend databases that power the Token API.

                  The REST-based MCP simply exposes the API endpoints to your LLM based on the OpenAPI specification (available at https://token-api.thegraph.com/openapi⁠). It is the recommended way to set up an LLM with Token API as the set of tools it offers is straightforward to use for any language model. Additionnaly, it automatically stays up-to-date with new Token API releases so you don’t miss any new features!

                  The SQL-based MCP provides the LLM tools to list databases and tables as well as run SQL queries directly on the data. It is meant for advanced users who need different use cases that the standard API endpoints cannot replicate. For best results, it is advised to use an LLM model specifically tuned for working with SQL as general purpose LLMs models (like Sonnet, Gemini, etc.) might not be able to generate valid queries efficiently.

                  What You Can Do

                  • Retrieve token metadata including name, symbol, decimals, total supply, and contract address
                  • Get token balances for any wallet address holding a supported ERC-20 token
                  • Fetch token transfer activity including sender, receiver, amount, and timestamp
                  • Identify top holders and analyze token distribution
                  • Ask natural language questions about token data without writing smart contract calls
                  • Access historical transfer data to analyze token movement over time

                  The Token MCP server provides Claude, Cline, Cursor and any other client with MCP integration a direct, conversational access to onchain token data.

                  ⁠Edit on GitHub⁠

                  CursorClaude Desktop
                  On this page
                  • What You Can Do
                  The GraphStatusTestnetBrand AssetsForumSecurityPrivacy PolicyTerms of Service