Skip to content

Commit 9dfb8f3

Browse files
Latest updates
New readme & new endpoint URL
1 parent 77ef47f commit 9dfb8f3

File tree

4 files changed

+94
-107
lines changed

4 files changed

+94
-107
lines changed

website/src/pages/en/resources/claud-mcp.mdx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,12 @@ Replace the existing configuration with this template:
4040
```json
4141
{
4242
"mcpServers": {
43-
"token-api": {
43+
"subgraph": {
4444
"command": "npx",
45-
"args": ["@pinax/mcp", "--sse-url", "https://token-api.thegraph.com/sse"],
45+
"args": ["mcp-remote", "--header", "Authorization:${AUTH_HEADER}", "https://subgraphs.mcp.thegraph.com/sse"],
4646
"env": {
47-
"ACCESS_TOKEN": "ACCESS_TOKEN"
47+
"AUTH_HEADER": "Bearer GATEWAY_API_KEY"
4848
}
49-
},
50-
"subgraph": {
51-
"command": "npx",
52-
"args": [
53-
"mcp-remote",
54-
"--header",
55-
"Authorization: Bearer GATEWAY_API_KEY",
56-
"https://subgraph-ai.graphops.xyz/sse"
57-
]
5849
}
5950
}
6051
}

website/src/pages/en/subgraphs/mcp/claude.mdx

Lines changed: 81 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,27 @@ The Subgraph Model Context Protocol (MCP) server enables Claude to interact dire
66

77
## What You Can Do
88

9-
With the Subgraph MCP integration, you can:
9+
The Subgraph MCP integration enables you to:
1010

1111
- Access the GraphQL schema for any Subgraph on The Graph Network
1212
- Execute GraphQL queries against any Subgraph deployment
13-
- Find top Subgraph deployments for a given keyword
14-
- Find top Subgraph deployments for a contract address on a specific chain
13+
- Find top Subgraph deployments for a given keyword or contract address
14+
- Get 30-day query volume for Subgraph deployments
1515
- Ask natural language questions about Subgraph data without writing GraphQL queries manually
1616

1717
## Prerequisites
1818

1919
- [Node.js](https://nodejs.org/en) installed and available in your path
20-
- [Claude Desktop](https://claude.ai/download) installed
20+
- [Claude Desktop](https://claude.ai/download) installed (latest version)
2121
- A Gateway API key from [Subgraph Studio](https://thegraph.com/studio/)
2222

23-
## Configuration Steps
23+
## Installation Options
2424

25-
### 1. Open Configuration File
25+
### Option 1: Using npx (Recommended)
26+
27+
#### Configuration Steps using npx
28+
29+
#### 1. Open Configuration File
2630

2731
Navigate to your `claude_desktop_config.json` file:
2832

@@ -32,33 +36,78 @@ Navigate to your `claude_desktop_config.json` file:
3236
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
3337
- Linux: `.config/Claude/claude_desktop_config.json`
3438

35-
### 2. Add Configuration
39+
#### 2. Add Configuration
3640

3741
Paste the following settings into your config file:
3842

39-
```json label="claude_desktop_config.json"
43+
```json
4044
{
4145
"mcpServers": {
4246
"subgraph": {
4347
"command": "npx",
44-
"args": [
45-
"mcp-remote",
46-
"--header",
47-
"Authorization: Bearer GATEWAY_API_KEY",
48-
"https://subgraph-ai.graphops.xyz/sse"
49-
]
48+
"args": ["mcp-remote", "--header", "Authorization:${AUTH_HEADER}", "https://subgraphs.mcp.thegraph.com/sse"],
49+
"env": {
50+
"AUTH_HEADER": "Bearer GATEWAY_API_KEY"
51+
}
5052
}
5153
}
5254
}
5355
```
5456

55-
### 3. Add Your Gateway API Key
57+
#### 3. Add Your Gateway API Key
5658

5759
Replace `GATEWAY_API_KEY` with your API key from [Subgraph Studio](https://thegraph.com/studio/).
5860

59-
### 4. Save and Restart
61+
#### 4. Save and Restart
62+
63+
Once you've entered your Gateway API key into your settings, save the file and restart Claude Desktop.
64+
65+
### Option 2: Building from Source
66+
67+
#### Requirements
68+
69+
- Rust (latest stable version recommended: 1.75+)
70+
```bash
71+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
72+
```
73+
Follow the on-screen instructions. For other platforms, see the [official Rust installation guide](https://www.rust-lang.org/tools/install).
74+
75+
#### Installation Steps
76+
77+
1. **Clone and Build the Repository**
78+
79+
```bash
80+
git clone [email protected]:graphops/subgraph-mcp.git
81+
cd subgraph-mcp
82+
cargo build --release
83+
```
84+
85+
2. **Find the Command Path**
6086

61-
Once you've entered your Gateway API key into your settings, you can save the file, and restart Claude desktop.
87+
After building, the executable will be located at `target/release/subgraph-mcp` inside your project directory.
88+
89+
- Navigate to your `subgraph-mcp` directory in terminal
90+
- Run `pwd` to get the full path
91+
- Combine the output with `/target/release/subgraph-mcp`
92+
93+
3. **Configure Claude Desktop**
94+
95+
Open your `claude_desktop_config.json` file as described above and add:
96+
97+
```json
98+
{
99+
"mcpServers": {
100+
"subgraph": {
101+
"command": "/path/to/your/subgraph-mcp/target/release/subgraph-mcp",
102+
"env": {
103+
"GATEWAY_API_KEY": "your-api-key-here"
104+
}
105+
}
106+
}
107+
}
108+
```
109+
110+
Replace `/path/to/your/subgraph-mcp/target/release/subgraph-mcp` with the actual path to the compiled binary.
62111

63112
## Using The Graph Resource in Claude
64113

@@ -73,7 +122,7 @@ After configuring Claude Desktop:
73122

74123
## Troubleshooting
75124

76-
To enable logs for the MCP, add the `--verbose true` option to your args array.
125+
To enable logs for the MCP when using the npx option, add the `--verbose true` option to your args array.
77126

78127
## Available Subgraph Tools and Usage
79128

@@ -87,13 +136,20 @@ The Subgraph MCP provides several tools for interacting with Subgraphs:
87136

88137
### Query Execution Tools
89138

90-
- **Execute query by deployment ID**: Run GraphQL queries against specific, immutable deployments
139+
- **Execute query by deployment ID/IPFS hash**: Run GraphQL queries against specific, immutable deployments
91140
- **Execute query by Subgraph ID**: Run GraphQL queries against the latest version of a Subgraph
92141

93142
### Discovery Tools
94143

95-
- **Get top Subgraph deployments for a given keyword**: Find the top Subgraph deployments by query volume for a given keyword
96-
- **Get top Subgraph deployments for a contract**: Find the top 3 Subgraph deployments indexing a specific contract on a particular chain
144+
- **Search subgraphs by keyword**: Find subgraphs by keyword in their display names, ordered by signal
145+
- **Get deployment 30-day query counts**: Get aggregate query count over the last 30 days for multiple subgraph deployments
146+
- **Get top Subgraph deployments for a contract**: Find the top 3 Subgraph deployments indexing a specific contract on a particular chain, ordered by query fees
147+
148+
## Key Identifier Types
149+
150+
- **Subgraph ID** (e.g., `5zvR82...`): Logical identifier for a subgraph. Use `execute_query_by_subgraph_id` or `get_schema_by_subgraph_id`.
151+
- **Deployment ID** (e.g., `0x4d7c...`): Identifier for a specific, immutable deployment. Use `execute_query_by_deployment_id` or `get_schema_by_deployment_id`.
152+
- **IPFS Hash** (e.g., `QmTZ8e...`): Identifier for the manifest of a specific, immutable deployment. Use `execute_query_by_deployment_id` (the gateway treats it like a deployment ID for querying) or `get_schema_by_ipfs_hash`.
97153

98154
## Natural Language Queries
99155

@@ -118,3 +174,7 @@ Which tokens have the highest market cap in this Subgraph?
118174
```
119175
Show me the most recent 5 swaps for the USDC/ETH pair
120176
```
177+
178+
```
179+
Find the top subgraphs for contract 0x1f98431c8ad98523631ae4a59f267346ea31f984 on arbitrum-one
180+
```

website/src/pages/en/subgraphs/mcp/cline.mdx

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,15 @@ Create or edit your `cline_mcp_settings.json` file.
2020
2121
### 2. Add Configuration
2222

23-
```json label="cline_mcp_settings.json"
23+
```json
2424
{
2525
"mcpServers": {
2626
"subgraph": {
2727
"command": "npx",
28-
"args": [
29-
"mcp-remote",
30-
"--header",
31-
"Authorization: Bearer GATEWAY_API_KEY",
32-
"https://subgraph-ai.graphops.xyz/sse"
33-
]
28+
"args": ["mcp-remote", "--header", "Authorization:${AUTH_HEADER}", "https://subgraphs.mcp.thegraph.com/sse"],
29+
"env": {
30+
"AUTH_HEADER": "Bearer GATEWAY_API_KEY"
31+
}
3432
}
3533
}
3634
}
@@ -40,36 +38,6 @@ Create or edit your `cline_mcp_settings.json` file.
4038

4139
Replace `GATEWAY_API_KEY` with your API key from Subgraph Studio.
4240

43-
## Using Both Token API MCP and Subgraph MCP Together
44-
45-
You can configure Cline to use both the Token API MCP and Subgraph MCP simultaneously:
46-
47-
```json label="cline_mcp_settings.json"
48-
{
49-
"mcpServers": {
50-
"token-api": {
51-
"command": "npx",
52-
"args": ["@pinax/mcp", "--sse-url", "https://token-api.thegraph.com/sse"],
53-
"env": {
54-
"ACCESS_TOKEN": "ACCESS_TOKEN"
55-
}
56-
},
57-
"subgraph": {
58-
"command": "npx",
59-
"args": [
60-
"mcp-remote",
61-
"--header",
62-
"Authorization: Bearer GATEWAY_API_KEY",
63-
"https://subgraph-ai.graphops.xyz/sse"
64-
]
65-
}
66-
}
67-
}
68-
```
69-
70-
- For Token API access tokens, visit [The Graph Market](https://thegraph.com/explorer)
71-
- For Subgraph Gateway API keys, visit [Subgraph Studio](https://thegraph.com/studio/)
72-
7341
## Using The Graph Resource in Cline
7442

7543
After configuring Cline:

website/src/pages/en/subgraphs/mcp/cursor.mdx

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,15 @@ Create or edit your `~/.cursor/mcp.json` file.
2020
2121
### 2. Add Configuration
2222

23-
```json label="mcp.json"
23+
```json
2424
{
2525
"mcpServers": {
2626
"subgraph": {
2727
"command": "npx",
28-
"args": [
29-
"mcp-remote",
30-
"--header",
31-
"Authorization: Bearer GATEWAY_API_KEY",
32-
"https://subgraph-ai.graphops.xyz/sse"
33-
]
28+
"args": ["mcp-remote", "--header", "Authorization:${AUTH_HEADER}", "https://subgraphs.mcp.thegraph.com/sse"],
29+
"env": {
30+
"AUTH_HEADER": "Bearer GATEWAY_API_KEY"
31+
}
3432
}
3533
}
3634
}
@@ -40,36 +38,6 @@ Create or edit your `~/.cursor/mcp.json` file.
4038

4139
Replace `GATEWAY_API_KEY` with your API key from Subgraph Studio.
4240

43-
## Using Both Token API MCP and Subgraph MCP Together
44-
45-
You can configure Cursor to use both the Token API MCP and Subgraph MCP simultaneously:
46-
47-
```json label="mcp.json"
48-
{
49-
"mcpServers": {
50-
"token-api": {
51-
"command": "npx",
52-
"args": ["@pinax/mcp", "--sse-url", "https://token-api.mcp.thegraph.com/sse"],
53-
"env": {
54-
"ACCESS_TOKEN": "ACCESS_TOKEN"
55-
}
56-
},
57-
"subgraph": {
58-
"command": "npx",
59-
"args": [
60-
"mcp-remote",
61-
"--header",
62-
"Authorization: Bearer GATEWAY_API_KEY",
63-
"https://subgraph-ai.graphops.xyz/sse"
64-
]
65-
}
66-
}
67-
}
68-
```
69-
70-
- For Token API access tokens, visit [The Graph Market](https://thegraph.com/explorer)
71-
- For Subgraph Gateway API keys, visit [Subgraph Studio](https://thegraph.com/studio/)
72-
7341
## Available Subgraph Tools and Usage
7442

7543
The Subgraph MCP provides several tools for interacting with Subgraphs:

0 commit comments

Comments
 (0)