Skip to content

Commit 701c97a

Browse files
Debugging _meta.json issue
1 parent 8953b60 commit 701c97a

2 files changed

Lines changed: 138 additions & 1 deletion

File tree

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
---
2+
title: Substreams Search MCP
3+
sidebarTitle: Substreams Search
4+
---
5+
6+
MCP server that lets AI agents search, inspect, and analyze [Substreams](https://substreams.dev) packages — from registry discovery to sink deployment. Supports dual transport for local clients and SSE/HTTP for remote agents (OpenClaw, custom frameworks).
7+
8+
## Tools
9+
10+
### `search_substreams`
11+
12+
Search the substreams.dev package registry.
13+
14+
| Parameter | Type | Default | Description |
15+
|-----------|------|---------|-------------|
16+
| `query` | string (required) || Search term, e.g. `"solana dex"` or `"uniswap"` |
17+
| `sort` | string | `"most_downloaded"` | `most_downloaded`, `alphabetical`, `most_used`, `last_uploaded` |
18+
| `network` | string || Filter by chain: `ethereum`, `solana`, `arbitrum-one`, etc. |
19+
20+
Returns package name, URL, creator, network, version, published date, and download count.
21+
22+
### `inspect_package`
23+
24+
Inspect a Substreams package (.spkg) to see its full module graph, protobuf types, and metadata.
25+
26+
| Parameter | Type | Description |
27+
|-----------|------|-------------|
28+
| `url` | string (required) | Direct URL to a `.spkg` file |
29+
30+
Returns:
31+
- Package metadata (name, version, documentation, network)
32+
- All modules with their kind (map/store/blockIndex), output types, and update policies
33+
- Full DAG: each module's `dependsOn` and `dependedBy` relationships
34+
- Input chain for each module (source blocks, other maps, stores with get/deltas mode, params)
35+
- List of all protobuf output types and proto files
36+
- Mermaid diagram of the module graph
37+
38+
### `list_package_modules`
39+
40+
Lightweight alternative to `inspect_package` — just the module names, types, and inputs/outputs.
41+
42+
| Parameter | Type | Description |
43+
|-----------|------|-------------|
44+
| `url` | string (required) | Direct URL to a `.spkg` file |
45+
46+
### `get_sink_config`
47+
48+
Analyze a package's sink configuration and generate ready-to-run CLI commands.
49+
50+
| Parameter | Type | Description |
51+
|-----------|------|-------------|
52+
| `url` | string (required) | Direct URL to a `.spkg` file |
53+
54+
Returns one of three results:
55+
56+
- **`sink_configured`** — Package has an embedded sink config. Extracts the SQL schema (for SQL sinks), identifies the sink module and type, and generates `install`, `setup`, and `run` commands with the correct network endpoint.
57+
- **`no_sink_config_but_compatible_modules_found`** — No embedded config, but modules output sink-compatible types (e.g. `DatabaseChanges`). Identifies them and suggests how to wire up sinking.
58+
- **`no_sink_support`** — No sink-compatible modules. Lists all module output types so you know what custom consumer you'd need.
59+
60+
## Workflow
61+
62+
```
63+
search_substreams("uniswap", network: "polygon")
64+
→ find package, get spkg.io URL
65+
66+
inspect_package("https://spkg.io/creator/package-v1.0.0.spkg")
67+
→ see module DAG, output types, what it produces
68+
69+
get_sink_config("https://spkg.io/creator/package-v1.0.0.spkg")
70+
→ get SQL schema + CLI commands to deploy
71+
```
72+
73+
## Quick Start (npx)
74+
75+
No installation needed:
76+
77+
### Claude Desktop / Cursor / Claude Code (stdio)
78+
79+
Add to your MCP config (`claude_desktop_config.json`, `~/.cursor/mcp.json`, or `~/.claude/mcp.json`):
80+
81+
```json
82+
{
83+
"mcpServers": {
84+
"substreams-search": {
85+
"command": "npx",
86+
"args": ["substreams-search-mcp"]
87+
}
88+
}
89+
}
90+
```
91+
92+
### OpenClaw / Remote Agents (SSE)
93+
94+
Start the server with the HTTP transport:
95+
96+
```bash
97+
# Dual transport — stdio + SSE on port 3849
98+
npx substreams-search-mcp --http
99+
100+
# SSE only (for remote/server deployments)
101+
npx substreams-search-mcp --http-only
102+
103+
# Custom port
104+
MCP_HTTP_PORT=4000 npx substreams-search-mcp --http
105+
```
106+
107+
Then point your agent at the SSE endpoint:
108+
109+
```json
110+
{
111+
"mcpServers": {
112+
"substreams-search": {
113+
"url": "http://localhost:3849/sse"
114+
}
115+
}
116+
}
117+
```
118+
119+
### Transport Modes
120+
121+
| Invocation | Transports | Use case |
122+
|---|---|---|
123+
| `npx substreams-search-mcp` | stdio | Claude Desktop, Cursor, Claude Code |
124+
| `npx substreams-search-mcp --http` | stdio + SSE :3849 | Dual — local + remote agents |
125+
| `npx substreams-search-mcp --http-only` | SSE :3849 | OpenClaw, remote deployments |
126+
127+
A `/health` endpoint is available at `http://localhost:3849/health` when HTTP transport is active.
128+
129+
## How it works
130+
131+
- **Search**: The substreams.dev registry has no public API. This server scrapes the package listing pages, paginates through all results, deduplicates, and returns structured JSON. Multi-word queries search for the first word server-side and filter the rest client-side.
132+
- **Inspect**: Uses [`@substreams/core`](https://github.com/substreams-js/substreams-js) to fetch and parse `.spkg` files (protobuf-encoded Substreams packages), extracting module definitions, DAG relationships, and proto type information.
133+
- **Sink config**: Reads the embedded `sinkConfig` (a `google.protobuf.Any` field) from the package, decodes it based on the type URL, and maps networks to Substreams endpoints for correct CLI commands.
134+
135+
## Acknowledgments
136+
137+
Thanks for PaulieB for creating the [Substreams Search MCP](https://github.com/PaulieB14/substreams-search-mcp)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export default {
2-
'quick-setup': '',
2+
'setup': '',
33
}

0 commit comments

Comments
 (0)