MCPSpec

Ship reliable MCP servers
with confidence

Record sessions, generate mock servers, gate your CI pipeline, and catch Tool Poisoning — all without writing a single line of test code. The reliability platform for Model Context Protocol servers.

$ npm install -g mcpspec
# 1. Explore a server interactively
mcpspec inspect "npx my-server"

# 2. Record a session (no test code needed!)
mcpspec record start "npx my-server"

# 3. Generate a mock for your team
mcpspec mock my-recording --generate ./mocks/server.js

# 4. Add CI gating in 30 seconds
mcpspec ci-init

Why MCPSpec?

Deterministic

Unlike LLM-based testing, MCPSpec runs are fast and repeatable. No flaky tests, no token costs. Ideal for CI pipelines.

Secure

Catch Tool Poisoning (prompt injection in descriptions) and Excessive Agency (destructive tools without safeguards) before they reach production.

Collaborative

Record server interactions and share mocks with your team. Frontend developers and CI can test against mocks — no API keys required.

Get started in 30 seconds

No config files needed. Try a pre-built collection or explore a server interactively.

1

Install MCPSpec

npm install -g mcpspec
2

Run a community collection (no setup required)

mcpspec test examples/collections/servers/filesystem.yaml
MCPSpec running Filesystem Server Tests (12 tests)
   Read a file (124ms)
   Handle missing file (89ms)
   List directory (45ms)
  ...
  Tests:  12 passed (12 total)
  Time:   1.23s
3

Or scaffold your own project

mcpspec init --template standard && mcpspec test

Everything you need

13 CLI commands, 10 assertion types, 8 security rules, 5 reporter formats, and a full web dashboard.

70 pre-built tests, ready to run

Community collections for popular MCP servers. See all examples

CollectionServerTests
filesystem.yaml@modelcontextprotocol/server-filesystem12
memory.yaml@modelcontextprotocol/server-memory10
everything.yaml@modelcontextprotocol/server-everything11
time.yaml@modelcontextprotocol/server-time10
fetch.yaml@modelcontextprotocol/server-fetch7
github.yaml@modelcontextprotocol/server-github9
chrome-devtools.yamlchrome-devtools-mcp11