Why I Built a Pure-Rust Model Context Protocol Engine for Interlayer & Liteverse (<3.8MB RAM, 457k ops/s)
Anthropic's Model Context Protocol (MCP) is rapidly becoming the open standard for connecting autonomous AI agents to external tools, databases, and host systems. However, if you have tried running several reference MCP servers concurrently, you have likely felt the resource bloat: each tool server spins up a heavy Node.js or Python runtime eating 100โฏMB to 200โฏMB of RAM each and adding 400โฏms+ cold-boot latency. As the creator of Interlayer Blockchain and Liteverse Network, this overhead was a critical blocker. Here is why we built InterMCP (v0.2.1) from scratch in pure Rust, and why we are open-sourcing it for the entire community.
The Origin: Why Interlayer & Liteverse Needed a Rust MCP Engine
Liteverse DePIN Edge & Watcher Nodes
Liteverse coordinates client-side compute across resource-constrained edge machines and watcher nodes. Requiring a 150โฏMB+ Node.js runtime just to execute basic tool calls completely choked low-spec host nodes.
Interlayer Blockchain Agent Latency
Autonomous agents executing on-chain transactions and interacting with multi-VM smart contracts require sub-millisecond tool dispatch. A 400โฏms+ cold-boot lag and 45โฏms per-dispatch overhead in JS/Python created unacceptable delays during block validation and agent coordination.
Host Security & Prompt Injection
Autonomous agents can be manipulated via prompt injection to attempt directory traversal. We needed kernel-level path canonicalization (SafeFS) to enforce strict filesystem jail bounds before any tool execution occurs.
What InterMCP Delivers
- Cold Boot Latency: 0.4โฏms (1,000ร faster than Node.js)
- Memory Footprint: < 3.8โฏMB RSS (40ร lighter than the 162โฏMB reference SDK)
- Dispatch Latency: 2.98โฏยตs in-process dispatch (457,042 ops/s throughput)
- SafeFS Sandboxing: Restricts file reading and searching to explicit allowlisted workspaces, rejecting symlink escapes and path traversal exploits
- Zero Runtime Dependencies: Compiles into a single, lightweight static binary
1-Click Multi-IDE Setup
To make setup completely frictionless, running:
npx intermcp setup
or with Cargo:
cargo install intermcp && intermcp setup
automatically detects your active IDEs (Google Antigravity, Cursor, VS Code, Kilo Code, and Claude Desktop), creates atomic configuration backups, and merges the gateway instantly.
Open Source for the Community
While originally engineered to solve bottlenecks on Interlayer Blockchain and Liteverse Network, every developer building AI agents faces this exact same resource problem. InterMCP is dual-licensed under MIT / Apache 2.0:
- Crates.io: https://crates.io/crates/intermcp
- npm: https://www.npmjs.com/package/intermcp
- PyPI: https://pypi.org/project/intermcp
- GitHub: https://github.com/Bharathcoorg/intermcp
Benchmarks are reproducible locally via intermcp bench --iterations 5000. Feedback, stars, and PRs are warmly welcome!
Comments
No comments yet. Start the discussion.