Skip to main content
AI & Technical Systems·Evidence-first review for MCP implementations

MCP Guard & Sentry

I built MCP Guard for scoped source and capability review. I also released Sentry, a separate research adapter that scores whether a proposed action matches the user's stated purpose. The application retains control of permissions and execution.

Status

Public CLI v0.2.1 · Experimental advisory adapter

Capabilities

AI security · Static analysis · Release discipline

The problem

An MCP server can expose powerful tools while hiding implementation details behind a small interface. A source review needs to surface evidence and identify coverage gaps. At runtime, even a permitted action can serve a different purpose from the user's request.

What I worked on

I built scoped source rules, offline inventory and schema validation, capability snapshots, drift detection, machine-readable output, HTML reports and a constrained macOS discovery path for a reviewed fixture. For Sentry, I adapted Qwen3-1.7B BF16 with a rank-4 LoRA that scores three choices: match, mismatch or clarify. Deterministic code binds the supplied evidence references.

Evaluation results

Offline regression and clean-input checks

MCP Guard v0.2.1 was checked without starting a server. The offline suite and a repeat check on three known-clean inputs are reported separately.

Offline regression tests
129 passed
Clean-input repeat check
3 of 3
Each exited successfully with zero findings.

The regression suite and three known-clean inputs do not establish a false-positive rate on unseen projects.

External registration coverage

A separate sample contained 24 tool registrations across seven source files.

Recognized registrations
4 of 24
Coverage diagnostics
27

This measures recognition coverage, not detection accuracy. No security conclusion can be drawn about registrations the analyzer did not recognize.

Sentry contextual development decisions

The rank-4 adapter and unmodified Qwen3-1.7B BF16 parent used the same three-example prompt and deterministic evidence renderer on 232 contextual development cases spanning two purposes. The comparison scored exact status and evidence references. Some cases shared a source utterance.

Correct native decisions · parent → Sentry
135 → 158 of 232
Decision coverage at a 0.90 cutoff · parent → Sentry
185 → 16 of 232
The parent made 60 errors among its 185 decisions. Sentry made two among its 16.

Sentry recognized more definite mismatches but correctly clarified none of the 16 unresolved cases. Threshold coverage is an experimental result on the same development data and provides no independent security efficacy estimate.

Decision coverage and error versus confidence threshold for the Qwen3-1.7B parent and Sentry adapter on 232 development cases.
At a 0.90 cutoff, Sentry issued 16 decisions with two errors, compared with 185 decisions and 60 errors for the parent. Zayyan Latif · CC BY 4.0
See Agent Runtime and Hermes benchmarks

Decisions and tradeoffs

Make incomplete coverage visible

An unsupported registration shape returns an incomplete assessment instead of being treated as clean.

Separate source findings from runtime discovery

Static analysis and isolated discovery have different evidence. The tool keeps those boundaries explicit.

Treat capability drift as a review event

Changes to tool descriptions and schemas are surfaced for review even when no source-rule finding crosses the configured threshold.

Keep intent scoring advisory

Sentry estimates purpose alignment. The application owns authentication, tool permissions and execution, and the scanner supplies its own findings.

Current status

MCP Guard audits a documented subset of JavaScript and TypeScript with explicit coverage diagnostics. Sentry is an experimental advisory adapter evaluated in development simulations. Authentication, authorization and execution remain with the application.

See the work

Illustrative interface preview · synthetic data

Implementation details

Key subsystems

  • Scoped JavaScript and TypeScript source audit
  • Offline inventory and schema validation
  • Capability snapshot and drift comparison
  • JSON and HTML reporting
  • Finite-label intent scoring and deterministic evidence binding