|
| 1 | +<div align="center"> |
| 2 | + |
1 | 3 | # web3-docs |
2 | 4 |
|
3 | | -MCP server for Web3 protocol documentation — EIPs, ERCs, BIPs, SIMDs, Cosmos ADRs, Polkadot RFCs, Stacks SIPs, Avalanche ACPs, plus a canonical contract registry. |
| 5 | +**One MCP server, eleven protocol-spec repos.** |
| 6 | +Ask Claude about EIPs, BIPs, ADRs, CIPs, RFCs and canonical contract addresses — without ever leaving your editor. |
| 7 | + |
| 8 | +[](LICENSE) |
| 9 | +[](https://www.python.org/downloads/) |
| 10 | +[](https://modelcontextprotocol.io/) |
| 11 | +[](https://github.com/dioptx/web3-docs/actions/workflows/ci.yml) |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | +</div> |
| 16 | + |
| 17 | +## Why |
| 18 | + |
| 19 | +Specs for blockchain protocols live across **eleven different upstream repos** on three different forges. Every time you need to look up EIP-4844, BIP-340, CIP-25, or which fork shipped `PUSH0`, you're tab-hunting through GitHub. This MCP indexes them all locally with FTS5 ranking — **1,767 proposals across 10 chains** plus addresses for 19 protocols on Ethereum, Arbitrum, Base, Optimism, Polygon, and more — so Claude can answer with the *actual spec text*, not a hallucinated paraphrase. |
| 20 | + |
| 21 | +## Install |
4 | 22 |
|
5 | | -## What it does |
| 23 | +> **Requires:** Python 3.11+ · [`uv`](https://docs.astral.sh/uv/) (provides `uvx`) · ~500 MB free disk for the index · `git` on PATH (used by `--sync`). |
6 | 24 |
|
7 | | -A queryable MCP for blockchain protocol specs and canonical contract addresses. Stop digging through eight different GitHub repos when you need to look up EIP-4844, BIP-340, or which fork shipped PUSH0 — ask one tool that has them all indexed locally with FTS5 ranking. Bundles 1,500+ proposals across 7 chains plus addresses for 19 protocols on Ethereum, Arbitrum, Base, Optimism, Polygon, and more. |
| 25 | +### Claude Code |
8 | 26 |
|
9 | | -## Quick Start |
| 27 | +```bash |
| 28 | +claude mcp add web3-docs -- uvx --from git+https://github.com/dioptx/web3-docs web3-docs-mcp |
| 29 | +``` |
10 | 30 |
|
11 | | -Clone, install, and build the local index: |
| 31 | +Build the index (one-time, ~2 min, ~500 MB in `~/.cache/web3-docs-mcp/`): |
12 | 32 |
|
13 | 33 | ```bash |
14 | | -git clone https://github.com/dioptx/web3-docs.git |
15 | | -cd web3-docs |
16 | | -uv sync # or: pip install -e . |
17 | | -python3 server.py --sync # one-time: clones source repos and builds proposals.db |
| 34 | +uvx --from git+https://github.com/dioptx/web3-docs web3-docs-mcp --sync |
18 | 35 | ``` |
19 | 36 |
|
20 | | -Register the server in `~/.claude.json` (or your project `.mcp.json`): |
| 37 | +That's it. Restart Claude Code and try **"Use web3-docs to look up EIP-1559."** |
| 38 | + |
| 39 | +### Cursor / Windsurf / generic MCP client |
| 40 | + |
| 41 | +Add to your client's MCP config (`~/.cursor/mcp.json`, etc.): |
21 | 42 |
|
22 | 43 | ```json |
23 | 44 | { |
24 | 45 | "mcpServers": { |
25 | 46 | "web3-docs": { |
26 | | - "command": "python3", |
27 | | - "args": ["/absolute/path/to/web3-docs/server.py"], |
28 | | - "type": "stdio" |
| 47 | + "command": "uvx", |
| 48 | + "args": ["--from", "git+https://github.com/dioptx/web3-docs", "web3-docs-mcp"] |
29 | 49 | } |
30 | 50 | } |
31 | 51 | } |
32 | 52 | ``` |
33 | 53 |
|
34 | | -If you use `uv`, swap `python3` for `uv` and prepend `["run", "--directory", "/absolute/path/to/web3-docs", "python3", "server.py"]`. |
| 54 | +### From source |
| 55 | + |
| 56 | +```bash |
| 57 | +git clone https://github.com/dioptx/web3-docs.git && cd web3-docs |
| 58 | +uv sync |
| 59 | +uv run python server.py --sync # build index |
| 60 | +uv run python server.py # run stdio server |
| 61 | +``` |
35 | 62 |
|
36 | | -## Example queries |
| 63 | +## What you can ask |
37 | 64 |
|
38 | | -The server exposes three tools: `resolve_proposal`, `query_protocol_docs`, and `resolve_contract`. |
| 65 | +| Ask Claude… | Tool chain | |
| 66 | +|---|---| |
| 67 | +| "What's the fee market in EIP-4844?" | `resolve_proposal` → `query_protocol_docs(query="fee")` | |
| 68 | +| "Show me Cosmos ADR-001." | `resolve_proposal` → `query_protocol_docs` | |
| 69 | +| "Uniswap router on Base?" | `resolve_contract(protocol="uniswap", chain_id="8453")` | |
| 70 | +| "Which BIPs activated with Taproot?" | `resolve_proposal("Taproot")` | |
| 71 | +| "Cardano CIP for native tokens?" | `resolve_proposal("native tokens")` → cip-25 | |
| 72 | +| "ERC-4337 EntryPoint address on Arbitrum?" | `resolve_contract("erc4337", "42161")` | |
39 | 73 |
|
40 | | -**1. Look up EIP-4844 (proto-danksharding)** |
| 74 | +## Tools |
41 | 75 |
|
42 | | -> "Use web3-docs to find the EIP for blob transactions and explain the fee market." |
| 76 | +| Tool | What it does | |
| 77 | +|---|---| |
| 78 | +| `resolve_proposal(query)` | Fuzzy-find a proposal by keyword, fork name, opcode, or ID. Returns top-5 ranked hits with chain/status/fork. | |
| 79 | +| `query_protocol_docs(proposal_id, query?)` | Read the full spec body. With `query`, returns only the most relevant sections (token-budgeted). Includes metadata header (status, fork, activation date, authors). | |
| 80 | +| `resolve_contract(protocol, chain_id?)` | Look up canonical deployed addresses. 19 protocols × major EVM chains. Omit `chain_id` for all chains. | |
43 | 81 |
|
44 | | -Claude calls `resolve_proposal(query="blob transactions")` → `eip-4844`, then `query_protocol_docs(proposal_id="eip-4844", query="blob fee")` and returns the relevant spec section with metadata (status, fork, activation date). |
| 82 | +## Sources |
45 | 83 |
|
46 | | -**2. Fetch a Cosmos ADR** |
| 84 | +11 upstream repos, all synced via `--sync`: |
47 | 85 |
|
48 | | -> "Show me Cosmos ADR-001." |
| 86 | +| Chain | Source | |
| 87 | +|---|---| |
| 88 | +| Ethereum (EIPs) | [`ethereum/EIPs`](https://github.com/ethereum/EIPs) | |
| 89 | +| Ethereum (ERCs) | [`ethereum/ERCs`](https://github.com/ethereum/ERCs) | |
| 90 | +| Bitcoin | [`bitcoin/bips`](https://github.com/bitcoin/bips) | |
| 91 | +| Solana | [`solana-foundation/solana-improvement-documents`](https://github.com/solana-foundation/solana-improvement-documents) | |
| 92 | +| Cosmos | [`cosmos/cosmos-sdk`](https://github.com/cosmos/cosmos-sdk) (`docs/architecture`) | |
| 93 | +| Polkadot | [`polkadot-fellows/RFCs`](https://github.com/polkadot-fellows/RFCs) | |
| 94 | +| Stacks | [`stacksgov/sips`](https://github.com/stacksgov/sips) | |
| 95 | +| Avalanche | [`avalanche-foundation/ACPs`](https://github.com/avalanche-foundation/ACPs) | |
| 96 | +| Cardano | [`cardano-foundation/CIPs`](https://github.com/cardano-foundation/CIPs) | |
| 97 | +| Tezos | [`tezos/tzip`](https://gitlab.com/tezos/tzip) | |
| 98 | +| Sui | [`sui-foundation/sips`](https://github.com/sui-foundation/sips) | |
49 | 99 |
|
50 | | -Claude calls `resolve_proposal(query="ADR-001")` → `query_protocol_docs(proposal_id="cosmos-adr-001")`. Returns the architectural decision record body with its status header. |
| 100 | +Fork mappings come from [`ethereum/execution-specs`](https://github.com/ethereum/execution-specs) plus canonical Bitcoin soft-fork activations (P2SH, SegWit, Taproot, …). |
51 | 101 |
|
52 | | -**3. Get the canonical Uniswap address on Base** |
| 102 | +Contract registry covers: `aave`, `across`, `chainlink`, `compound`, `create2_deployer`, `curve`, `ens`, `erc4337`, `gnosis_safe`, `lido`, `maker`, `multicall`, `oneinch`, `permit2`, `seaport`, `uniswap`, `usdc`, `usdt`, `weth`. |
53 | 103 |
|
54 | | -> "What's the Uniswap router on Base?" |
| 104 | +## Why not … |
55 | 105 |
|
56 | | -Claude calls `resolve_contract(protocol="uniswap", chain_id="8453")` and returns the deployed router/factory addresses for the matching Uniswap version on Base. |
| 106 | +**…just `gh search` or WebFetch each spec on demand?** You'd burn tokens on HTML markup and pay a network round-trip per query. `web3-docs` indexes everything once into local SQLite + FTS5 — sub-millisecond ranked search, plain-text bodies, no rate limits, works offline. |
57 | 107 |
|
58 | | -## Supported sources |
| 108 | +**…one MCP per chain?** You'd manage eleven separate servers and Claude wouldn't know which to call. One unified tool with a single `resolve_proposal` entry point lets the model find the right doc by *concept* (e.g. "blob transactions" → `eip-4844`) rather than guessing the source. |
59 | 109 |
|
60 | | -Protocol specs (synced from upstream Git repos via `python3 server.py --sync`): |
| 110 | +**…ask Claude directly without an MCP?** Models hallucinate spec details — wrong fork, wrong gas costs, wrong opcode numbers. This server returns the *actual* upstream text with metadata (status, fork, activation date) so Claude can quote it verbatim. |
61 | 111 |
|
62 | | -- **EIPs** — [ethereum/EIPs](https://github.com/ethereum/EIPs) |
63 | | -- **ERCs** — [ethereum/ERCs](https://github.com/ethereum/ERCs) |
64 | | -- **BIPs** — [bitcoin/bips](https://github.com/bitcoin/bips) |
65 | | -- **SIMDs** — [solana-foundation/solana-improvement-documents](https://github.com/solana-foundation/solana-improvement-documents) |
66 | | -- **Cosmos ADRs** — [cosmos/cosmos-sdk](https://github.com/cosmos/cosmos-sdk) (`docs/architecture`) |
67 | | -- **Polkadot RFCs** — [polkadot-fellows/RFCs](https://github.com/polkadot-fellows/RFCs) |
68 | | -- **Stacks SIPs** — [stacksgov/sips](https://github.com/stacksgov/sips) |
69 | | -- **Avalanche ACPs** — [avalanche-foundation/ACPs](https://github.com/avalanche-foundation/ACPs) |
| 112 | +**…use a vector DB?** Spec corpora are small (≈ 1.7K docs), domain vocabulary is precise (`PUSH0`, `BLOBHASH`, `taproot`), and exact-term matching beats embeddings here. FTS5 gives BM25 ranking with zero infrastructure. |
70 | 113 |
|
71 | | -Fork mappings come from [ethereum/execution-specs](https://github.com/ethereum/execution-specs) plus canonical Bitcoin soft-fork activations (P2SH, SegWit, Taproot, …). |
| 114 | +## Configuration |
72 | 115 |
|
73 | | -Contract registry (`contracts.json`) covers 19 protocols across major EVM chains: |
| 116 | +| Env var | Default | Purpose | |
| 117 | +|---|---|---| |
| 118 | +| `WEB3_DOCS_DATA_DIR` | `~/.cache/web3-docs-mcp` (macOS/Linux) | Where source repos and the SQLite index live | |
74 | 119 |
|
75 | | -`aave`, `across`, `chainlink`, `compound`, `create2_deployer`, `curve`, `ens`, `erc4337`, `gnosis_safe`, `lido`, `maker`, `multicall`, `oneinch`, `permit2`, `seaport`, `uniswap`, `usdc`, `usdt`, `weth`. |
| 120 | +## Troubleshooting |
| 121 | + |
| 122 | +**"No proposals found" on any query.** You haven't run `--sync` yet. Run: |
| 123 | + |
| 124 | +```bash |
| 125 | +uvx --from git+https://github.com/dioptx/web3-docs web3-docs-mcp --sync |
| 126 | +``` |
| 127 | + |
| 128 | +**`uvx: command not found`.** Install [uv](https://docs.astral.sh/uv/getting-started/installation/): `curl -LsSf https://astral.sh/uv/install.sh | sh`. |
| 129 | + |
| 130 | +**Want to free disk space?** Source repos (`~/.cache/web3-docs-mcp/repos/`) can be deleted after sync; only `proposals.db` is needed at runtime. Re-run `--sync` to update. |
| 131 | + |
| 132 | +**Stale data?** Re-run `--sync` — it does a fast `git pull` and reindexes incrementally. |
| 133 | + |
| 134 | +## Development |
| 135 | + |
| 136 | +```bash |
| 137 | +git clone https://github.com/dioptx/web3-docs.git && cd web3-docs |
| 138 | +uv sync --extra test |
| 139 | +uv run pytest # 90 tests, BDD + unit |
| 140 | +uv build # build wheel + sdist |
| 141 | +``` |
76 | 142 |
|
77 | 143 | ## Status |
78 | 144 |
|
79 | | -v0.1.0 — initial standalone release (2026-04-07). SQLite + FTS5 backed, FastMCP stdio transport, BDD test suite under `tests/`. |
| 145 | +v0.2.0 — adds Cardano CIPs, Tezos TZIPs, Sui SIPs (10 chains, 1,767 proposals). SQLite + FTS5, FastMCP stdio transport. See [CHANGELOG.md](CHANGELOG.md) for release history. |
| 146 | + |
| 147 | +## License |
| 148 | + |
| 149 | +MIT — see [LICENSE](LICENSE). |
0 commit comments