eth-mcp 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- eth_mcp-0.2.0.dist-info/METADATA +332 -0
- eth_mcp-0.2.0.dist-info/RECORD +21 -0
- eth_mcp-0.2.0.dist-info/WHEEL +4 -0
- eth_mcp-0.2.0.dist-info/entry_points.txt +3 -0
- ethereum_mcp/__init__.py +3 -0
- ethereum_mcp/cli.py +589 -0
- ethereum_mcp/clients.py +363 -0
- ethereum_mcp/config.py +324 -0
- ethereum_mcp/expert/__init__.py +1 -0
- ethereum_mcp/expert/guidance.py +300 -0
- ethereum_mcp/indexer/__init__.py +8 -0
- ethereum_mcp/indexer/chunker.py +563 -0
- ethereum_mcp/indexer/client_compiler.py +725 -0
- ethereum_mcp/indexer/compiler.py +245 -0
- ethereum_mcp/indexer/downloader.py +521 -0
- ethereum_mcp/indexer/embedder.py +627 -0
- ethereum_mcp/indexer/manifest.py +411 -0
- ethereum_mcp/logging.py +85 -0
- ethereum_mcp/models.py +126 -0
- ethereum_mcp/server.py +555 -0
- ethereum_mcp/tools/__init__.py +1 -0
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: eth-mcp
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: RAG-powered MCP server for Ethereum consensus specs and EIPs
|
|
5
|
+
Project-URL: Homepage, https://github.com/be-nvy/ethereum-mcp
|
|
6
|
+
Project-URL: Documentation, https://github.com/be-nvy/ethereum-mcp#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/be-nvy/ethereum-mcp.git
|
|
8
|
+
Project-URL: Issues, https://github.com/be-nvy/ethereum-mcp/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/be-nvy/ethereum-mcp/blob/main/CHANGELOG.md
|
|
10
|
+
Author: be.nvy
|
|
11
|
+
License-Expression: MIT
|
|
12
|
+
Keywords: consensus,eip,embeddings,ethereum,llm,mcp,model-context-protocol,rag,search
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Requires-Python: >=3.11
|
|
23
|
+
Requires-Dist: click>=8.0
|
|
24
|
+
Requires-Dist: fastmcp>=0.4.0
|
|
25
|
+
Requires-Dist: gitpython>=3.1.0
|
|
26
|
+
Requires-Dist: lancedb>=0.6.0
|
|
27
|
+
Requires-Dist: langchain-text-splitters>=0.0.1
|
|
28
|
+
Requires-Dist: langchain>=0.1.0
|
|
29
|
+
Requires-Dist: pyyaml>=6.0
|
|
30
|
+
Requires-Dist: sentence-transformers>=2.2.0
|
|
31
|
+
Provides-Extra: clients
|
|
32
|
+
Requires-Dist: tree-sitter-go>=0.20.0; extra == 'clients'
|
|
33
|
+
Requires-Dist: tree-sitter-rust>=0.20.0; extra == 'clients'
|
|
34
|
+
Requires-Dist: tree-sitter>=0.20.0; extra == 'clients'
|
|
35
|
+
Provides-Extra: dev
|
|
36
|
+
Requires-Dist: build>=1.0.0; extra == 'dev'
|
|
37
|
+
Requires-Dist: mypy>=1.0.0; extra == 'dev'
|
|
38
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
|
|
39
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
|
|
40
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
41
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
42
|
+
Requires-Dist: twine>=4.0.0; extra == 'dev'
|
|
43
|
+
Provides-Extra: voyage
|
|
44
|
+
Requires-Dist: voyageai>=0.2.0; extra == 'voyage'
|
|
45
|
+
Description-Content-Type: text/markdown
|
|
46
|
+
|
|
47
|
+
# ethereum-mcp
|
|
48
|
+
|
|
49
|
+
RAG-powered MCP server for Ethereum consensus specs, EIPs, and client source code.
|
|
50
|
+
|
|
51
|
+
[](https://badge.fury.io/py/ethereum-mcp)
|
|
52
|
+
[](https://github.com/be-nvy/ethereum-mcp/actions/workflows/ci.yml)
|
|
53
|
+
|
|
54
|
+
## What It Does
|
|
55
|
+
|
|
56
|
+
Indexes and searches across:
|
|
57
|
+
- **Consensus Specs** - Official beacon chain specifications
|
|
58
|
+
- **EIPs** - Ethereum Improvement Proposals
|
|
59
|
+
- **Builder Specs** - MEV-boost and PBS specifications
|
|
60
|
+
- **Client Source Code** - All major EL and CL implementations
|
|
61
|
+
|
|
62
|
+
## Installation
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# From PyPI
|
|
66
|
+
pip install ethereum-mcp
|
|
67
|
+
|
|
68
|
+
# From source
|
|
69
|
+
pip install -e .
|
|
70
|
+
|
|
71
|
+
# With client code parsing support
|
|
72
|
+
pip install -e ".[clients]"
|
|
73
|
+
|
|
74
|
+
# With Voyage API embeddings (best quality)
|
|
75
|
+
pip install -e ".[voyage]"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Quick Start
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Build the index (downloads specs + creates embeddings)
|
|
82
|
+
ethereum-mcp build
|
|
83
|
+
|
|
84
|
+
# Search the specs
|
|
85
|
+
ethereum-mcp search "slashing penalty"
|
|
86
|
+
|
|
87
|
+
# Check status
|
|
88
|
+
ethereum-mcp status
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Features
|
|
92
|
+
|
|
93
|
+
### Incremental Indexing
|
|
94
|
+
|
|
95
|
+
The v0.2.0 release introduces **incremental indexing** - only re-embeds changed files instead of rebuilding the entire index. This reduces update time from minutes to seconds.
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Update repos and incrementally re-index (fast!)
|
|
99
|
+
ethereum-mcp update
|
|
100
|
+
|
|
101
|
+
# Incremental index (default behavior)
|
|
102
|
+
ethereum-mcp index
|
|
103
|
+
|
|
104
|
+
# Preview what would change without indexing
|
|
105
|
+
ethereum-mcp index --dry-run
|
|
106
|
+
|
|
107
|
+
# Force full rebuild
|
|
108
|
+
ethereum-mcp index --full
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**How it works:**
|
|
112
|
+
1. Tracks file hashes and modification times in a manifest
|
|
113
|
+
2. Detects which files changed since last index
|
|
114
|
+
3. Only re-embeds the changed content
|
|
115
|
+
4. Updates LanceDB incrementally (add/delete operations)
|
|
116
|
+
|
|
117
|
+
### Configurable Embedding Models
|
|
118
|
+
|
|
119
|
+
Choose from multiple embedding models based on your quality/speed tradeoff:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# List available models
|
|
123
|
+
ethereum-mcp models
|
|
124
|
+
|
|
125
|
+
# Use a specific model
|
|
126
|
+
ethereum-mcp index --model codesage/codesage-large
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
| Model | Dims | Quality | Speed | Notes |
|
|
130
|
+
|-------|------|---------|-------|-------|
|
|
131
|
+
| `all-MiniLM-L6-v2` | 384 | Fair | Fast | Default, good for quick searches |
|
|
132
|
+
| `all-mpnet-base-v2` | 768 | Good | Medium | Better quality |
|
|
133
|
+
| `codesage/codesage-large` | 1024 | Good | Medium | Code-specialized |
|
|
134
|
+
| `voyage:voyage-code-3` | 1024 | Excellent | API | Best quality, requires API key |
|
|
135
|
+
|
|
136
|
+
Configure in `~/.ethereum-mcp/config.yaml`:
|
|
137
|
+
|
|
138
|
+
```yaml
|
|
139
|
+
embedding:
|
|
140
|
+
model: "codesage/codesage-large"
|
|
141
|
+
batch_size: 32
|
|
142
|
+
|
|
143
|
+
chunking:
|
|
144
|
+
chunk_size: 1000
|
|
145
|
+
chunk_overlap: 200
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Expert Guidance
|
|
149
|
+
|
|
150
|
+
Curated knowledge beyond what's in the specs:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# Via CLI (when running as MCP server)
|
|
154
|
+
eth_expert_guidance("slashing")
|
|
155
|
+
eth_expert_guidance("mev")
|
|
156
|
+
eth_expert_guidance("maxeb")
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Topics include: `churn`, `slashing`, `maxeb`, `withdrawals`, `mev`, `pbs`, `epbs`, `mev_boost`, `flashbots`
|
|
160
|
+
|
|
161
|
+
## CLI Commands
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# Full build pipeline
|
|
165
|
+
ethereum-mcp build # Specs + EIPs only
|
|
166
|
+
ethereum-mcp build --include-clients # Include client source code
|
|
167
|
+
ethereum-mcp build --full # Force full rebuild
|
|
168
|
+
|
|
169
|
+
# Individual steps
|
|
170
|
+
ethereum-mcp download # Clone consensus-specs, EIPs, builder-specs
|
|
171
|
+
ethereum-mcp download --include-clients
|
|
172
|
+
ethereum-mcp compile # Extract specs to JSON
|
|
173
|
+
ethereum-mcp index # Build vector embeddings
|
|
174
|
+
ethereum-mcp index --dry-run # Preview changes
|
|
175
|
+
ethereum-mcp index --full # Force full rebuild
|
|
176
|
+
ethereum-mcp index --model MODEL # Use specific embedding model
|
|
177
|
+
|
|
178
|
+
# Update (git pull + incremental index)
|
|
179
|
+
ethereum-mcp update
|
|
180
|
+
ethereum-mcp update --full # Update + force rebuild
|
|
181
|
+
|
|
182
|
+
# Search
|
|
183
|
+
ethereum-mcp search "slashing penalty"
|
|
184
|
+
ethereum-mcp search "attestation" --fork electra
|
|
185
|
+
ethereum-mcp search "EIP-4844" --limit 10
|
|
186
|
+
|
|
187
|
+
# Info
|
|
188
|
+
ethereum-mcp status # Index status, manifest info
|
|
189
|
+
ethereum-mcp models # List embedding models
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## MCP Tools
|
|
193
|
+
|
|
194
|
+
When running as an MCP server:
|
|
195
|
+
|
|
196
|
+
| Tool | Purpose |
|
|
197
|
+
|------|---------|
|
|
198
|
+
| `eth_search` | Unified search across specs + EIPs |
|
|
199
|
+
| `eth_search_specs` | Specs-only search (no EIPs) |
|
|
200
|
+
| `eth_search_eip` | EIP-specific search |
|
|
201
|
+
| `eth_grep_constant` | Fast constant lookup |
|
|
202
|
+
| `eth_analyze_function` | Get Python implementation from specs |
|
|
203
|
+
| `eth_get_current_fork` | Current fork (Electra/Pectra) |
|
|
204
|
+
| `eth_list_forks` | All upgrades with dates/epochs |
|
|
205
|
+
| `eth_get_spec_version` | Index metadata |
|
|
206
|
+
| `eth_expert_guidance` | Curated expert interpretations |
|
|
207
|
+
| `eth_list_clients` | List all EL/CL clients |
|
|
208
|
+
| `eth_get_client` | Details on specific client |
|
|
209
|
+
| `eth_get_client_diversity` | Diversity stats and health |
|
|
210
|
+
| `eth_get_recommended_client_pairs` | EL+CL pairing recommendations |
|
|
211
|
+
|
|
212
|
+
## Client Source Code
|
|
213
|
+
|
|
214
|
+
### Execution Layer Clients
|
|
215
|
+
|
|
216
|
+
| Client | Language | Organization |
|
|
217
|
+
|--------|----------|--------------|
|
|
218
|
+
| Geth | Go | Ethereum Foundation |
|
|
219
|
+
| Reth | Rust | Paradigm |
|
|
220
|
+
| Nethermind | C# | Nethermind |
|
|
221
|
+
| Besu | Java | Hyperledger/ConsenSys |
|
|
222
|
+
| Erigon | Go | Erigon |
|
|
223
|
+
|
|
224
|
+
### Consensus Layer Clients
|
|
225
|
+
|
|
226
|
+
| Client | Language | Organization |
|
|
227
|
+
|--------|----------|--------------|
|
|
228
|
+
| Prysm | Go | Offchain Labs |
|
|
229
|
+
| Lighthouse | Rust | Sigma Prime |
|
|
230
|
+
| Teku | Java | ConsenSys |
|
|
231
|
+
| Nimbus | Nim | Status |
|
|
232
|
+
| Lodestar | TypeScript | ChainSafe |
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
# Download specific clients
|
|
236
|
+
ethereum-mcp download-clients --client reth --client lighthouse
|
|
237
|
+
|
|
238
|
+
# Download MEV infrastructure
|
|
239
|
+
ethereum-mcp download-clients --client mev-boost --client flashbots-builder
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Project Structure
|
|
243
|
+
|
|
244
|
+
```
|
|
245
|
+
src/ethereum_mcp/
|
|
246
|
+
├── server.py # MCP server (FastMCP)
|
|
247
|
+
├── cli.py # CLI commands
|
|
248
|
+
├── config.py # Configuration management
|
|
249
|
+
├── clients.py # Client tracking and diversity
|
|
250
|
+
├── indexer/
|
|
251
|
+
│ ├── downloader.py # Git clone specs + clients
|
|
252
|
+
│ ├── compiler.py # Spec extraction
|
|
253
|
+
│ ├── client_compiler.py # Multi-language client parsing
|
|
254
|
+
│ ├── chunker.py # Document chunking + chunk IDs
|
|
255
|
+
│ ├── embedder.py # Embeddings + LanceDB + incremental
|
|
256
|
+
│ └── manifest.py # File tracking for incremental updates
|
|
257
|
+
└── expert/
|
|
258
|
+
└── guidance.py # Curated interpretations
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
## Data Location
|
|
262
|
+
|
|
263
|
+
```
|
|
264
|
+
~/.ethereum-mcp/
|
|
265
|
+
├── config.yaml # Configuration (optional)
|
|
266
|
+
├── manifest.json # Index state tracking
|
|
267
|
+
├── consensus-specs/ # Cloned specs repo
|
|
268
|
+
├── EIPs/ # Cloned EIPs repo
|
|
269
|
+
├── builder-specs/ # Cloned builder-specs repo
|
|
270
|
+
├── clients/ # Client source code (optional)
|
|
271
|
+
├── compiled/ # Extracted JSON
|
|
272
|
+
└── lancedb/ # Vector index
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
## Fork History
|
|
276
|
+
|
|
277
|
+
| Fork | Epoch | Date | Description |
|
|
278
|
+
|------|-------|------|-------------|
|
|
279
|
+
| Phase0 | 0 | 2020-12-01 | Beacon chain genesis |
|
|
280
|
+
| Altair | 74240 | 2021-10-27 | Light clients, sync committees |
|
|
281
|
+
| Bellatrix | 144896 | 2022-09-06 | Merge preparation |
|
|
282
|
+
| Capella | 194048 | 2023-04-12 | Withdrawals enabled |
|
|
283
|
+
| Deneb | 269568 | 2024-03-13 | Proto-danksharding (EIP-4844) |
|
|
284
|
+
| Electra | 364032 | 2025-05-07 | MaxEB, consolidations |
|
|
285
|
+
| Fulu | 411392 | 2025-11-15 | PeerDAS, verkle prep |
|
|
286
|
+
|
|
287
|
+
## Development
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
# Install with dev dependencies
|
|
291
|
+
pip install -e ".[dev]"
|
|
292
|
+
|
|
293
|
+
# Run tests
|
|
294
|
+
pytest
|
|
295
|
+
|
|
296
|
+
# Run tests with coverage
|
|
297
|
+
pytest --cov=ethereum_mcp
|
|
298
|
+
|
|
299
|
+
# Lint
|
|
300
|
+
ruff check src/
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
## Running as MCP Server
|
|
304
|
+
|
|
305
|
+
```bash
|
|
306
|
+
# Start the server
|
|
307
|
+
eth-mcp
|
|
308
|
+
|
|
309
|
+
# Or with uvicorn for development
|
|
310
|
+
uvicorn ethereum_mcp.server:mcp --reload
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
Add to your Claude Code MCP configuration:
|
|
314
|
+
|
|
315
|
+
```json
|
|
316
|
+
{
|
|
317
|
+
"mcpServers": {
|
|
318
|
+
"ethereum": {
|
|
319
|
+
"command": "eth-mcp"
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
## Documentation
|
|
326
|
+
|
|
327
|
+
- [Incremental Indexing](docs/INCREMENTAL_INDEXING.md) - How the incremental update system works
|
|
328
|
+
- [CLAUDE.md](CLAUDE.md) - Quick reference for Claude Code
|
|
329
|
+
|
|
330
|
+
## License
|
|
331
|
+
|
|
332
|
+
MIT
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
ethereum_mcp/__init__.py,sha256=kdB3a2OWIoB1oTsSx0oHm_u6GDnxuAl-QdurBkEDuZQ,89
|
|
2
|
+
ethereum_mcp/cli.py,sha256=mXLlV5ywYrdKrellfGH0v35o7gdUrTga1NRqo6IV0c4,21654
|
|
3
|
+
ethereum_mcp/clients.py,sha256=WLp8-8o1jFsEA-MPEvaYCWvypZEsovecM6nyX3TB-_w,12083
|
|
4
|
+
ethereum_mcp/config.py,sha256=CCTSmzAr__3Q59VBtbbgNCOyOiVMzNWqjsjjGUlu-d0,9783
|
|
5
|
+
ethereum_mcp/logging.py,sha256=Wt5nYveOgIBakGnlgvGZ_o_BGBJgbyGpYTki9wEC2Ec,2043
|
|
6
|
+
ethereum_mcp/models.py,sha256=V5NMk5kdqcKgLHcZGE9G5nOYz6tZUvq4HXpTa145I10,3893
|
|
7
|
+
ethereum_mcp/server.py,sha256=7-T6YrQFb7CLTxQ3cfq-8pFvkbojokdO44GFK-UF8Yw,15661
|
|
8
|
+
ethereum_mcp/expert/__init__.py,sha256=19vU-7Arc1qM5EDIZkLg87VnyI4T-aQS9XswtRI_86g,58
|
|
9
|
+
ethereum_mcp/expert/guidance.py,sha256=YeBRRu8Mz7vMc7NHcSLeCwy92X2GlHioRY9_p06KpB8,14681
|
|
10
|
+
ethereum_mcp/indexer/__init__.py,sha256=wlQ4Kk0fe5jn6TyQm9KPs7BDs1oeBYef3-g0a7Xb_Pk,280
|
|
11
|
+
ethereum_mcp/indexer/chunker.py,sha256=2qtMAT-C98TnUjdfjVI5w5xcUJJbV9lxiIBYm7jbdOc,18134
|
|
12
|
+
ethereum_mcp/indexer/client_compiler.py,sha256=Jyl5AgKAce4WTdXq2sXkRhyMmnKbOOqtLKJT5uHoi3E,23062
|
|
13
|
+
ethereum_mcp/indexer/compiler.py,sha256=a7TIjs4r1ZUG-QA8c4CRasOW0QviJNH_x_DdplrApH4,7990
|
|
14
|
+
ethereum_mcp/indexer/downloader.py,sha256=6bIB-koNxJV53vyMlRBoaINsgLfPLc0BgVb7WkwKIdM,15986
|
|
15
|
+
ethereum_mcp/indexer/embedder.py,sha256=v9op5hBxL9tg2V58VuArytFCcTLQt97IQoH_krKc3Us,20723
|
|
16
|
+
ethereum_mcp/indexer/manifest.py,sha256=jqZRa9oqmWnnczry16BjlK5mwB8gssCuulkMbVjlG0g,12666
|
|
17
|
+
ethereum_mcp/tools/__init__.py,sha256=A8hnajphJkWgABS7OY5lxD3XgQ5tDLZqTizi_kTJba8,43
|
|
18
|
+
eth_mcp-0.2.0.dist-info/METADATA,sha256=zL669WPV1832rJZzS1lSUwPotQdowvuZy4MZkdA5hAU,9986
|
|
19
|
+
eth_mcp-0.2.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
20
|
+
eth_mcp-0.2.0.dist-info/entry_points.txt,sha256=5boNJJtsh5bkbJ-kzfYQNNDvWL44yTGk9h-sDZbE_qI,89
|
|
21
|
+
eth_mcp-0.2.0.dist-info/RECORD,,
|
ethereum_mcp/__init__.py
ADDED