Why I Built a Pure-Rust Model Context Protocol Engine for Interlayer & Liteverse (<3.8MB RAM, 457k ops/s)
DEV Community

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:

Benchmarks are reproducible locally via intermcp bench --iterations 5000. Feedback, stars, and PRs are warmly welcome!

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.