Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
cd66ef4
Adding Token API Polymarket Overview
brandonleekramer Apr 16, 2026
8d8c6ae
Adding x402 Subgraph payment doc (with update 2)
brandonleekramer Apr 16, 2026
e3262d1
Ran prettier
brandonleekramer Apr 16, 2026
93fe2b1
Adding Subgraph and Substreams Skills
brandonleekramer Apr 17, 2026
8953b60
Cleaned Subgraph and Substreams Skills
brandonleekramer Apr 17, 2026
701c97a
Debugging _meta.json issue
brandonleekramer Apr 17, 2026
3617ae8
Fixing Prettier issues
brandonleekramer Apr 17, 2026
090da02
Update website/src/pages/en/ai-suite/subgraph-skills/setup.mdx
brandonleekramer Apr 17, 2026
2c3eff6
Update website/src/pages/en/ai-suite/subgraph-skills/setup.mdx
brandonleekramer Apr 17, 2026
492849b
Update website/src/pages/en/ai-suite/substreams-skills/setup.mdx
brandonleekramer Apr 17, 2026
410689f
Update website/src/pages/en/subgraphs/guides/x402-payments.mdx
brandonleekramer Apr 17, 2026
b8491da
Update website/src/pages/en/subgraphs/guides/x402-payments.mdx
brandonleekramer Apr 17, 2026
decf918
Update website/src/pages/en/subgraphs/guides/x402-payments.mdx
brandonleekramer Apr 17, 2026
d2768c9
Update website/src/pages/en/subgraphs/guides/x402-payments.mdx
brandonleekramer Apr 17, 2026
de95019
Update website/src/pages/en/token-api/guides/polymarket.mdx
brandonleekramer Apr 17, 2026
a89a929
Update website/src/pages/en/token-api/guides/polymarket.mdx
brandonleekramer Apr 17, 2026
829ebc6
Update website/src/pages/en/token-api/guides/polymarket.mdx
brandonleekramer Apr 17, 2026
76c0b9b
Update website/src/pages/en/token-api/guides/polymarket.mdx
brandonleekramer Apr 17, 2026
de9acf4
Update website/src/pages/en/token-api/guides/polymarket.mdx
brandonleekramer Apr 17, 2026
c45f1a9
Update website/src/pages/en/token-api/guides/polymarket.mdx
brandonleekramer Apr 17, 2026
8951283
Update website/src/pages/en/token-api/guides/polymarket.mdx
brandonleekramer Apr 17, 2026
aa7c150
Update website/src/pages/en/ai-suite/subgraph-skills/setup.mdx
brandonleekramer Apr 17, 2026
b6f6089
Address Benoit's comments
brandonleekramer Apr 17, 2026
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
1 change: 1 addition & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ http {
rewrite ^/docs/en/token-api/mcp/cline/$ $scheme://$http_host/docs/en/ai-suite/token-api-mcp/ permanent;
rewrite ^/docs/en/token-api/mcp/cline/$ $scheme://$http_host/docs/en/ai-suite/token-api-mcp/ permanent;
rewrite ^/docs/en/token-api/endpoint-pricing/$ $scheme://$http_host/docs/en/token-api/endpoints/pricing/ permanent;
rewrite ^/docs/en/ai-suite/token-api-skills/quick-setup$ $scheme://$http_host/docs/en/token-api/skills/ permanent;
# Temporary redirects (302)
rewrite ^/docs/en/querying/graph-client/$ $scheme://$http_host/docs/en/subgraphs/querying/graph-client/README/ redirect;
rewrite ^/docs/en/developing/graph-ts/$ $scheme://$http_host/docs/en/subgraphs/developing/creating/graph-ts/README/ redirect;
Expand Down
Empty file added website/.Rhistory
Empty file.
4 changes: 3 additions & 1 deletion website/src/pages/en/ai-suite/_meta-titles.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"ai-introduction": "The Graph's AI",
"subgraph-mcp": "Subgraph MCP",
"token-api-mcp": "Token API MCP",
"token-api-skills": "Token API Skills"
"subgraph-skills": "Subgraph Skills",
"token-api-skills": "Token API Skills",
"substreams-skills": "Substreams Skills"
}
2 changes: 2 additions & 0 deletions website/src/pages/en/ai-suite/_meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ export default {
'ai-introduction': titles['ai-introduction'],
'subgraph-mcp': titles['subgraph-mcp'],
'token-api-mcp': titles['token-api-mcp'],
'subgraph-skills': titles['subgraph-skills'],
'token-api-skills': titles['token-api-skills'],
'substreams-skills': titles['substreams-skills'],
}
119 changes: 119 additions & 0 deletions website/src/pages/en/ai-suite/subgraph-skills.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
---
title: Agent Skills for Subgraphs
sidebarTitle: Subgraph Skills
---

A collection of AI agent skills providing expert knowledge for developing, testing, and deploying subgraphs with The Graph protocol.

## Overview

This repository provides subgraph development expertise for AI coding assistants in **two formats**:

| Format | Location | Use With |
| ---------------------- | ----------- | ------------------- |
| **Claude Code Plugin** | `skills/` | Claude Code CLI |
| **OpenClaw Skills** | `openclaw/` | OpenClaw / Clawdbot |

Same knowledge, different agent platforms.

## Skills

### Subgraph Development

Core development knowledge including:

- Schema design and GraphQL types
- Manifest configuration (subgraph.yaml)
- AssemblyScript mapping handlers
- Data source templates
- Contract bindings and calls
- **Subgraph Composition** - Combine multiple subgraphs
- **Common Patterns** - ERC20, DEX, NFT, Lending, Staking, Governance
- Subgraph Uncrashable (safe code generation)
- Deployment workflows

### Subgraph Optimization

Performance best practices from The Graph docs:

- Pruning with indexerHints
- Arrays with @derivedFrom
- Immutable entities and Bytes as IDs
- Avoiding eth_calls
- Timeseries and aggregations
- Grafting for hotfixes

### Subgraph Testing

Quality assurance with Matchstick and Subgraph Linter:

- **Subgraph Linter** - Static analysis to catch bugs before runtime
- **Common Errors** - Troubleshooting guide for indexing issues
- Unit testing setup and patterns with Matchstick
- Mock events and contract calls
- Entity assertions
- Data source mocking
- CI/CD integration

## Installation

### Claude Code

```bash
# Add as a Claude Code plugin
claude plugins add PaulieB14/subgraphs-skills
```

### OpenClaw / Clawdbot

```bash
# Copy skills to OpenClaw directory
cp -r openclaw/subgraph-* ~/.openclaw/skills/

# Or via ClawHub (when published)
clawdbot skill install subgraph-dev
clawdbot skill install subgraph-optimization
clawdbot skill install subgraph-testing
```

## Usage Examples

Once installed, the AI assistant will have access to subgraph development expertise:

**Schema Design:**

> "Create a schema for tracking DEX swaps with proper relationships"

**Optimization:**

> "How do I optimize my subgraph for faster indexing?"

**Testing:**

> "Write unit tests for my Transfer event handler"

## Resources

- [The Graph Documentation](https://thegraph.com/docs/)
- [Subgraph Best Practices](https://thegraph.com/docs/en/subgraphs/best-practices/pruning/)
- [Subgraph Composition](https://thegraph.com/docs/en/subgraphs/guides/subgraph-composition/) - Combine multiple subgraphs
- [Subgraph Linter](https://thegraph.com/docs/en/subgraphs/developing/subgraph-linter/) - Static analysis tool
- [Subgraph Uncrashable](https://thegraph.com/docs/en/subgraphs/developing/subgraph-uncrashable/) - Safe code generation
- [Matchstick Testing Framework](https://thegraph.com/docs/en/subgraphs/developing/creating/unit-testing-framework/)
- [AssemblyScript API](https://thegraph.com/docs/en/subgraphs/developing/creating/assemblyscript-api/)

## Platforms

This skill pack works with:

| Platform | Description | Link |
| --- | --- | --- |
| **Claude Code** | Anthropic's official CLI for Claude | [claude.ai/claude-code](https://claude.ai/claude-code) |
| **OpenClaw** | Open-source AI agent framework | [github.com/openclaw/openclaw](https://github.com/openclaw/openclaw) |

## Acknowledgments

- Built with [Claude](https://claude.ai) (Anthropic's AI assistant)
- Subgraph expertise from [The Graph Documentation](https://thegraph.com/docs/)
- Inspired by [AGENTS.md](https://github.com/agentsmd/agents.md) format
- OpenClaw format based on [substreams-skills](https://github.com/streamingfast/substreams-skills)
138 changes: 138 additions & 0 deletions website/src/pages/en/ai-suite/substreams-mcp/search.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
---
title: Substreams Search MCP
sidebarTitle: Substreams Search
---

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

## Tools

### Search Substreams

`search_substreams`: Search the substreams.dev package registry.

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `query` | string (required) | — | Search term, e.g. `"solana dex"` or `"uniswap"` |
| `sort` | string | `"most_downloaded"` | `most_downloaded`, `alphabetical`, `most_used`, `last_uploaded` |
| `network` | string | — | Filter by chain: `ethereum`, `solana`, `arbitrum-one`, etc. |

Returns package name, URL, creator, network, version, published date, and download count.

### Inspect Package

`inspect_package`: Inspect a Substreams package (.spkg) to see its full module graph, protobuf types, and metadata.

| Parameter | Type | Description |
| --------- | ----------------- | ---------------------------- |
| `url` | string (required) | Direct URL to a `.spkg` file |

Returns:

- Package metadata (name, version, documentation, network)
- All modules with their kind (map/store/blockIndex), output types, and update policies
- Full DAG: each module's `dependsOn` and `dependedBy` relationships
- Input chain for each module (source blocks, other maps, stores with get/deltas mode, params)
- List of all protobuf output types and proto files
- Mermaid diagram of the module graph

### List Package Modules

`list_package_modules`: Lightweight alternative to `inspect_package` — just the module names, types, and inputs/outputs.

| Parameter | Type | Description |
| --------- | ----------------- | ---------------------------- |
| `url` | string (required) | Direct URL to a `.spkg` file |

### Get Sink Configuration

`get_sink_config`: Analyze a package's sink configuration and generate ready-to-run CLI commands.

| Parameter | Type | Description |
| --------- | ----------------- | ---------------------------- |
| `url` | string (required) | Direct URL to a `.spkg` file |

Returns one of three results:

- **`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.
- **`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.
- **`no_sink_support`** — No sink-compatible modules. Lists all module output types so you know what custom consumer you'd need.

## Workflow

```
search_substreams("uniswap", network: "polygon")
→ find package, get spkg.io URL

inspect_package("https://spkg.io/creator/package-v1.0.0.spkg")
→ see module DAG, output types, what it produces

get_sink_config("https://spkg.io/creator/package-v1.0.0.spkg")
→ get SQL schema + CLI commands to deploy
```

## Quick Start (npx)

No installation needed:

### Claude Desktop / Cursor / Claude Code

Add to your MCP config (`claude_desktop_config.json`, `~/.cursor/mcp.json`, or `~/.claude/mcp.json`):

```json
{
"mcpServers": {
"substreams-search": {
"command": "npx",
"args": ["substreams-search-mcp"]
}
}
}
```

### OpenClaw / Remote Agents (SSE)

Start the server with the HTTP transport:

```bash
# Dual transport — stdio + SSE on port 3849
npx substreams-search-mcp --http

# SSE only (for remote/server deployments)
npx substreams-search-mcp --http-only

# Custom port
MCP_HTTP_PORT=4000 npx substreams-search-mcp --http
```

Then point your agent at the SSE endpoint:

```json
{
"mcpServers": {
"substreams-search": {
"url": "http://localhost:3849/sse"
}
}
}
```

### Transport Modes

| Invocation | Transports | Use case |
| --------------------------------------- | ----------------- | ----------------------------------- |
| `npx substreams-search-mcp` | stdio | Claude Desktop, Cursor, Claude Code |
| `npx substreams-search-mcp --http` | stdio + SSE :3849 | Dual — local + remote agents |
| `npx substreams-search-mcp --http-only` | SSE :3849 | OpenClaw, remote deployments |

A `/health` endpoint is available at `http://localhost:3849/health` when HTTP transport is active.

## How it works

- **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.
- **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.
- **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.

## Acknowledgments

Thanks for PaulieB for creating the [Substreams Search MCP](https://github.com/PaulieB14/substreams-search-mcp)
89 changes: 89 additions & 0 deletions website/src/pages/en/ai-suite/substreams-skills.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
title: Agent Skills for Substreams
sidebarTitle: Substreams Skills
---

AI coding assistants can be enhanced with specialized Substreams expertise through agent skills. These open-source knowledge packages give AI assistants deep understanding of Substreams development patterns, best practices, and debugging techniques.

## Available Skills

### Substreams Development (`substreams-dev`)

Expert knowledge for developing, building, and debugging Substreams projects on any blockchain:

- Creating and configuring `substreams.yaml` manifests
- Writing efficient Rust modules (map, store, index types)
- Protobuf schema design and code generation
- Performance optimization and avoiding excessive cloning
- Debugging and troubleshooting common issues

### Substreams SQL (`substreams-sql`)

Expert knowledge for building SQL database sinks from Substreams data:

- **Database Changes (CDC)** - Stream individual row changes for real-time consistency
- **Relational Mappings** - Transform data into normalized tables with proper relationships
- **PostgreSQL** - Advanced patterns, indexing strategies, and performance optimization
- **ClickHouse** - Analytics-optimized schemas, materialized views, and time-series patterns
- **Schema Design** - Best practices for blockchain data modeling

### Substreams Testing (`substreams-testing`)

Expert knowledge for testing Substreams applications at all levels:

- **Unit Testing** - Testing individual functions with real blockchain data
- **Integration Testing** - End-to-end workflows with real block processing
- **Performance Testing** - Benchmarking, memory profiling, and production mode validation
- **FireCore Tools** - Using Firehose, StreamingFast API, and testing utilities
- **CI/CD Integration** - Automated testing pipelines and regression detection

## Installation

### Claude Code

Install the plugin from the marketplace:

```bash
claude plugin marketplace add https://github.com/streamingfast/substreams-skills
```

Then enable the skills:

1. Run `/plugin` to open the plugin manager
2. Go to the **Discover** tab
3. Find and install the `substreams-dev` plugin (which pulls all defined skills automatically)
4. Restart Claude instance(s) for skills to be discovered

After installation, Claude automatically uses Substreams expertise when working on relevant projects.

**Alternative: Local Development**

Clone and load directly without installing from the marketplace:

```bash
git clone https://github.com/streamingfast/substreams-skills.git
claude --plugin-dir ./substreams-skills
```

### Cursor

Clone the repository and add the skill directory path in Cursor settings:

```
~/substreams-skills/skills/substreams-dev
```

### VS Code

VS Code 1.107+ supports Claude Skills as an experimental feature:

1. Enable the experimental feature in settings
2. Add skill paths to your configuration
3. Skills will be available to Claude in VS Code

See the [VS Code 1.107 release notes](https://code.visualstudio.com/updates/v1_107#_reuse-your-claude-skills-experimental) for details.

## Resources

- [Substreams Skills Repository](https://github.com/streamingfast/substreams-skills)
- [Claude Code Plugins Documentation](https://docs.anthropic.com/en/docs/claude-code/plugins)
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Quick Setup
title: Agent Skills for Token API
sidebarTitle: Token API Skills
---

## Quick Setup
Expand Down
3 changes: 0 additions & 3 deletions website/src/pages/en/ai-suite/token-api-skills/_meta.js

This file was deleted.

1 change: 1 addition & 0 deletions website/src/pages/en/subgraphs/guides/_meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ export default {
'secure-api-keys-nextjs': '',
polymarket: '',
agent0: '',
'x402-payments': '',
'contract-analyzer': '',
}
Loading
Loading