Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions website/src/pages/en/ai-suite/token-api-mcp/claude.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,6 @@ Create or edit your `claude_desktop_config.json` file.
}
```

**SQL-based MCP**

```json label="claude_desktop_config.json"
{
"mcpServers": {
"token-api": {
"command": "npx",
"args": ["@pinax/mcp", "--remote-url", "https://token-api.mcp.thegraph.com/sql"],
"env": {
"ACCESS_TOKEN": "<https://thegraph.market JWT Access Token>"
}
}
}
}
```

> [!NOTE] The previous `--sse-url` option is deprecated, use `--remote-url`.

## Troubleshooting
Expand Down
16 changes: 0 additions & 16 deletions website/src/pages/en/ai-suite/token-api-mcp/cline.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,6 @@ Create or edit your `cline_mcp_settings.json` file.
}
```

**SQL-based MCP**

```json label="cline_mcp_settings.json"
{
"mcpServers": {
"token-api": {
"command": "npx",
"args": ["@pinax/mcp", "--remote-url", "https://token-api.mcp.thegraph.com/sql"],
"env": {
"ACCESS_TOKEN": "<https://thegraph.market JWT Access Token>"
}
}
}
}
```

> [!NOTE] The previous `--sse-url` option is deprecated, use `--remote-url`.

## Troubleshooting
Expand Down
16 changes: 0 additions & 16 deletions website/src/pages/en/ai-suite/token-api-mcp/cursor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,6 @@ Create or edit your `~/.cursor/mcp.json` file.
}
```

**SQL-based MCP**

```json label="mcp.json"
{
"mcpServers": {
"token-api": {
"command": "npx",
"args": ["@pinax/mcp", "--remote-url", "https://token-api.mcp.thegraph.com/sql"],
"env": {
"ACCESS_TOKEN": "<https://thegraph.market JWT Access Token>"
}
}
}
}
```

## Troubleshooting

![Cursor IDE error notification that reads, "Failed to create client"](/img/cursor-error.png)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@ Token API MCP server is an open-source implementation of [Anthropic's Model Cont

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:
There is one MCP option available:

- 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
Expand Down
23 changes: 8 additions & 15 deletions website/src/pages/en/token-api/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -301,17 +301,6 @@ For "ENOENT" errors, ensure Node.js 18+ is installed and the path to `npx`/`bunx

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.

### How do I choose between the REST-MCP and the SQL-MCP and which one should I use?

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):

- `https://token-api.mcp.thegraph.com/` is for the REST-MCP
- `https://token-api.mcp.thegraph.com/sql` is for the SQL-MCP

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.

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.

### Will using the REST-MCP counts towards my Token API usage?

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.
Expand Down Expand Up @@ -354,13 +343,17 @@ Reach out on [Discord](https://discord.gg/graphprotocol) in the [Token API](http

## Advanced Topics

### I keep seeing a smart contract with addresses like `0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee` and `0x000000000000000000000000000000000000`. What is this?
### I keep seeing a smart contract with addresses like `0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee` and `0x0000000000000000000000000000000000000000`. What is this?

The address `0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee` is a sentinel (placeholder) used in some EVM contracts to represent the chain's native token (ETH, BNB, AVAX, etc.) when the code expects a contract address. It stands for the native token of the chain you're on: ETH on Ethereum/Mainnet L2s, BNB on BSC, AVAX on Avalanche C-Chain, and so on.

The address `0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee` is a sentinel (placeholder) address used to represent native tokens in EVM smart contracts. Since native tokens (ETH, BNB, AVAX, etc.) exist at the protocol level rather than as smart contracts, DeFi protocols need a placeholder address when their code expects contract addresses for all tokens. This address represents the native token of whatever chain you're on: ETH on Ethereum Mainnet and its L2s (Base Mainnet, Arbitrum One, Optimism Mainnet), BNB on BSC Mainnet, AVAX on Avalanche C-Chain, and so forth.
`0x0000000000000000000000000000000000000000` is another placeholder introduced in Uniswap v4 for the same purpose. These repetitive patterns make it clear they're not real accounts—just conventional low-entropy addresses developers agreed to use.

The address `0x0000000000000000000000000000000000000000` was introduced in Uniswap v4 for the same purpose.
**Use native endpoints instead of placeholders:** When you need native token data, call the dedicated endpoints rather than relying on the sentinel addresses. For example:

Because these addresses have an obvious repetitive pattern, they are clearly not randomly generated, as are other blockchain addresses. These accounts are not real accounts, just arbitrarily chosen low-entropy addresses that developers agreed to use.
- `/v1/evm/balances/native` for EVM native balances
- `/v1/svm/balances/native` for Solana (SVM) native balances
- `/v1/tvm/transfers/native` for Tron (TVM) native transfers

### I'm getting 403/401 errors. What's wrong?

Expand Down