tokenectomy-razor
v1.3.3
Published
Cut 95% of useless framework noise and token bloat from error logs before feeding them to AI coding agents
Maintainers
Readme
tokenectomy-razor 🗡️
Autonomous, machine-to-machine (M2M) Model Context Protocol (MCP) server & log surgery engine for AI coding agents (Claude Desktop, Cursor, Cline, Roo Code, Windsurf, and Google Antigravity).
- Official MCP Registry Name:
io.github.Tokenectomy-Labs/razor - Glama TDQS Rating: Grade A (100% Schema & Documentation Quality Score)
🚀 Instant Usage with npx
No Rust compiler, no manual build, and zero dependencies required! The package automatically provisions the verified native precompiled Rust binary for your operating system and architecture:
npx -y tokenectomy-razor --mcpSupported Native Architectures
- Linux:
x86_64(glibc & musl),aarch64(ARM64) - macOS: Apple Silicon (
arm64), Intel (x86_64) - Windows:
x86_64(MSVC)
🛠️ Exposed MCP Tools
Tokenectomy Razor equips agents with 5 high-performance tools adhering strictly to MCP JSON-RPC 2.0 specifications:
| Tool Name | Capability Description |
|---|---|
| get_error_context | Performs deep polyglot trace surgery on error dumps, removes 90%+ framework noise (node_modules, site-packages, .cargo/registry, Spring Boot, Tomcat, Hibernate, ASan, Go idle goroutines), redacts credentials, and extracts local source context bounded to the workspace. |
| analyze_code | Performs static AST code analysis to detect resource leaks, unclosed handles, and security vulnerabilities with bounded execution limits and precise LSP UTF-16 coordinates. |
| apply_code_patch | Applies atomic file modifications with post-write language syntax verification (cargo check, node --check, py_compile) and automated zero-dirty-diff rollback on validation failure. |
| search_stack_overflow | Queries Stack Exchange API for relevant error signatures using sanitized search terms. |
| audit_context_health | Proactively audits error logs, prompt payloads, or code snippets for token bloat, framework noise, and credential leaks. Returns actionable M2M telemetry and cost savings metrics. |
🔌 MCP Client Configuration
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"tokenectomy": {
"command": "npx",
"args": ["-y", "tokenectomy-razor", "--mcp"]
}
}
}Cursor (.cursor/mcp.json)
Add to .cursor/mcp.json in your workspace root:
{
"mcpServers": {
"tokenectomy": {
"command": "npx",
"args": ["-y", "tokenectomy-razor", "--mcp"]
}
}
}Google Antigravity CLI
Install directly into your Antigravity agent configuration:
agy mcp add tokenectomy -- npx -y tokenectomy-razor --mcpCline / Roo Code / Windsurf / VS Code
Add to your MCP settings (cline_mcp_settings.json or settings.json):
{
"mcpServers": {
"tokenectomy": {
"command": "npx",
"args": ["-y", "tokenectomy-razor", "--mcp"]
}
}
}⚡ Verifiable Performance Benchmarks
| Metric | Measured Value | Standard / Guarantee | |---|---|---| | Redaction Throughput | 73.3 MB/sec (749,652 lines/sec) | 250,000-line enterprise dump processed in 333 ms | | ReDoS Immunity | 1.44 ms | Linear $O(N)$ evaluation on 50K pathological backtracking patterns | | Concurrent Throughput | 7,312 ops/sec | 100 concurrent OS threads across simultaneous sanitization calls | | Memory Footprint | 76.24 MB VmRSS | Peak resident memory under continuous high-load stress |
📦 Global Install (Optional)
You can also install the binary globally for standalone terminal CLI piping:
npm install -g tokenectomy-razor
# Run standalone CLI
razor --help
tokenectomy-razor --help
# Scrub framework frames and redact credentials via pipe
npm test 2>&1 | razor --scrub > sanitized.log🗺️ Roadmap & Ecosystem Milestones
- ✅ v1.0.0 - v1.1.0: Core polyglot log surgery, O(N) ReDoS-immune redaction, AI reverse proxy gateway (
--proxy). - ✅ v1.1.3: Multi-architecture Docker images (GHCR) & GitHub Actions Marketplace Action.
- ✅ v1.1.5: Static AST code analysis engine (
analyze_code) & Glama.ai TDQS Grade A compliance. - ✅ v1.1.6: Precompiled standalone native binaries (Linux, macOS Apple Silicon/Intel, Windows).
- ✅ v1.1.7: Canonical Anthropic MCP Registry validation (
io.github.Tokenectomy-Labs/razor) &mcpservers.orgdirectory listing. - ✅ v1.2.0 - v1.2.3: Java/Kotlin (Spring Boot 3), C/C++ backtrace, C# (.NET) & Ruby on Rails, custom rules (
~/.tokenectomy.toml), interactive budgeting strategies. - ✅ v1.3.0: Declarative Advisory M2M Control Plane (
[:TOKENECTOMY:M2M_CONTROL_PLANE:v1.3.0]), Anti-Prompt-Injection Architecture, Downstream Liability Disclaimer. - ✅ v1.3.1: Inline Dropped Frame Identities (
[DROPPED_FRAMES: ...]) to prevent silent truncation & content-addressable raw log verification hash. - 📋 v1.4.0 (Planned): Native IDE companion extensions (VS Code, JetBrains) & Server-Sent Events (SSE) remote MCP transport.
🔗 Official Links & Resources
- GitHub Repository: https://github.com/Tokenectomy-Labs/Tokenectomy
- Official MCP Registry: registry.modelcontextprotocol.io (
io.github.Tokenectomy-Labs/razor) - mcpservers.org Listing: https://mcpservers.org/servers/tokenectomy-labs/tokenectomy
- Glama.ai Listing: https://glama.ai/mcp/servers/Tokenectomy-Labs/Tokenectomy
- Crates.io Crate: https://crates.io/crates/tokenectomy
