grade

A command that runs Polygraph security tests against an MCP server. MCP servers connect AI agents to tools and services, and the command reports an A–F grade plus failed checks.

In plain words
What is it for?
Use it to test a local or remote MCP server for unsafe tool outputs, data leaving the system, sensitive-data exposure, and adversarial inputs.
Why use it?
It provides a repeatable way to check an MCP server for common security problems and explains what caused a failed result.

Command

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 commands/polygraphso/litmus/grade
Clone the repo
git clone --depth 1 https://github.com/polygraphso/litmus
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 838 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00019 $0.00838
Opus 5 $0.00010 $0.00419
Sonnet 5 $0.00004 $0.00168
Haiku 4.5 $0.00002 $0.00084

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

Security

Grade A, and why

grade scanned grade A with 0 findings 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 2d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/polygraph/commands/grade.md · 59 lines

What it actually says

Run the polygraph litmus on $ARGUMENTS using the run_litmus tool from the polygraph-litmus MCP server (bundled with this plugin). Report the letter grade, the one-line summary, and any failed category with its findings. If the grade is capped at B because Docker was unavailable, say so plainly.

run_litmus grades MCP servers, not skills. If $ARGUMENTS is a skill (a skill directory, or a request to grade or validate a skill), use the skill path instead — the run_skill_litmus tool or the grade-skill prompt — not run_litmus.

Token-gated servers

If the target is an https:// URL and run_litmus fails to connect because the server is token-gated (an auth error such as 401, invalid_token, or "No authorization provided"), litmus needs a bearer token — it connects as a fresh, independent client, so it has none of the user's existing session.

Don't immediately ask the user to paste one. First look for the token they already have: the same MCP client config that makes this server work in their agent. Only when that fails should you ask.

  1. If the user already supplied a token (in $ARGUMENTS or the conversation), use it directly — skip discovery.
  2. Otherwise, check the config files that exist and find the entry whose URL matches the target (ignore a trailing-slash difference). Common locations: project ./.mcp.json, ./.cursor/mcp.json, ./.vscode/mcp.json; user-level ~/.claude.json, the Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS, the equivalent for the platform), and ~/.cursor/mcp.json. Read that entry's headers, resolving any ${VAR} placeholder from the environment.
  3. If found, confirm before using it: name the source file, never print the token value, and state plainly that grading will make live, authenticated tool calls to the server as the user (read-only tools only). On confirmation, re-run run_litmus passing the token as bearer (strip a leading Bearer ), or as a header "Key: Value" for a non-Authorization scheme.
  4. If nothing is found, the server may use OAuth. Tell the user a browser window will open for them to log in, then re-run run_litmus with interactive_auth: true — litmus opens the browser, captures the token via a local 127.0.0.1 callback, and uses it for this run only (never stored). If the user declines, or the server isn't OAuth, ask for a bearer token and say why: litmus connects as a fresh client and needs the same token their agent already uses for this server.

Never pass unsafe_host_exec, and never enable state-changing calls just to get past auth.

If run_litmus isn't in your available tools, it may just need loading (some clients surface MCP tools lazily) — try to load it before concluding it's missing. Only if the polygraph-litmus server genuinely isn't connected, tell me to enable the plugin (/plugin install polygraph@polygraphso, adding the marketplace first with /plugin marketplace add polygraphso/litmus if needed) and restart the session so the tools load. Do not suggest claude mcp add — the plugin already provides the server.

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. 2d ago First seen · 59 lines · 19 tokens per session scan A 286f3a9cfad2

Subscribe to this mod's changes

grade is a command published in the GitHub repository polygraphso/litmus (8 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 19 tokens to every session and 838 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.