mcpField
M
mcp-jest

mcp-jest

Local
github.com/josharshDeveloper Tools18Updated 5w ago

About mcp-jest

mcp-jest is a CLI and JavaScript library for automated testing of MCP servers, aimed at server developers and teams handling integrations and CI. It supports multiple transports and includes protocol validation, capability discovery, and snapshot testing.

Key features

  1. 01Test tools, resources, and prompts
  2. 02Support stdio, HTTP, and SSE
  3. 03Validate MCP protocol compliance
  4. 04Discover server capabilities automatically
  5. 05Snapshot tests and HTML reports

Use cases

  1. 01Test MCP server capabilities before deployment
  2. 02Add MCP tests to CI/CD pipelines
  3. 03Compare server outputs across versions

MCP support

The tool connects to and tests MCP servers, checking tools, resources, prompts, and protocol compliance; it supports stdio, HTTP Streaming, and SSE.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

mcp-jest

Automated testing for Model Context Protocol (MCP) servers. Test your AI agent tools with Jest-like syntax, validate protocol compliance, and integrate with CI/CD.

  • 🧪 Test tools, resources, and prompts — automated validation of your MCP server capabilities
  • 📦 Zero config — works out-of-the-box with any MCP server (stdio, HTTP, SSE)
  • ✅ Protocol validation — check MCP compliance with detailed scoring
  • 🚀 CI/CD ready — GitHub Actions, Jenkins, CircleCI integration
  • 📸 Snapshot testing — capture and compare outputs over time

MIT licensed · npm · GitHub


Install

npm install mcp-jest        # Project dependency
npm install -g mcp-jest     # Or globally for CLI

Use It

Test your MCP server in 30 seconds:

mcp-jest node ./server.js --tools search,email

Or use the JavaScript API:

import { mcpTest } from 'mcp-jest';

const results = await mcpTest(
  { command: 'node', args: ['./server.js'] },
  { tools: ['search', 'email'] }
);

console.log(`${results.passed}/${results.total} tests passed`);

What is MCP?

Model Context Protocol (MCP) is an open standard by Anthropic that lets AI assistants (Claude, ChatGPT, Gemini) connect to external tools, databases, and APIs. MCP-Jest tests those connections.


Why MCP-Jest?

You built an MCP server. But how do you know it works?

  • Manual testing is slow and error-prone
  • Silent failures break AI workflows
  • No native CI/CD integration for MCP
  • Debugging production failures is hard

MCP-Jest solves this with automated, repeatable testing.

Features

Core Testing
  • Automated Testing - Write tests once, run them everywhere
  • Comprehensive Coverage - Test connections, tools, resources, and prompts
  • Flexible Expectations - Simple strings or custom validation functions
  • CI/CD Ready - Works with GitHub Actions, Jenkins, CircleCI, etc.
Advanced Features
  • Snapshot Testing - Capture and compare MCP outputs over time
  • Test Filtering - Run specific tests with --filter and --skip
  • Watch Mode - Auto-rerun tests when files change
  • HTML Reports - Generate beautiful, shareable test reports
Transport Support
  • stdio - Default transport for local servers
  • HTTP Streaming - Test remote HTTP servers
  • SSE - Server-Sent Events support
Developer Tools
  • Auto-Discovery - Automatically discover and generate tests for all capabilities
  • Protocol Validator - Check MCP compliance with detailed scoring
  • GitHub Action - Native CI/CD integration

CLI Quick Reference

CommandDescription
mcp-jest node ./server.js --tools searchTest specific tools
mcp-jest --config test.jsonUse config file
mcp-jest discover node ./server.jsAuto-discover capabilities
mcp-jest validate node ./server.jsCheck protocol compliance
mcp-jest watch node ./server.js --tools searchWatch mode
Common Options
OptionDescription
-t, --tools <tools>Comma-separated tools to test
-c, --config <file>Config file path
--timeout <ms>Test timeout (default: 30000)
-u, --update-snapshotsUpdate snapshot files
--reporter htmlGenerate HTML report

See CLI Reference for all options.

Example: CI/CD Integration

# .github/workflows/test.yml
- name: Test MCP Server
  run: |
    npm install -g mcp-jest
    mcp-jest node ./dist/server.js --tools "search,analyze"

Example: Config File

{
  "server": {
    "command": "node",
    "args": ["./server.js"]
  },
  "tests": {
    "tools": {
      "search": {
        "args": { "query": "test" },
        "expect": "content.length > 0"
      }
    },
    "timeout": 30000
  }
}

Documentation

GuideDescription
Getting StartedStep-by-step setup guide
CLI ReferenceComplete CLI documentation
API ReferenceLibrary API documentation
ExamplesReal-world examples
ArchitectureHow MCP-Jest works
TroubleshootingCommon issues and solutions
Feature Guides

Requirements

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

git clone https://github.com/josharsh/mcp-jest.git
cd mcp-jest
npm install
npm run dev
npm test

Security

See SECURITY.md for our security policy and vulnerability reporting.

Use Cases

MCP-Jest is ideal for:

  • MCP Server Developers - Test your tools, resources, and prompts before deployment
  • AI Application Teams - Ensure your MCP integrations work correctly
  • DevOps/SRE - Add MCP server testing to CI/CD pipelines
  • Open Source MCP Projects - Provide reliable testing for community contributions

Comparison with Other Tools

FeatureMCP-JestManual TestingGeneric Test Frameworks
MCP Protocol SupportNativeManualRequires custom setup
Auto-DiscoveryYesNoNo
Snapshot TestingYesNoVaries
Protocol ValidationYesNoNo
CI/CD IntegrationBuilt-inManualVaries

Support

Related Technologies

License

MIT License - Use freely in commercial and open source projects.


Project Status

npm version npm downloads License: MIT Node.js CI TypeScript PRs Welcome MCP Compatible


Built for the MCP ecosystem | Documentation | Examples | Contributing


Keywords: mcp testing, model context protocol testing, mcp server testing, ai agent testing, llm testing, claude mcp, chatgpt mcp, mcp tools testing, mcp validator, anthropic mcp, test mcp server, mcp ci cd, automated mcp testing

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.