mcp-vol — Deterministic MCP Tool Volatility & Selection Auditor
Zero-LLM, sub-millisecond MCP tool linter (24 rules VOL001–VOL024), zero-build static Rust/TypeScript/Python source scanner with SARIF file:line:column annotations, multi-server stack composer, mechanical RFC 6902 auto-fixer, prompt-cache drift detector, and pre-indexed 39.6 µs/query BM25 / hybrid tool-selection eval harness — engineered from the ground up for AI coding agents and Rust (rmcp) CI gates.
$ mcp-vol check examples/sample_tools.json --format text
mcp-vol audit: FAIL | score 3.74/5.00 (Tier B) | worst tool 3.45 | 3 tools | ~181 tokens (~$0.11/200-turn uncached, ~$0.01 cached)
findings: 3 error, 7 warn, 0 info | collisions: 0 | shadowing risks: 0
[ERROR] VOL006 (annotation-contradiction) delete_index
Tool 'delete_index' implies mutation ('delete'), but annotations.readOnlyHint is true.
fix: Set annotations.read_only_hint = Some(false) on 'delete_index' (and destructive_hint appropriately)...
[ERROR] VOL009 (undocumented-schema-parameter) find_docs
Tool 'find_docs' has 1 parameter(s) missing JSON Schema `description`: query.
fix: Add a non-empty `description` in inputSchema for: query.
[WARN] VOL005 (missing-sibling-disambiguation) find_docs <-> search
Overlapping siblings 'find_docs' and 'search' (similarity=0.61) do not cross-reference each other.
$ mcp-vol compose --server github=benchmarks/catalogs/github.json --server gitlab=benchmarks/catalogs/gitlab.json --format text
mcp-vol compose: 2 servers | 35 tools | score 3.13/5.00 (Tier C) | ~4146 tokens (~$2.49/200t uncached, ~$0.26 cached)
cross-server collisions: 8 exact duplicate(s), 3 semantic overlap(s) | if namespaced: score 3.46/5.00 (0 exact duplicates)
Why mcp-vol?
When MCP catalogs grow — or when agents mount 4–6 MCP servers simultaneously — models pick the wrong tool, pass invalid arguments, and burn thousands of prompt tokens:
- 97.1% of public MCP tool descriptions contain at least one quality smell and 56% fail to state their purpose clearly (arXiv 2602.14878).
- ~70% of public MCP tools omit per-parameter descriptions (arXiv 2602.18914).
- Existing quality scorers (e.g., Glama TDQS) rely on an LLM judge—great for registries, but slow, costly, and non-deterministic in CI.
mcp-voldelivers Clippy / Ruff-speed deterministic checks across 24 research-backed rules (VOL001–VOL024) aligned with the 6-dimension rubric (Purpose Clarity, Usage Guidelines, Behavioral Transparency, Parameter Semantics, Conciseness, Contextual Completeness), zero-build static Rust (rmcp) / TypeScript / Python source scanning, multi-server composition & deferral planning, structural JSON Schema integrity + recursive$refwalking, mechanical RFC 6902 auto-repair (fix/patch), prompt-cache drift diffs, and a pre-indexed 39.6 µs/queryBm25Index+ explainability + NDCG@k eval harness — all with $0 LLM spend and 3 core dependencies (serde,serde_json,thiserror).
Closed-Loop AI Agent Workflow (Built for Agents, Not Hand-Coding)
flowchart LR
A["Source (Rust/TS/Py) or Live MCP (stdio/HTTP)"] --> B["mcp-vol scan / check --compact"]
A --> C["mcp-vol compose (Multi-Server Stack)"]
B -->|Mechanical defects| D["mcp-vol fix / patch (RFC 6902)"]
B -->|Prose & schema defects| E["mcp-vol plan (worst-tool-first)"]
D --> F["mcp-vol gen-eval (--adversarial) & compare-rankers"]
E --> F
F --> G["mcp-vol explain & diff (Prompt-Cache Gate) & SARIF 2.1.0"]
Every API, error, and output is engineered for AI coding agents writing and executing code without guesswork:
- Zero-boilerplate Rust API (
#![deny(missing_docs)]): One-lineuse mcp_vol::prelude::*;, 1-line facades (audit_json,assert_catalog_clean,audit_rmcp,assert_rmcp_tools_clean,scan_path,compose_catalogs,explain_query,compare_rankers), and#[diagnostic::on_unimplemented]compiler hints onRanker - Zero-build multi-language static scanning (
mcp-vol scan ./src): Extracts MCP tools directly from Rust (rmcp#[tool]), TypeScript/JS (@modelcontextprotocol/sdk+ Zod), and Python (FastMCP/Field) with exactfile:line:columnSARIF 2.1.0physicalLocationannotations for GitHub PR inline diffs - Multi-server stack composition (
mcp-vol compose): Parsesclaude_desktop_config.json/.mcp.json/.cursor/mcp.json, attributes per-server token/USD share, detects cross-server duplicate & semantic collisions, simulates<server>_namespacing, and recommends on-demand deferral - Pre-indexed
Bm25Index+ IR diagnostics: 39.6 µs/query over 1,000 tools (495.6× faster than stateless BM25), per-term/per-fieldmcp-vol explain, graded NDCG@k & per-tool accuracy, adversarial sibling eval synthesis (gen-eval --adversarial), and side-by-sidecompare-rankers - Deterministic RFC 6902 Auto-Fix (
mcp-vol fix/mcp-vol patch/apply_patches): Mechanically repairsVOL006,VOL007,VOL016,VOL017,VOL018,VOL020, andVOL021with verified before/after score lift and guaranteed idempotency - Canonical JSON (default) with
--compactsingle-line output,--max-findings <N>caps, structured JSON stderr error envelopes, 10 Draft 2020-12 JSON Schemas (mcp-vol schema ...), local Streamable HTTP (--http) + hardened--stdioinspection, 7-tool self-auditedmcp-vol mcpserver (5.00/5.00 Tier A), and distrolessDockerfile - Agent discovery ready out of the box: ships with
llms.txt,llms-full.txt,context7.json,server.json,skills/mcp-vol-audit/SKILL.md,AGENTS.md, and fast prebuilt-binary GitHub Actionaction.yml
Real-World Benchmark (16 Official MCP Reference Servers, 115 Tools)
Auditing all 16 official Model Context Protocol reference servers (benchmarks/catalogs/, 115 published tools, ~15,130 serialized tokens) against all 24 rules (VOL001–VOL024) takes 36.6 ms merged (81.6 ms across 16 cold process spawns) with $0 LLM spend and 0 false positives across VOL019–VOL023:
| Official Server | Tools | Score | Tier | Worst Tool | Est. Tokens | Est. $/200t | Errors | Warnings | Info | Key Verified Findings |
|---|---|---|---|---|---|---|---|---|---|---|
mcp-vol mcp (self-audit) |
7 | 5.00 | A | 5.00 | 2,772 | $1.66 | 0 | 0 | 0 | Continuous CI gate (--fail-on info) |
time (2026 ref) |
3 | 4.92 | A | 4.85 | 347 | $0.21 | 0 | 1 | 0 | VOL015 (1 shadowing pair) |
sequentialthinking (2026) |
1 | 4.85 | A | 4.85 | 530 | $0.32 | 0 | 1 | 0 | VOL012 (~253 tokens, right at 250-token cap) |
filesystem (2026 ref) |
16 | 4.58 | A | 4.33 | 3,391 | $2.03 | 0 | 18 | 0 | VOL004 (13), VOL015 (1), VOL018 (3 unbounded lists) |
memory (2026 ref) |
9 | 4.47 | B | 4.18 | 1,819 | $1.09 | 0 | 13 | 0 | VOL004 (6), VOL008 (4), VOL010 (3) |
slack |
8 | 4.21 | B | 3.95 | 780 | $0.47 | 0 | 21 | 0 | VOL005 (get_users ↔ get_user_profile, sim 0.63), VOL011 (timestamp) |
puppeteer |
7 | 4.12 | B | 3.88 | 614 | $0.37 | 0 | 20 | 4 | VOL007 (7), VOL008 (4), VOL011, VOL024 (4 opaque actions) |
postgres |
1 | 4.05 | B | 4.05 | 33 | $0.02 | 1 | 2 | 0 | VOL009 (sql lacks description), VOL007, VOL018 |
google-maps |
7 | 4.04 | B | 3.60 | 661 | $0.40 | 2 | 17 | 1 | VOL009 nested locations[].latitude/longitude, VOL018, VOL024 |
git (2026 ref) |
14 | 3.97 | B | 3.68 | 1,435 | $0.86 | 12 | 24 | 1 | VOL009 (12 tools omit param descriptions), VOL005, VOL024 |
gitlab |
9 | 3.87 | B | 3.68 | 1,017 | $0.61 | 7 | 23 | 2 | VOL009 (7), VOL007 (9), VOL008 (5), VOL024 (2) |
github |
26 | 3.60 | B | 2.83 | 3,129 | $1.88 | 15 | 87 | 0 | VOL002 (5 tautologies), VOL009 (10), VOL005 (12), VOL015 (13) |
Multi-server & scale highlights:
- DevOps Stack (
github+gitlab+slack+redis+sentry+postgres, 49 tools):mcp-vol composecatches 8 exact duplicate names (sim = 1.00) + 3 semantic overlaps, showsgithubconsumes 58.4% of total context, and proves<server>_namespacing lifts quality from 3.28 (Tier C) → 3.57 (Tier B) (8 → 0exact duplicates).- Coding Agent Stack (
filesystem+git+github+memory+fetch+sequentialthinking, 67 tools, ~10,597 tokens): catchesgithub::create_branch↔git::git_create_branch(sim = 0.62) and recommends deferringfilesystem(saves ~3,391 tokens / ~$2.03 per 200-turn session).- 1,000-Tool
Bm25IndexLatency: 39.6 µs/query (495.6× faster than stateless BM25; 100/100 Top-1 hits; reproducible viacargo run --release -p mcp-vol --example bm25_scale_bench). Across 44 real eval queries onfilesystem,slack,github, andgit,Bm25Indexscores 100.0% Top-1 / 100.0% Recall@3 / 1.0000 NDCG@3. Seebenchmarks/REPORT.mdfor full tables.
Quick Start
1. CLI (Works with ANY MCP Server: Rust, TypeScript, Python, Go)
# Instant prebuilt binary via cargo-binstall (or compile via `cargo install mcp-vol-cli`)
# Bootstrap `.mcp-vol.json` (and optional `tests/mcp_vol_gate.rs` with `--rmcp`)
# Zero-build static source scan across Rust (rmcp), TypeScript (SDK/Zod), and Python (FastMCP)
# Audit a JSON catalog, live stdio server, or local Streamable HTTP MCP server
# Audit a multi-server agent stack (from files, stdio/HTTP, or claude_desktop_config.json / .mcp.json)
# Auto-apply deterministic mechanical RFC 6902 fixes (VOL006/007/016/017/018/020/021)
# Bootstrap baseline or adversarial sibling eval suites, compare rankers (with NDCG@k), & explain queries
# Inspect all 10 Draft 2020-12 JSON Schemas (audit|eval|diff|plan|patch|apply|compose|scan|compare|config)
# Detect quality regressions & LLM prompt-cache-busting schema mutations between commits
# Self-audit mcp-vol's own 7-tool MCP server (scores 5.00/5.00 Tier A)
Place a .mcp-vol.json in your repository root (see examples/mcp-vol.json) to persist thresholds, disabled rules, and token pricing automatically.
2. Drop-In GitHub Action (action.yml — Zero Rust Required)
Downloads the prebuilt release binary in ~1 second (works natively in TypeScript, Python, Go, and Rust repos) with automatic cargo install fallback. Supports scan: (zero-build inline PR annotations), stdio:, http:, or file::
- uses: utkuvolkanuzunhan/MCP-vol@v0.1.0
with:
scan: "./src" # or stdio: "node dist/index.js" / http: "http://127.0.0.1:8080/mcp" / file: "tools.json"
format: markdown
fail-on: error
sarif-output: mcp-vol.sarif
3. Rust Library + rmcp v3.12 CI Gate & Sub-Millisecond Bm25Index
[]
= { = "0.1", = ["rmcp"] }
use *;
4. Register as an MCP Server for AI Coding Agents (Native Binary or Distroless Docker)
A minimal distroless Dockerfile (labeled with io.modelcontextprotocol.server.name="io.github.utkuvolkanuzunhan/mcp-vol") is also included for containerized agent runtimes.
Exposed MCP tools (7 read-only, deterministic, zero-network tools with full outputSchema, self-audited at 5.00/5.00 Tier A):
audit_mcp_tools— FullVOL001–VOL024audit + 1–5 dimension scores + token/USD cost +fix_hintsgenerate_repair_plan— Compact worst-tool-first repair checklist for agent loopssuggest_tool_patches— Deterministic RFC 6902 JSON Patch proposals (VOL006,VOL007,VOL016,VOL017,VOL018,VOL020,VOL021)detect_tool_collisions— Pairwise similarity matrix & TDQS shadowing analysiscompose_mcp_catalogs— Multi-server token/USD share, cross-server duplicates/overlaps,<server>_namespace simulation & deferral recommendationsbenchmark_tool_routing— Pre-indexedbm25,tfidf, orhybridRRF routing accuracy, NDCG@k & confusion pairsget_vol_rule_catalog— Static metadata for all 24 rules
Built-In Rules (VOL001–VOL024)
| Code | Dimension | Default | Slug | What It Catches |
|---|---|---|---|---|
VOL001 |
Purpose Clarity | error |
missing-description |
Missing or blank tool description (caps Purpose to 1.0) |
VOL002 |
Purpose Clarity | error |
tautological-description |
Description merely restates tool name/title |
VOL003 |
Purpose Clarity | warn |
vague-action-verb |
Opens with vague boilerplate (handles, manages, helper for) |
VOL004 |
Usage Guidelines | warn |
missing-usage-cue |
Multi-tool catalog (≥5 tools) missing when-to-use / exclusion cue |
VOL005 |
Usage Guidelines | warn |
missing-sibling-disambiguation |
Overlapping siblings do not name each other to mark boundaries |
VOL006 |
Behavioral Transparency | error |
annotation-contradiction |
ToolAnnotations contradict tool name/prose (caps Behavior to 1.0) |
VOL007 |
Behavioral Transparency | warn |
missing-behavior-annotations |
Omits readOnlyHint / destructiveHint / idempotentHint / openWorldHint |
VOL008 |
Behavioral Transparency | warn |
undisclosed-side-effect-or-limit |
Mutating or open-world tool omits side-effect, auth, or limit disclosure |
VOL009 |
Parameter Semantics | error |
undocumented-schema-parameter |
Parameter (including nested objects, array items, and $refs) omits description |
VOL010 |
Parameter Semantics | warn |
unconstrained-string-enum |
Closed-set parameter (status, mode, format, sort) has no enum/pattern |
VOL011 |
Parameter Semantics | warn |
opaque-parameter-or-format |
Opaque param name (data, value, arg) or unspecified date/regex format |
VOL012 |
Conciseness | warn |
token-budget-exceeded |
Tool description (>250 tok) or full catalog (>15k tok) exceeds budget |
VOL013 |
Conciseness | info |
schema-prose-duplication |
Prose duplicates parameter lists already documented in inputSchema |
VOL014 |
Contextual Completeness | error |
tool-intent-collision |
Duplicate names or high semantic/name/param similarity (≥0.72) |
VOL015 |
Contextual Completeness | warn |
shadowed-tool-asymmetry |
Low-argument sibling shadows a heavier filtered sibling (TDQS cost ratio) |
VOL016 |
Contextual Completeness | warn |
empty-or-untyped-output-schema |
Declared outputSchema is an empty {"type":"object"} stub |
VOL017 |
Contextual Completeness | warn |
inconsistent-naming-convention |
Violates MCP SEP-986 charset or mixes snake_case/camelCase/kebab-case |
VOL018 |
Behavioral Transparency | warn |
unbounded-list-or-search |
List/search/query tool lacks pagination/limit param and states no result cap |
VOL019 |
Behavioral Transparency | error |
coercive-routing-or-hidden-directive |
Hidden zero-width/BiDi Unicode, XML/HTML directives, or coercive routing overrides (caps Behavior to 1.0) |
VOL020 |
Parameter Semantics | error |
incompatible-or-broken-input-schema |
Non-object root inputSchema, root oneOf/anyOf/allOf, or external/unresolvable $ref |
VOL021 |
Parameter Semantics | error |
unsatisfiable-schema-constraint |
required references undeclared property, empty enum: [], or inverted min/max bounds |
VOL022 |
Contextual Completeness | warn |
duplicate-or-placeholder-description |
Unfinished TODO/TBD/{{template}} placeholders or verbatim duplicate descriptions across distinct tools |
VOL023 |
Conciseness | warn |
excessive-schema-complexity |
Over-complex inputSchema (>12 parameters or >4 nesting depth) harming model argument accuracy |
VOL024 |
Behavioral Transparency | info |
missing-return-contract |
Tool declares neither a typed outputSchema nor a prose return/output contract |
Run mcp-vol rules --format json to inspect the full machine-readable rule registry.
Pluggable Ranker Trait & Pre-Indexed Bm25Index
mcp-vol ships with four zero-dependency rankers (Bm25Index precomputed inverted index, stateless Bm25Ranker, TfIdfRanker, and Reciprocal Rank Fusion HybridRanker), and exposes a single-method trait (annotated with #[diagnostic::on_unimplemented]) so you can benchmark any embedding model, rmcp::tool_search index, or LLM router against the exact same EvalSuite with compare_rankers:
Architecture & Minimal Dependencies
crates/mcp-vol(core library,#![deny(missing_docs)]): depends only onserde,serde_json,thiserror. Zero async runtime, zero HTTP client, zero LLM SDKs. Optional features:sarif(default, zero extra deps) andrmcp(rmcp 3.12,default-features = false).crates/mcp-vol-cli(mcp-volbinary): adds onlyclapplus zero-dependency JSON-RPC 2.0 stdio (--stdio) and local Streamable HTTP (--http, purestd::net::TcpStreamwithMcp-Session-Id& SSE support) clients and the 7-tool stdio MCP server (mcp-vol mcp).
Links, Contributing & Security
- AI Agent Index:
llms.txt·llms-full.txt·context7.json·skills/mcp-vol-audit/SKILL.md - MCP Registry name:
mcp-name: io.github.utkuvolkanuzunhan/mcp-vol - See
CONTRIBUTING.mdfor rule design guidelines and the PR checklist. - See
SECURITY.mdfor the threat model and vulnerability reporting. - See
CHANGELOG.mdfor release notes andbenchmarks/NOTICE.mdfor upstream benchmark catalog attribution.
License
Dual-licensed under either of Apache License, Version 2.0 or MIT License at your option.