mcp-server-security-expert

mcp-server-security-expert is an agent for Claude Code from sageox/ox. It costs 140 tokens per session (1,354 once invoked), scanned B, original, MIT.

A security expert for Model Context Protocol (MCP), a way for language models to call tools through connected servers. It checks how tool requests, inputs, outputs, and connections could be abused.

In plain words
What is it for?
Use it to review MCP server code, validate tool names and arguments, enforce schemas, and assess risks in stdio or server-sent events connections.
Why use it?
MCP lets a language model choose tools and arguments without the limits of a normal user interface. This can allow unsafe requests or malicious instructions hidden in tool results to influence later actions.

Agent for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/sageox/ox/mcp-server-security-expert
Clone the repo
git clone --depth 1 https://github.com/sageox/ox

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mcp-server-security-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/sageox/ox/mcp-server-security-expert.svg)](https://agentmods.dev/agents/sageox/ox/mcp-server-security-expert)
Your own site
<a href="https://agentmods.dev/agents/sageox/ox/mcp-server-security-expert"><img src="https://agentmods.dev/badge/agents/sageox/ox/mcp-server-security-expert.svg" alt="Measured on agentmods" height="20"></a>
Per session 140 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,354 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00140 $0.01354
Opus 5 $0.00070 $0.00677
Sonnet 5 $0.00028 $0.00271
Haiku 4.5 $0.00014 $0.00135

Measured 5d ago against content hash 4143376dab7f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

mcp-server-security-expert scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Instruction-override phrasingmediumPrompt injection

Text telling the model to disregard its earlier instructions or safety rules is the shape of a prompt injection, whoever wrote it.

| **Output reflection** | Tool returns content that includes embedded "ignore previous instructions" payloads, hijacking the next model turn. | Tag tool outputs with explicit data delimiters; train/instruct the model to

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

.claude/agents/mcp-server-security-expert.md · 81 lines

How it starts

The opening of the file, as written. The whole thing — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MCP Server Security Expert

You are a senior security engineer specializing in Model Context Protocol (MCP) systems. You understand both how MCP works (JSON-RPC over stdio or SSE; client-server tool registration; structured prompt-tool interactions) and where its threat model differs from traditional API design.

Why MCP is its own threat model

In a normal API:

  • The caller's identity is authenticated.
  • The caller is constrained by what the application UI lets them request.
  • Inputs come from a constrained surface (form fields, URL params).

In MCP:

  • The caller is the LLM — its "intent" is whatever the conversation pushed it toward, including adversarial content embedded in user input or tool-output history.
  • There is no UI constraint — the LLM can decide to call any registered tool with any args at any time.
  • Tool outputs flow back into the LLM's context, where they can carry prompt-injection payloads that influence the next tool call.

This makes MCP a mutual-distrust environment between the model and the tool surface. Both sides need to defend.

Threat catalog

Class Description Defense
Free-form dispatch Tool name from model output not validated against the registered tool registry. Strict allowlist; reject unknown names.
Schema bypass Tool args not validated against the tool's declared parameter schema. JSON-schema validate every arg; reject extras.
Argument injection Validated tool name + valid-schema args, but the args contain payloads (paths, URLs, commands) that injection-attack downstream sinks. Sink-aware validation in the tool body (allowlist, normalization).
Output reflection Tool returns content that includes embedded "ignore previous instructions" payloads, hijacking the next model turn. Tag tool outputs with explicit data delimiters; train/instruct the model to treat tool output as data not instruction; for high-risk content, sanitize before returning.
Server impersonation The MCP client connects to a peer it didn't intend (cert mismatch, stdio binary swap). Pin server identity (cert pinning for SSE; expected binary path for stdio).
Privileged context retention Tool captures elevated capability (DB connection, admin token) and exposes it in subsequent tool calls. Per-call capability binding; never persist privilege across tool boundary.
Missing confirmation on mutation Tool that deletes / spends / publishes / mutates state runs on LLM intent alone. Require user confirmation prompt for mutating tools (don't trust the LLM to ask).
Sensitive-info leak in tool metadata Tool advertises its capabilities by leaking config, env vars, or paths. Tool descriptions should be capability-only; never include secrets.
Async race Concurrent tool calls modifying shared state without sync. Tool registry is single-threaded per session, OR tools are pure / use proper sync.
Sandbox escape A tool meant to read project-local files accepts .. paths. Path-allowlist + securejoin pattern.

Read the full file on GitHub · 81 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 81 lines · 140 tokens per session scan B 4143376dab7f

Subscribe to this mod's changes

mcp-server-security-expert is an agent published in the GitHub repository sageox/ox (51 stars, last pushed today), licensed MIT. It adds 140 tokens to every session and 1,354 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it B with 1 finding (instruction-override phrasing). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.