Skip to content

Commit 780b7df

Browse files
Latest edits
1 parent d60f8d6 commit 780b7df

File tree

3 files changed

+139
-45
lines changed

3 files changed

+139
-45
lines changed

website/src/pages/en/resources/_meta.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ export default {
77
roles: titles.roles,
88
'migration-guides': titles['migration-guides'],
99
'subgraph-studio-faq': '',
10+
'claud-mcp': '',
1011
}
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
---
2+
title: Claude MCP
3+
---
4+
5+
This guide walks you through configuring Claude Desktop to use The Graph ecosystem's Model Context Protocol (MCP) resources: Token API and Subgraph. These integrations allow you to interact with blockchain data through natural language conversations with Claude.
6+
7+
## What You Can Do
8+
9+
With these integrations, you can:
10+
11+
- **Token API**: Access token and wallet information across multiple blockchains
12+
- **Subgraph**: Explore Subgraph schemas, execute GraphQL queries, and find relevant Subgraphs for specific contracts
13+
14+
## Prerequisites
15+
16+
- [Node.js](https://nodejs.org/en/download/) installed and available in your path
17+
- [Claude Desktop](https://claude.ai/download) installed
18+
- API keys:
19+
- Token API key from [The Graph Market](https://thegraph.market/)
20+
- Gateway API key from [Subgraph Studio](https://thegraph.com/studio/apikeys/)
21+
22+
## Configuration
23+
24+
Follow these steps to configure both Token API and Subgraph MCP in Claude Desktop:
25+
26+
### Step 1: Open Configuration File
27+
28+
Edit your `claude_desktop_config.json` file:
29+
30+
> **Claude Desktop** > **Settings** > **Developer** > **Edit Config**
31+
32+
File locations by operating system:
33+
34+
- OSX: `~/Library/Application Support/Claude/claude_desktop_config.json`
35+
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
36+
- Linux: `.config/Claude/claude_desktop_config.json`
37+
38+
### Step 2: Add Configuration
39+
40+
Replace the existing configuration with this template:
41+
42+
```json
43+
{
44+
"mcpServers": {
45+
"token-api": {
46+
"command": "npx",
47+
"args": ["@pinax/mcp", "--sse-url", "https://token-api.thegraph.com/sse"],
48+
"env": {
49+
"ACCESS_TOKEN": "ACCESS_TOKEN"
50+
}
51+
},
52+
"subgraph": {
53+
"command": "npx",
54+
"args": [
55+
"mcp-remote",
56+
"--header",
57+
"Authorization: Bearer GATEWAY_API_KEY",
58+
"https://subgraph-ai.graphops.xyz/sse"
59+
]
60+
}
61+
}
62+
}
63+
```
64+
65+
### Step 3: Add Your API Keys
66+
67+
1. Replace `ACCESS_TOKEN` with your Token API key from [The Graph Market](https://thegraph.market/)
68+
2. Replace `GATEWAY_API_KEY` with your Gateway API key from [Subgraph Studio](https://thegraph.com/studio/apikeys/)
69+
70+
### Step 4: Save and Restart
71+
72+
Save the configuration file and restart Claude Desktop.
73+
74+
## Using The Graph Resources in Claude
75+
76+
After configuration:
77+
78+
1. Start a new conversation in Claude Desktop
79+
2. Click on the context menu (top right)
80+
3. Add "The Graph" resource by entering `graphql://subgraph` for Subgraph MCP and/or `token-api://token-api` for Token API
81+
82+
**Important**: You must manually add The Graph resources to your chat context for each conversation where you want to use them.
83+
84+
## Example Queries
85+
86+
Here are some example queries you can try after setting up the resources:
87+
88+
### Subgraph Queries
89+
90+
```
91+
What are the top pools in Uniswap?
92+
```
93+
94+
```
95+
Top delegators of The Graph Protocol?
96+
```
97+
98+
```
99+
Number of active loans in Compound for the last 7 days? Please make it a bar chart
100+
```
101+
102+
### Token API Queries
103+
104+
```
105+
Show me the current price of ETH
106+
```
107+
108+
```
109+
What are the top tokens by market cap on Ethereum?
110+
```
111+
112+
```
113+
Analyze this wallet address: 0x...
114+
```
115+
116+
## Troubleshooting
117+
118+
If you encounter issues:
119+
120+
1. **Verify Node.js Installation**: Ensure Node.js is correctly installed by running `node -v` in your terminal
121+
2. **Check API Keys**: Verify that your API keys are correctly entered in the configuration file
122+
3. **Enable Verbose Logging**: Add `--verbose true` to the args array in your configuration to see detailed logs
123+
4. **Restart Claude Desktop**: After making changes to the configuration, always restart Claude Desktop
Lines changed: 15 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Claude
2+
title: Claude Desktop
33
---
44

55
The Subgraph Model Context Protocol (MCP) server enables Claude to interact directly with Subgraphs on The Graph Network. This integration allows you to explore Subgraph schemas, execute GraphQL queries, and find relevant Subgraphs for specific contracts—all through natural language conversations with Claude.
@@ -15,52 +15,25 @@ With the Subgraph MCP integration, you can:
1515

1616
## Prerequisites
1717

18-
- [Claude Desktop](https://claude.ai/download) installed (latest version)
18+
- [Node.js](https://nodejs.org/en) installed and available in your path
19+
- [Claude Desktop](https://claude.ai/download) installed
1920
- A Gateway API key from [Subgraph Studio](https://thegraph.com/studio/)
20-
- [`npx`](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) or [`bunx`](https://bun.sh/) installed and available in your path
2121

2222
## Configuration
2323

24-
Create or edit your `claude_desktop_config.json` file.
24+
Edit your `claude_desktop_config.json` file.
2525

2626
> **Settings** > **Developer** > **Edit Config**
2727
2828
- OSX: `~/Library/Application Support/Claude/claude_desktop_config.json`
2929
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
3030
- Linux: `.config/Claude/claude_desktop_config.json`
3131

32-
```json label="claude_desktop_config.json"
33-
{
34-
"mcpServers": {
35-
"subgraph": {
36-
"command": "npx",
37-
"args": [
38-
"mcp-remote",
39-
"--header",
40-
"Authorization: Bearer GATEWAY_API_KEY",
41-
"https://subgraph-ai.graphops.xyz/sse"
42-
]
43-
}
44-
}
45-
}
46-
```
47-
48-
Replace `GATEWAY_API_KEY` with your API key from Subgraph Studio.
49-
50-
## Using Both Token API MCP and Subgraph MCP Together
51-
52-
You can configure Claude Desktop to use both the Token API MCP and Subgraph MCP simultaneously:
32+
Paste the following settings into your config file:
5333

5434
```json label="claude_desktop_config.json"
5535
{
5636
"mcpServers": {
57-
"token-api": {
58-
"command": "npx",
59-
"args": ["@pinax/mcp", "--sse-url", "https://token-api.thegraph.com/sse"],
60-
"env": {
61-
"ACCESS_TOKEN": "ACCESS_TOKEN"
62-
}
63-
},
6437
"subgraph": {
6538
"command": "npx",
6639
"args": [
@@ -74,12 +47,9 @@ You can configure Claude Desktop to use both the Token API MCP and Subgraph MCP
7447
}
7548
```
7649

77-
- For Token API access tokens, visit [The Graph Market](https://thegraph.com/explorer)
78-
- For Subgraph Gateway API keys, visit [Subgraph Studio](https://thegraph.com/studio/)
79-
80-
## Troubleshooting
50+
Replace `GATEWAY_API_KEY` with your API key from [Subgraph Studio](https://thegraph.com/studio/).
8151

82-
To enable logs for the MCP, add the `--verbose true` option to your args array.
52+
Once you've entered your Gateway API key into your settings, you can save the file, and restart Claude desktop.
8353

8454
## Using The Graph Resource in Claude
8555

@@ -92,6 +62,10 @@ After configuring Claude Desktop:
9262

9363
**Important**: Claude Desktop may not automatically utilize the Subgraph MCP. You must manually add "The Graph" resource to your chat context for each conversation where you want to use it.
9464

65+
## Troubleshooting
66+
67+
To enable logs for the MCP, add the `--verbose true` option to your args array.
68+
9569
## Available Tools and Usage
9670

9771
The Subgraph MCP provides several tools for interacting with Subgraphs:
@@ -125,16 +99,12 @@ One of the most powerful features of the Subgraph MCP integration is the ability
12599

126100
```
127101
What are the pairs with maximum volume on deployment 0xde0a7b5368f846f7d863d9f64949b688ad9818243151d488b4c6b206145b9ea3?
102+
```
128103

104+
```
129105
Which tokens have the highest market cap in this Subgraph?
106+
```
130107

108+
```
131109
Show me the most recent 5 swaps for the USDC/ETH pair
132110
```
133-
134-
## Key Identifier Types
135-
136-
When working with Subgraphs, you'll encounter different types of identifiers:
137-
138-
- **Subgraph ID** (e.g., `5zvR82...`): Logical identifier for a Subgraph
139-
- **Deployment ID** (e.g., `0x4d7c...`): Identifier for a specific, immutable deployment
140-
- **IPFS Hash** (e.g., `QmTZ8e...`): Identifier for the manifest of a specific deployment

0 commit comments

Comments
 (0)