cellc-mcp
# cellc-mcp
MCP server wrapping the `cellc` CellScript compiler so a local agentic model can
write CKB Cell contracts in a write → check → explain → inspect loop.
## Install
python -m venv .venv && . .venv/bin/activate
pip install -e .
## Requirements
- A built `cellc` binary. Build it once:
cd ~/CellScript && cargo install --path .
(Needs a sibling `ckb-sdk-rust` checkout at tag v5.1.0 per CellScript AGENTS.md.)
## Configuration (env)
- `CELLC_BIN` — path to the cellc binary (else found on PATH)
- `CELLSCRIPT_REPO` — CellScript checkout for examples/reference (default ~/CellScript)
- `CELLC_TIMEOUT` — per-call timeout seconds (default 30)
## MCP client config
{
"mcpServers": {
"cellc": {
"command": "cellc-mcp",
"env": { "CELLSCRIPT_REPO": "/home/phill/CellScript" }
}
}
}
## Tools
- `cellc_check` — type-check; terse diagnostics (max 5; `full=true` for all)
- `cellc_explain` — explain an error code (E####)
- `cellc_metadata` — compiler metadata summary (`full=true` for schema-30 JSON)
- `cellc_constraints` — verifier obligations + runtime-error registry
- `cellc_language_reference` — the full language surface, in-context
- `cellc_list_examples` / `cellc_get_example` — example contracts for grounding
## Tests
python -m pytest -v # offline unit tests
python -m pytest -m needs_cellc -v # integration (needs cellc)
TDQS
Scored across 7 tools
Each tool has a clearly distinct purpose: type-checking (cellc_check), verifier obligations (cellc_constraints), error explanation (cellc_explain), examples (cellc_get_example, cellc_list_examples), language reference (cellc_language_reference), and metadata (cellc_metadata). No overlap in functionality.
All tools start with 'cellc_' prefix, but the naming pattern is inconsistent: some use verbs (cellc_check, cellc_explain, cellc_get_example, cellc_list_examples) while others are nouns (cellc_constraints, cellc_language_reference, cellc_metadata). This mixed convention reduces predictability.
With 7 tools covering essential aspects of CellScript contract development (checking, constraints, error help, examples, language reference, metadata), the count is well-scoped and appropriate for the domain.
The tool set covers key workflows: type-checking, error resolution, language reference, and example retrieval. Minor gaps exist (e.g., no tool to fetch a specific example by name or compile a contract), but the core development cycle is supported.