MCP SERVER · RUST TOOLCHAIN

nxm-mcp-exec

An MCP server for typed Rust toolchain diagnostics — fewer tokens, better code.

Built to run entirely locally. Open source under the MIT license.

Why I built it

I built nxm-mcp-exec to give a coding agent a better grip on a Rust codebase: higher code quality, and far fewer tokens burned per check.

A normal agent runs cargo in a shell and reads back hundreds of lines of human-formatted log text — then spends tokens (and makes parsing mistakes) turning that text into something it can act on. nxm-mcp-exec removes that cost. It runs the command for the agent and returns a small, typed result — { ok, diagnostics, summary } — instead of a wall of logs. The agent reads a compact, structured answer, spends a fraction of the tokens, and never writes a log-parsing bug again.

The result: cleaner Rust code, a tighter feedback loop, and a much smaller token footprint inside the agent’s context window.

What it is

nxm-mcp-exec is a small, security-first MCP server. It runs allow-listed Rust toolchain commands inside a target repository and returns structured, typed diagnostics over stdio JSON-RPC. It is not a CI — it is a diagnostics surface built for coding agents. Every call is authenticated and every repo path is confined before a single cargo command is spawned.

Typed, not log text

Every tool returns { ok, …, summary } — structured JSON an agent can act on directly. No screen-scraping, no log-parsing bugs, a fraction of the tokens.

Security-first by construction

Two gates run before any command: authentication (nxm_user / nxm_token) and repository-path confinement. Only an enumerated allow-list of cargo subcommands can ever run — no arbitrary shell.

One GO / NO-GO verdict

run_gate composes the individual checks into a single, short-circuiting verdict. The strict gate adds security and dependency-hygiene checks on top of the default correctness sweep.

How it works

Architecture: three layers and two security gates before a cargo command runs

Architecture — three layers, two security gates before any cargo command runs

Nine typed tools grouped by purpose over one strict allow-list

Tool catalogue — nine typed tools over one strict allow-list

Strict gate: six ordered checks, short-circuit at the first failure

The strict gate — six ordered checks, short-circuit at the first failure

The nine tools

cargo_check

Typed compiler diagnostics

cargo_build

Full build (release, features)

cargo_test

Test results (nextest or libtest)

cargo_clippy

Lint diagnostics, optional deny_warnings

cargo_fmt_check

Formatting status (read-only)

cargo_audit

Security advisories — fail-closed

cargo_machete

Unused dependencies

cargo_outdated

Out-of-date deps — informative only

run_gate

A single GO / NO-GO verdict composing the checks

cargo_outdated is the only informative tool — it reports, it never fails the gate.

Created by Daniele Oddo — AI Engineering Architect

Project: nxm-mcp-exec · github.com/dangranaz/nxm-mcp-exec

View on GitHub →

Tech details

Language

Rust (edition 2021)

Transport

JSON-RPC 2.0 over stdio

serde / serde_json

parses cargo --message-format=json

anyhow

error handling — no unwrap/expect in production

tracing

structured logs on stderr

nxm-mcp-authz

shared auth client — never re-implemented

Deploy

single static binary, no runtime

No unwrap/expect in production. Allow-listed cargo subcommands only — no arbitrary shell. Two gates before any command: authentication (nxm_user / nxm_token) and repository-path confinement.

Create a free website with Framer, the website builder loved by startups, designers and agencies.