You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/src/pages/en/ai-suite/token-api-mcp/introduction.mdx
+9-4Lines changed: 9 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,16 @@ sidebarTitle: 'Introduction'
5
5
6
6
Token API MCP server is an open-source implementation of [Anthropic's Model Context Protocol](https://modelcontextprotocol.io/introduction).
7
7
8
-
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 real-time blockchain data using natural language requests that get translated into optimized SQL queries.
8
+
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.
9
9
10
-
The server itself does not host any language model. It simply converts MCP calls into data look-ups and returns structured results, letting the client's own LLM incorporate the results.
10
+
There are two types of MCP available for use:
11
11
12
-
Think of it as a USB-C hub: it standardizes the plug-and-play connection between AI agents and The Graph's Token API data.
12
+
- A REST-based MCP, the default, that communicates with the Token API.
13
+
- A SQL-based MCP, for advanced users, that allows for communicating with the backend databases that power the Token API.
14
+
15
+
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!
16
+
17
+
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.
13
18
14
19
## What You Can Do
15
20
@@ -20,4 +25,4 @@ Think of it as a USB-C hub: it standardizes the plug-and-play connection between
20
25
- Ask natural language questions about token data without writing smart contract calls
21
26
- Access historical transfer data to analyze token movement over time
22
27
23
-
The Token MCP server provides [Claude](/ai-suite/token-api-mcp/claude/), [Cline](/ai-suite/token-api-mcp/cline/), and [Cursor](/ai-suite/token-api-mcp/cursor/) with direct, conversational access to onchain token data.
28
+
The Token MCP server provides [Claude](/ai-suite/token-api-mcp/claude/), [Cline](/ai-suite/token-api-mcp/cline/), [Cursor](/ai-suite/token-api-mcp/cursor/)and any other client with MCP integration a direct, conversational access to onchain token data.
Copy file name to clipboardExpand all lines: website/src/pages/en/token-api/faq.mdx
+16-1Lines changed: 16 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -283,12 +283,27 @@ You can find the code for the MCP client in [The Graph's repo](https://github.co
283
283
284
284
### MCP integration with Claude/Cline/Cursor shows errors like "ENOENT" or "Server disconnected". How do I fix this?
285
285
286
-
For "ENOENT" errors, ensure Node.js 18+ is installed and the path to `npx`/`bunx` is correct (consider using full paths in config). "Server disconnected" usually indicates authentication or connectivity issues – verify your `ACCESS_TOKEN` is set correctly and your network allows access to `https://token-api.mcp.thegraph.com/sse`.
286
+
For "ENOENT" errors, ensure Node.js 18+ is installed and the path to `npx`/`bunx` is correct (consider using full paths in config). "Server disconnected" usually indicates authentication or connectivity issues – verify your `ACCESS_TOKEN` is set correctly and your network allows access to `https://token-api.mcp.thegraph.com/`.
287
287
288
288
### Do I need to use MCP or tools like Claude, Cline, or Cursor?
289
289
290
290
No, these are optional. MCP is an advanced feature allowing AI assistants to interface with the API via streaming. For standard usage, simply call the REST endpoints with any HTTP client using your JWT. Claude Desktop, Cline bot, and Cursor IDE integrations are provided for convenience but aren't required.
291
291
292
+
### How do I choose between the REST-MCP and the SQL-MCP and which one should I use?
293
+
294
+
To use one or the other, you need to supply the adequate URL in your configuration file (see the [docs](https://thegraph.com/docs/en/ai-suite/token-api-mcp/introduction/) for how to set up your configuration):
295
+
296
+
-`https://token-api.mcp.thegraph.com/` is for the REST-MCP
297
+
-`https://token-api.mcp.thegraph.com/sql` is for the SQL-MCP
298
+
299
+
Which one you'll want to use depends on your use cases. Most of the time you should use the REST-MCP as it's the simplest way for the LLM to interact with blockchain data from the Token API. If you want answers to basic questions such as `What is the balance of ...`, `How many holders of ...`, etc. the REST-MCP gives your LLM all the tools it needs.
300
+
301
+
The SQL-MCP should be used in an analyst use case where complex aggregations are needed that the Token API doesn't provide on its endpoints. It will require the LLM to discover and craft working SQL queries on the backend databases of the Token API.
302
+
303
+
### Will using the REST-MCP counts towards my Token API usage?
304
+
305
+
Yes, you need to provide your Token API token to the MCP for authenticating with the Token API. The MCP makes API requests on your behalf when your LLM interacts with it.
0 commit comments