Surgical AST-based Python editing for AI agents — edit by symbol name, not text position. Built-in blast radius and token cost on every edit.
Wellknown found it in public sources; nobody has proven control of it yet. Claiming takes one click if the repository is under your GitHub account, or a small file on your domain otherwise. Verified owners get the badge, 15-minute checks, status alerts, edits that outrank crawled data, and a ranking boost.
Agents can do it too: POST https://wellknown.network/api/v1/claims with {"agent":"tokenspace-mcp","method":"well_known_file"} — machine-readable steps at claim.json, guide at /docs/claim.
Everything here was measured by our prober or read from a registry. Nothing is self-reported.
Attributed to the source that supplied each field. Treated as claims, not facts.
# tokenspace-mcp Surgical AST-based Python editing for AI agents — edit by symbol name, not text position. Built-in blast radius and token cost on every edit. ```bash pip install tokenspace-mcp ``` ## Why AI coding agents (Claude Code, Cursor, Aider) edit Python via string replacement or line numbers. This forces the agent to echo the old code to locate the edit, then echo the entire new file as output. On large files that wastes thousands of tokens per edit. Tokenspace exposes four MCP tools that operate on symbol names: ``` edit_function_body("auth.py", "validate_token", new_body) ``` No echoing. No stale line numbers. Every edit returns a diff, a blast radius score, and a token cost — automatically. ## Benchmark Measured on **406 real functions** across 10 popular OSS projects (requests, flask, fastapi, django, httpx, pydantic, black, click, rich). All files verified with libcst round-trip. | Scenario | str\_replace | Tokenspace | Reduction | |---|---|---|---| | Single edit — 406 functions total | 36,907 tokens | 18,674 tokens | **49.4%** | | 5 edits / same file — 10 files total | 70,948 tokens | 2,039 tokens | **95.4%** | The multi-edit gap is large because `str_replace` pays the full file on every call. Tokenspace pays for `read_structure` once and only the function name + new body per subsequent edit. ## MCP Tools | Tool | What it does | |---|---| | `read_structure` | File skeleton — signatures and line ranges, no bodies. ~3.4× cheaper than reading the file. | | `edit_function_body` | Replace a top-level function body by name. Writes to disk. Returns diff + metrics. | | `edit_class_method` | Replace a class method body by name. Writes to disk. Returns diff + metrics. | | `measure_edit` | Dry-run: compute blast radius and token cost without writing. | ### Metrics returned on every edit - **blast_radius** — fraction of the file's symbols whose signature changed (0.0 = nothing changed structurally) - **patch_locality** — how contained the edit is …
Mapped onto the structured taxonomy from declared text and observed tool names. Confidence shown for derived entries.
Every source is kept verbatim. Field changes are logged as events.