Skip to content

Commit 6c19d6a

Browse files
author
Dennis
committed
Prep v0.2.0 release: PyPI/MCP packaging + hero GIF + refreshed README
- pyproject: hatchling build, full PyPI metadata, web3-docs-mcp script entry point, bump to 0.2.0 - server.py: data dir resolves via WEB3_DOCS_DATA_DIR / platformdirs cache instead of writing inside the install root - README: centred hero with badges + animated terminal demo, install snippets for Claude Code / Cursor, "Why not …" positioning section, requirements line, troubleshooting - docs/assets: VHS-rendered demo.gif (regenerated from demo.py + .tape), static hero.svg fallback - server.json: MCP Registry manifest pointing at PyPI package - .github/workflows/ci.yml: pytest on 3.11/3.12/3.13 - CHANGELOG.md, .gitignore (build/, dist/)
1 parent 58fad1c commit 6c19d6a

12 files changed

Lines changed: 446 additions & 44 deletions

File tree

.github/workflows/ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ["3.11", "3.12", "3.13"]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v3
22+
with:
23+
enable-cache: true
24+
25+
- name: Set up Python ${{ matrix.python-version }}
26+
run: uv python install ${{ matrix.python-version }}
27+
28+
- name: Install dependencies
29+
run: uv sync --extra test
30+
31+
- name: Run tests
32+
run: uv run pytest -q

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ __pycache__/
44
.venv/
55
.pytest_cache/
66
*.egg-info/
7+
build/
8+
dist/
79

810
# Data (large, cloned on setup)
911
data/repos/

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.2.0] — 2026-04-26
9+
10+
### Added
11+
- Cardano CIP support (`cardano-foundation/CIPs`).
12+
- Tezos TZIP support (`tezos/tzip` on GitLab).
13+
- Sui SIP support (`sui-foundation/sips`).
14+
- `[project.scripts]` entry point — install via `uvx --from git+https://github.com/dioptx/web3-docs web3-docs-mcp`.
15+
- `WEB3_DOCS_DATA_DIR` env var to override the index location.
16+
- Hatchling-based wheel/sdist build, PyPI-ready metadata.
17+
- CHANGELOG.
18+
19+
### Changed
20+
- Default data directory moved from `./data/` to the platform user cache directory (`~/.cache/web3-docs-mcp/` on macOS/Linux) so installed packages can write to it.
21+
- README now lists 11 sources / 10 chains / 1,767 proposals and shows MCP install snippets for Claude Code and Cursor.
22+
23+
## [0.1.0] — 2026-04-07
24+
25+
### Added
26+
- Initial standalone release.
27+
- Sources: EIPs, ERCs, BIPs, SIMDs, Cosmos ADRs, Polkadot RFCs, Stacks SIPs, Avalanche ACPs.
28+
- SQLite + FTS5 backed index, FastMCP stdio transport.
29+
- Tools: `resolve_proposal`, `query_protocol_docs`, `resolve_contract`.
30+
- Canonical contract registry covering 19 protocols across major EVM chains.
31+
- BDD test suite under `tests/`.
32+
33+
[0.2.0]: https://github.com/dioptx/web3-docs/releases/tag/v0.2.0
34+
[0.1.0]: https://github.com/dioptx/web3-docs/releases/tag/v0.1.0

README.md

Lines changed: 109 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,149 @@
1+
<div align="center">
2+
13
# web3-docs
24

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: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
9+
[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
10+
[![MCP](https://img.shields.io/badge/MCP-stdio-green.svg)](https://modelcontextprotocol.io/)
11+
[![CI](https://github.com/dioptx/web3-docs/actions/workflows/ci.yml/badge.svg)](https://github.com/dioptx/web3-docs/actions/workflows/ci.yml)
12+
13+
![web3-docs MCP demo](docs/assets/demo.gif)
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
422

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`).
624
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
826

9-
## Quick Start
27+
```bash
28+
claude mcp add web3-docs -- uvx --from git+https://github.com/dioptx/web3-docs web3-docs-mcp
29+
```
1030

11-
Clone, install, and build the local index:
31+
Build the index (one-time, ~2 min, ~500 MB in `~/.cache/web3-docs-mcp/`):
1232

1333
```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
1835
```
1936

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

2243
```json
2344
{
2445
"mcpServers": {
2546
"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"]
2949
}
3050
}
3151
}
3252
```
3353

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+
```
3562

36-
## Example queries
63+
## What you can ask
3764

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")` |
3973

40-
**1. Look up EIP-4844 (proto-danksharding)**
74+
## Tools
4175

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

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
4583

46-
**2. Fetch a Cosmos ADR**
84+
11 upstream repos, all synced via `--sync`:
4785

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

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, …).
51101

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`.
53103

54-
> "What's the Uniswap router on Base?"
104+
## Why not …
55105

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

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

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

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

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
72115

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 |
74119

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+
```
76142

77143
## Status
78144

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

docs/assets/demo.gif

69 KB
Loading

docs/assets/demo.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env python3
2+
"""Pretty terminal demo for the README hero GIF. Used by demo.tape (VHS)."""
3+
4+
from __future__ import annotations
5+
import sys
6+
import time
7+
8+
R = "\033[0m"
9+
DIM = "\033[90m"
10+
BOLD = "\033[1m"
11+
BLUE = "\033[34m"
12+
GREEN = "\033[32m"
13+
YELLOW = "\033[33m"
14+
CYAN = "\033[36m"
15+
ORANGE = "\033[38;5;215m"
16+
17+
18+
def out(s: str = "", *, end: str = "\n", pause: float = 0.0) -> None:
19+
sys.stdout.write(s + end)
20+
sys.stdout.flush()
21+
if pause:
22+
time.sleep(pause)
23+
24+
25+
def main() -> None:
26+
out(f"{DIM}$ claude mcp add web3-docs -- uvx --from git+https://github.com/dioptx/web3-docs web3-docs-mcp{R}", pause=0.6)
27+
out(f"{GREEN}{R} Added MCP server {BOLD}web3-docs{R} {DIM}(stdio){R}", pause=1.2)
28+
29+
out("", pause=0.3)
30+
out(f"{ORANGE}▸ You{R} What fork shipped PUSH0 and why?", pause=1.4)
31+
32+
out(f"{CYAN}▸ Claude{R} → resolve_proposal({BOLD}\"PUSH0\"{R})", pause=0.5)
33+
out(f" → query_protocol_docs({BOLD}\"eip-3855\"{R}, query={BOLD}\"rationale\"{R})", pause=1.6)
34+
35+
out("", pause=0.2)
36+
out(f"{BOLD}{CYAN}eip-3855{R} — PUSH0 instruction", pause=0.3)
37+
out(f"chain: {BLUE}ethereum{R} status: {GREEN}Final{R} fork: {YELLOW}Shanghai{R} (2023-04-12)", pause=0.3)
38+
out(f"{DIM}──────────────────────────────────────────────{R}", pause=0.3)
39+
out("PUSH1 0x00 currently accounts for ~11% of all", pause=0.4)
40+
out("deployed bytecode. A dedicated PUSH0 opcode shrinks", pause=0.4)
41+
out("contracts and saves 2 gas/byte + 3 gas per call.", pause=2.5)
42+
43+
out("", pause=0.2)
44+
out(f"{DIM}11 spec sources · 1,767 proposals · 19 contract registries{R}", pause=2.5)
45+
46+
47+
if __name__ == "__main__":
48+
main()

docs/assets/demo.tape

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# VHS tape — animated demo for the README hero.
2+
# Render with: vhs docs/assets/demo.tape
3+
# Output: docs/assets/demo.gif
4+
#
5+
# All visible content is produced by demo.py so the recording stays clean
6+
# (no shell prompts, no typed commands).
7+
8+
Output docs/assets/demo.gif
9+
10+
Set Theme "nord"
11+
Set FontSize 14
12+
Set Width 880
13+
Set Height 480
14+
Set Padding 24
15+
Set Framerate 24
16+
Set TypingSpeed 1ms
17+
Set Shell "bash"
18+
19+
Hide
20+
Type "clear && python3 docs/assets/demo.py"
21+
Enter
22+
Show
23+
Sleep 16s

0 commit comments

Comments
 (0)