Socket
Book a DemoInstallSign in
Socket

mcp-jest

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mcp-jest

Testing framework for Model Context Protocol (MCP) servers - like Jest but for MCP

latest
Source
npmnpm
Version
1.0.13
Version published
Weekly downloads
166
14.48%
Maintainers
1
Weekly downloads
Β 
Created
Source

MCP-Jest

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

The first (and perhaps only) testing framework for Model Context Protocol (MCP) servers - like Jest, but for MCP

πŸš€ Finally! Test your MCP servers with confidence. No more manual verification, no more broken deployments.

The Problem

You built an MCP server that connects AI assistants to your database, file system, or API. But how do you know it actually works?

npm install mcp-jest

Why mcp-jest?

The Problem 😀

Building MCP servers? You've probably experienced this:

  • ❌ Manual Testing Hell: Manually connecting clients to test every change
  • ❌ Silent Failures: Servers break and you don't know until Claude Code crashes
  • ❌ No CI/CD: Can't automate MCP server testing in pipelines
  • ❌ Debugging Nightmare: When things break, you have no idea what went wrong
  • ❌ Fear of Deployment: Every update is a gamble

The Solution ✨

mcp-jest is the missing piece of the MCP ecosystem:

  • βœ… Automated Testing: Write tests once, run them everywhere
  • βœ… Instant Feedback: Know immediately when something breaks
  • βœ… CI/CD Ready: Integrate seamlessly into any build pipeline
  • βœ… Crystal Clear Results: Detailed reports show exactly what works and what doesn't
  • βœ… Deploy with Confidence: Comprehensive testing before production

πŸ“‹ Table of Contents

πŸ“š Documentation: https://mcp-jest.ddiy.diy/

⚑ Quick Start (30 seconds)

1. Install

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

2. Test Your Server

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`);

3. Or Use CLI

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

That's it! Your MCP server is now tested. πŸŽ‰

πŸ”₯ Features That Matter

πŸ§ͺ Dead Simple API

One function call tests your entire server. No complex setup, no boilerplate.

πŸ“ Declarative Testing

Describe what to test, not how. Focus on your server logic, not test infrastructure.

πŸ” Comprehensive Coverage

  • Connection Testing: Server starts and responds
  • Capability Discovery: Tools/resources/prompts exist
  • Functional Testing: Everything actually works
  • Validation: Results match expectations

πŸš€ Built for Production

  • CI/CD Integration: Works with GitHub Actions, Jenkins, etc.
  • Fast Execution: Complete test suites in under 500ms
  • Detailed Reporting: Know exactly what failed and why
  • Zero Dependencies: Uses official MCP SDK only

πŸ› οΈ Flexible Usage

  • Library: Integrate into existing test suites
  • CLI: Perfect for scripts and pipelines
  • Config Files: Complex test scenarios
  • TypeScript: Full type safety included

πŸ“Έ Snapshot Testing

  • Capture Outputs: Save MCP responses as snapshots
  • Detect Changes: Know when outputs change unexpectedly
  • Easy Updates: Update snapshots with a single flag
  • Selective Snapshots: Choose specific fields to track

🎯 Test Filtering (NEW v1.0.10!)

  • Filter Tests: Run only tests matching a pattern with --filter
  • Skip Tests: Exclude tests from running with --skip
  • Wildcard Support: Use * for flexible pattern matching
  • Fast Iteration: Focus on specific tests during development

🌐 HTTP Transport Support (NEW v1.0.13!)

  • Multiple Transports: Test servers over stdio, HTTP streaming, or SSE
  • Flexible Connectivity: Support for remote and local HTTP servers
  • Easy Configuration: Simple CLI flags or config file settings
  • Backward Compatible: Existing stdio tests work without changes

πŸ›‘οΈ Enhanced Compatibility (NEW v1.0.13!)

  • FastMCP Support: Works with servers that implement partial MCP protocol
  • Graceful Error Handling: Handle "Method not found" errors elegantly
  • Flexible Servers: Test servers that only implement some capabilities

🎯 Real-World Examples

Testing a Search Server

const results = await mcpTest(
  { command: 'python', args: ['search-server.py'] },
  {
    tools: {
      search: {
        args: { query: 'artificial intelligence' },
        expect: result => result.results.length > 0
      },
      autocomplete: {
        args: { partial: 'artif' },
        expect: 'suggestions.length >= 3'
      }
    }
  }
);

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"

Development Workflow

{
  "scripts": {
    "test": "jest && npm run test:mcp",
    "test:mcp": "mcp-jest node ./server.js --tools search,email",
    "dev": "concurrently 'npm run dev:server' 'npm run test:mcp:watch'"
  }
}

Snapshot Testing (NEW!)

// Capture and compare MCP outputs over time
const results = await mcpTest(
  { command: 'node', args: ['./weather-server.js'] },
  {
    tools: {
      getWeather: {
        args: { city: 'London' },
        snapshot: {
          exclude: ['temperature', 'timestamp'],  // Exclude changing data
          properties: ['format', 'units', 'structure']  // Track structure
        }
      }
    }
  }
);

// Update snapshots when changes are intentional
// mcp-jest node ./server.js --update-snapshots

Test Filtering (NEW!)

# Run only search-related tests
mcp-jest node ./server.js --tools "search,email,weather" --filter search

# Skip email tests during development
mcp-jest node ./server.js --tools "search,email,weather" --skip email

# Use wildcards for flexible filtering
mcp-jest node ./server.js --tools "getUser,getUserProfile,updateUser" --filter "user*"

# Combine with other options
mcp-jest node ./server.js --filter search --timeout 5000 --update-snapshots

HTTP Transport Testing (NEW!)

# Test stdio server (default)
mcp-jest node ./server.js --tools search,email

# Test HTTP streaming server
mcp-jest --transport streamable-http --url http://localhost:3000 --tools search

# Test SSE server
mcp-jest --transport sse --url http://api.example.com/sse --tools search,email

# Use config file for HTTP transport
cat > mcp-jest.json << EOF
{
  "server": {
    "transport": "streamable-http",
    "url": "http://localhost:3000/mcp"
  },
  "tests": {
    "tools": ["search", "calculate"],
    "timeout": 60000
  }
}
EOF
mcp-jest --config mcp-jest.json

πŸ“– CLI Reference

Command Line Options

mcp-jest [OPTIONS] [SERVER_COMMAND]

Options

OptionDescriptionExample
-h, --helpShow help messagemcp-jest --help
-v, --versionShow versionmcp-jest --version
-c, --config <file>Load configuration from JSON filemcp-jest --config test.json
-s, --server <cmd>Server command to test (stdio only)mcp-jest --server "node server.js"
--transport <type>Transport type: stdio, sse, streamable-httpmcp-jest --transport streamable-http
--url <url>Server URL (required for HTTP transports)mcp-jest --url http://localhost:3000
--args <args>Comma-separated server argumentsmcp-jest node server.js --args "port=3000,debug"
-t, --tools <tools>Comma-separated list of tools to testmcp-jest --tools search,calculate
-r, --resources <res>Comma-separated list of resources to testmcp-jest --resources "data/*,config.json"
-p, --prompts <prompts>Comma-separated list of prompts to testmcp-jest --prompts analyze,summarize
--timeout <ms>Test timeout in millisecondsmcp-jest --timeout 60000
-u, --update-snapshotsUpdate snapshots instead of comparingmcp-jest -u
-f, --filter <pattern>Run only tests matching patternmcp-jest --filter "search*"
--skip <pattern>Skip tests matching patternmcp-jest --skip "*test*"

πŸš€ Ecosystem Integration

Works With Everything

  • MCP Servers: Any language, any framework
  • AI Clients: Claude Code, custom clients, SDKs
  • CI/CD: GitHub Actions, GitLab CI, Jenkins, CircleCI
  • Package Managers: npm, pnpm, yarn
  • Test Runners: Jest, Vitest, Mocha (as library)
  • Development: Test changes instantly during development
  • CI/CD: Automated testing in build pipelines
  • Deployment: Verify servers work before going live
  • Monitoring: Regular health checks in production
  • Documentation: Ensure examples actually work

The Problem It Solves

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     β”‚         β”‚                     β”‚
β”‚   MCP Server Dev    β”‚   ???   β”‚  How do I know my   β”‚
β”‚   Implements Tool   β”‚ ──────> β”‚  server works?      β”‚
β”‚                     β”‚         β”‚                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Before MCP-JEST: Manual testing, no automation, no confidence
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     β”‚         β”‚                     β”‚         β”‚                     β”‚
β”‚   MCP Server Dev    β”‚ ──────> β”‚     MCP-JEST        β”‚ ──────> β”‚  βœ“ Automated Tests   β”‚
β”‚   Implements Tool   β”‚         β”‚   Test Framework    β”‚         β”‚  βœ“ CI/CD Ready      β”‚
β”‚                     β”‚         β”‚                     β”‚         β”‚  βœ“ Snapshot Testing β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

With MCP-JEST: Automated, repeatable, confident testing

Architecture Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                              MCP-JEST Architecture                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                    β”‚
β”‚  β”‚    CLI      β”‚     β”‚  Library    β”‚     β”‚   Types     β”‚                    β”‚
β”‚  β”‚ (cli.ts)    β”‚     β”‚ (index.ts)  β”‚     β”‚ (types.ts)  β”‚                    β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜                    β”‚
β”‚         β”‚                    β”‚                    β”‚                         β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                         β”‚
β”‚                              β”‚                                              β”‚
β”‚                              β–Ό                                              β”‚
β”‚                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                      β”‚
β”‚                    β”‚   MCPTestRunner  β”‚                                     β”‚
β”‚                    β”‚   (runner.ts)    β”‚                                     β”‚
β”‚                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                     β”‚
β”‚                             β”‚                                               β”‚
β”‚         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                           β”‚
β”‚         β”‚                   β”‚                   β”‚                           β”‚
β”‚         β–Ό                   β–Ό                   β–Ό                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                      β”‚
β”‚  β”‚ MCPTestClientβ”‚  β”‚SnapshotManagerβ”‚  β”‚  Expectation β”‚                      β”‚
β”‚  β”‚ (client.ts)  β”‚  β”‚ (snapshot.ts) β”‚  β”‚   Evaluator  β”‚                      β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜                      β”‚
β”‚         β”‚                   β”‚                  β”‚                            β”‚
β”‚         β–Ό                   β–Ό                  β–Ό                            β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                       β”‚
β”‚  β”‚          MCP Protocol Communication              β”‚                       β”‚
β”‚  β”‚        (via @modelcontextprotocol/sdk)          β”‚                        β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                       β”‚
β”‚                             β”‚                                               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚  Your MCP Server β”‚
                    β”‚   (Being Tested) β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

MCP-JEST is Unique for its Protocol-Specific Design

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           Generic Testing vs MCP-JEST                   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                         β”‚
β”‚  Generic Test Framework:                                β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                            β”‚
β”‚  β”‚  Test   │──[HTTP/Function Call]──> Response          β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                            β”‚
β”‚                                                         β”‚
β”‚  MCP-JEST:                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                            β”‚
β”‚  β”‚  Test   β”‚                                            β”‚
β”‚  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜                                            β”‚
β”‚       β”‚                                                 β”‚
β”‚       β”œβ”€β”€[1. Process Management]                        β”‚
β”‚       β”œβ”€β”€[2. StdioTransport Setup]                      β”‚
β”‚       β”œβ”€β”€[3. MCP Protocol Handshake]                    β”‚
β”‚       β”œβ”€β”€[4. Capability Discovery]                      β”‚
β”‚       β”œβ”€β”€[5. Tool/Resource/Prompt Execution]            β”‚
β”‚       └──[6. Structured Validation]                     β”‚
β”‚                                                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

MCP-JEST is Unique for Comprehensive Test Coverage

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          MCP-JEST Test Coverage               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                β”‚
β”‚  Connection Layer:                             β”‚
β”‚  β€’ Server startup                              β”‚
β”‚  β€’ Protocol handshake                          β”‚
β”‚  β€’ Timeout handling                            β”‚
β”‚                                                β”‚
β”‚  Discovery Layer:                              β”‚
β”‚  β€’ Available tools                             β”‚
β”‚  β€’ Available resources                         β”‚
β”‚  β€’ Available prompts                           β”‚
β”‚  β€’ Capability matching                         β”‚
β”‚                                                β”‚
β”‚  Functional Layer:                             β”‚
β”‚  β€’ Tool execution with arguments               β”‚
β”‚  β€’ Resource reading                            β”‚
β”‚  β€’ Prompt generation                           β”‚
β”‚  β€’ Error handling                              β”‚
β”‚                                                β”‚
β”‚  Validation Layer:                             β”‚
β”‚  β€’ Response structure                          β”‚
β”‚  β€’ Content validation                          β”‚
β”‚  β€’ Snapshot comparison                         β”‚
β”‚  β€’ Custom expectations                         β”‚
β”‚                                                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

3. MCP-JEST is Unique for its Developer Experience

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         Developer Experience Flow                β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                  β”‚
β”‚  1. Write Test Config (JSON)                     β”‚
β”‚     Simple, declarative, no code needed          β”‚
β”‚                                                  β”‚
β”‚  2. Run Tests                                    β”‚
β”‚     $ mcp-jest test-config.json                  β”‚
β”‚                                                  β”‚
β”‚  3. See Results                                  β”‚
β”‚     βœ“ Connection test passed (50ms)              β”‚
β”‚     βœ“ Tool: calculate - passed (23ms)            β”‚
β”‚     βœ— Resource: data - failed (15ms)             β”‚
β”‚       Expected: "value"                          β”‚
β”‚       Received: "other"                          β”‚
β”‚                                                  β”‚
β”‚  4. Update Snapshots (if needed)                 β”‚
β”‚     $ mcp-jest test-config.json -u               β”‚
β”‚                                                  β”‚
β”‚  5. Integrate with CI/CD                         β”‚
β”‚     Exit codes, JSON output, timing info         β”‚
β”‚                                                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

MCP-JEST Supports Snapshots

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Snapshot Comparison Algorithm               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ ─
β”‚                                                          β”‚
β”‚  1. Normalize Data:                                      β”‚
β”‚     β€’ Sort object keys alphabetically                    β”‚
β”‚     β€’ Remove volatile fields (timestamps, IDs)           β”‚
β”‚     β€’ Apply inclusion/exclusion rules                    β”‚
β”‚                                                          β”‚
β”‚  2. Generate Hash:                                       β”‚
β”‚     β€’ Create deterministic string representation         β”‚
β”‚     β€’ Use SHA-256 for consistency                        β”‚
β”‚                                                          β”‚
β”‚  3. Compare:                                             β”‚
β”‚     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                  β”‚
β”‚     β”‚   Current   β”‚     β”‚   Stored    β”‚                  β”‚
β”‚     β”‚   Output    β”‚ <=> β”‚  Snapshot   β”‚                  β”‚
β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β”‚
β”‚            β”‚                    β”‚                        β”‚
β”‚            β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                        β”‚
β”‚                     β”‚                                    β”‚
β”‚                β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”                               β”‚
β”‚                β”‚  Equal? β”‚                               β”‚
β”‚                β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜                               β”‚
β”‚                     β”‚                                    β”‚
β”‚           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                          β”‚
β”‚           β”‚                   β”‚                          β”‚
β”‚         [Yes]               [No]                         β”‚
β”‚           β”‚                   β”‚                          β”‚
β”‚        βœ“ Pass          Check Update Mode                 β”‚
β”‚                               β”‚                          β”‚
β”‚                      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”                 β”‚
β”‚                      β”‚                 β”‚                 β”‚
β”‚                 [Update Mode]     [Normal Mode]          β”‚
β”‚                      β”‚                 β”‚                 β”‚
β”‚                Update & Pass       Show Diff & Fail      β”‚
β”‚                                                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Comparison with Alternatives

What Exists Today vs MCP-JEST

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  Testing Approach Comparison                 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ ─
β”‚                                                              β”‚
β”‚  Manual Testing:                                             β”‚
β”‚  ───────────────                                             β”‚
β”‚  β€’ Start server manually                                     β”‚
β”‚  β€’ Use Claude Desktop or terminal                            β”‚
β”‚  β€’ Manually invoke each tool                                 β”‚
β”‚  β€’ Visually verify outputs                                   β”‚
β”‚  β€’ No automation, no CI/CD                                   β”‚
β”‚                                                              β”‚
β”‚  Custom Scripts:                                             β”‚
β”‚  ───────────────                                             β”‚
β”‚  β€’ Write custom Node.js/Python scripts                       β”‚
β”‚  β€’ Implement MCP client from scratch                         β”‚
β”‚  β€’ Handle all edge cases yourself                            β”‚
β”‚  β€’ Maintain test infrastructure                              β”‚
β”‚  β€’ Reinvent the wheel for each project                       β”‚
β”‚                                                              β”‚
β”‚  Generic Test Frameworks (Jest/Mocha):                       β”‚
β”‚  ─────────────────────────────────────                       β”‚
β”‚  β€’ Not designed for process communication                    β”‚
β”‚  β€’ No MCP protocol understanding                             β”‚
β”‚  β€’ Complex setup for stdio handling                          β”‚
β”‚  β€’ No built-in capability discovery                          β”‚
β”‚  β€’ Manual snapshot implementation                            β”‚
β”‚                                                              β”‚
β”‚  MCP-JEST:                                                   β”‚
β”‚  ─────────                                                   β”‚
β”‚  βœ“ Purpose-built for MCP                                     β”‚
β”‚  βœ“ Zero-config process management                            β”‚
β”‚  βœ“ Protocol-aware testing                                    β”‚
β”‚  βœ“ Built-in expectations & snapshots                         β”‚
β”‚  βœ“ CI/CD ready out of the box                                β”‚
β”‚  βœ“ Minimal dependencies                                      β”‚
β”‚                                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Feature Comparison Matrix

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Feature Comparison                        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€  ─
β”‚     Feature      β”‚ MCP-JEST β”‚ Manual  β”‚ Custom   β”‚ Generic   β”‚
β”‚                  β”‚          β”‚ Testing β”‚ Scripts  β”‚ Frameworksβ”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Process Mgmt     β”‚    βœ“     β”‚    βœ—    β”‚    ~     β”‚    βœ—      β”‚
β”‚ MCP Protocol     β”‚    βœ“     β”‚    βœ“    β”‚    ~     β”‚    βœ—      β”‚
β”‚ Auto Discovery   β”‚    βœ“     β”‚    βœ—    β”‚    ~     β”‚    βœ—      β”‚
β”‚ Snapshots        β”‚    βœ“     β”‚    βœ—    β”‚    ~     β”‚    ~      β”‚
β”‚ CI/CD Ready      β”‚    βœ“     β”‚    βœ—    β”‚    ~     β”‚    βœ“      β”‚
β”‚ Type Safety      β”‚    βœ“     β”‚    βœ—    β”‚    ~     β”‚    ~      β”‚
β”‚ Zero Config      β”‚    βœ“     β”‚    βœ“    β”‚    βœ—     β”‚    βœ—      β”‚
β”‚ Timing Info      β”‚    βœ“     β”‚    βœ—    β”‚    ~     β”‚    βœ“      β”‚
β”‚ Expectations     β”‚    βœ“     β”‚    βœ—    β”‚    ~     β”‚    βœ“      β”‚
β”‚ JSON Reports     β”‚    βœ“     β”‚    βœ—    β”‚    ~     β”‚    ~      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Legend: βœ“ Full Support, ~ Partial/Manual Implementation, βœ— Not Supported

Why This Matters

1. For MCP Server Developers

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           Value for Server Developers                    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ ─
β”‚                                                          β”‚
β”‚  Confidence:                                             β”‚
β”‚  β€’ Know your server works before shipping                β”‚
β”‚  β€’ Catch regressions immediately                         β”‚
β”‚  β€’ Test edge cases systematically                        β”‚
β”‚                                                          β”‚
β”‚  Productivity:                                           β”‚
β”‚  β€’ Fast feedback loop                                    β”‚
β”‚  β€’ No manual testing repetition                          β”‚
β”‚  β€’ Focus on features, not testing infrastructure         β”‚
β”‚                                                          β”‚
β”‚  Quality:                                                β”‚
β”‚  β€’ Consistent behavior across updates                    β”‚
β”‚  β€’ Document expected behavior via tests                  β”‚
β”‚  β€’ Ensure protocol compliance                            β”‚
β”‚                                                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

2. For the MCP Ecosystem

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Ecosystem Benefits                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                          β”‚
β”‚  Standardization:                                        β”‚
β”‚  β€’ Common testing patterns                              β”‚
β”‚  β€’ Shared quality bar                                   β”‚
β”‚  β€’ Consistent user experience                           β”‚
β”‚                                                          β”‚
β”‚  Trust:                                                  β”‚
β”‚  β€’ Users can trust tested servers                       β”‚
β”‚  β€’ "MCP-JEST tested" badge                             β”‚
β”‚  β€’ Reduced bugs in production                           β”‚
β”‚                                                          β”‚
β”‚  Growth:                                                 β”‚
β”‚  β€’ Lower barrier to entry                               β”‚
β”‚  β€’ Faster development cycles                            β”‚
β”‚  β€’ More reliable servers β†’ more adoption                β”‚
β”‚                                                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🀝 Contributing

We love contributions! Here's how to get started:

Quick Development Setup

# Clone the repository
cd mcp-jest
npm install
npm run dev        # Start development mode
npm test          # Run tests
npm run build     # Build for production

Ways to Contribute

  • πŸ› Bug Reports: Found an issue? Report it in the issue tracker
  • πŸ’‘ Feature Requests: Have an idea? We'd love to hear it
  • πŸ“ Documentation: Help improve our docs
  • πŸ§ͺ Test Cases: Add tests for edge cases
  • πŸ”§ Code: Submit pull requests

Development Guidelines

  • Follow existing code style
  • Add tests for new features
  • Update documentation
  • Be kind and respectful

πŸ†˜ Troubleshooting

Common Issues

Server won't start?

# Use absolute paths
mcp-jest /usr/bin/node ./server.js

# Check server logs
DEBUG=mcp-jest* mcp-jest node ./server.js

Connection timeout?

# Increase timeout
mcp-jest node ./server.js --timeout 60000

Tool execution fails?

// Add detailed logging
expect: (result) => {
  console.log('Result:', JSON.stringify(result, null, 2));
  return result.success === true;
}

Get Help

  • πŸ“– Full Documentation: Comprehensive guides and examples
  • πŸ’¬ Community Q&A: Join the community discussions
  • πŸ› Issues: Bug reports and feature requests
  • πŸ“§ Email: For private inquiries

πŸ“‹ Requirements

  • Node.js: 18+ (for ESM and modern features)
  • MCP Server: Any server implementing Model Context Protocol
  • Optional: TypeScript 5+ for full type safety

πŸŽ‰ Join the Community

  • ⭐ Show your support: Give us a star
  • 🐦 Follow Updates: Get the latest news
  • πŸ’¬ Join Discussions: Connect with other developers
  • πŸ”„ Share: Help others discover mcp-jest

πŸ“„ License

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

πŸ™ Acknowledgments

  • Anthropic: For creating the Model Context Protocol
  • MCP Community: For building the ecosystem
  • Contributors: Everyone who makes this project better

Built with ❀️ for the MCP ecosystem

Get Started β€’ Documentation β€’ Examples β€’ Contributing

Make your MCP servers bulletproof. Start testing today! πŸš€

Documentation

Comprehensive documentation is available to help you get the most out of mcp-jest:

Contributing

We welcome contributions from the community! Your input helps make mcp-jest better for everyone.

Thank you to all our contributors who have helped shape this project. Every contribution, no matter how small, is valued and appreciated.

  • Contributing Guidelines - Learn how to contribute to the project
  • Code of Conduct - We maintain a welcoming and inclusive environment for all contributors
  • Getting Started - Fork the repo, make your changes, and submit a pull request

We encourage contributions of all kinds:

  • Bug fixes and feature implementations
  • Documentation improvements
  • Test coverage enhancements
  • Performance optimizations
  • Community support and engagement

Security

Security is a top priority for mcp-jest. We take the security of our code and our users seriously.

  • Security Policy - View our security policy and vulnerability reporting process
  • Responsible Disclosure - Please report security vulnerabilities responsibly through our security policy

If you discover a security vulnerability, please follow our responsible disclosure process outlined in the security policy.

License

mcp-jest is released under the MIT License. This means you can use it freely in both commercial and open-source projects.

See the LICENSE file for the full license text.

Support

Need help? We're here to support you:

Before opening an issue, please check if your question has already been answered in the documentation or existing issues.

Keywords

mcp

FAQs

Package last updated on 15 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts