Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

🧪 MCP Testing

AI-powered testing framework for MCP servers

Test your MCP servers with real AI agents conducting conversations and LLM judges evaluating results

Documentation License PRs Welcome PyPI Python

Why MCP Testing?

Traditional testing doesn't work for MCP servers. You can't write unit tests for natural language interactions. MCP Testing solves this with:

  • 🤖 Real AI Agents - Claude and ChatGPT actually use your MCP server
  • 👤 User Simulation - AI simulates realistic multi-turn user behavior
  • ⚖️ LLM-as-a-Judge - Intelligent evaluation instead of brittle assertions
  • 🎭 Comprehensive Testing - Security, compliance and performace all in one framework
  • 🔌 Multiple Transports - Supports HTTP and stdio servers

Quick Start

Get testing in 3 steps:

  1. Install & Setup

    pip install mcp-testing
    export ANTHROPIC_API_KEY="sk-ant-..."  # For AI agents
    export OPENAI_API_KEY="sk-..."         # For LLM judge
    
  2. Interactive Onboarding

    mcp-t quickstart  # Creates your first server & test suite
    
  3. Run Tests

    mcp-t run <suite-id> <server-id>
    # Example: mcp-t run example_suite_001 hackernews_mcp_server
    

Core Concepts

Test Flow

Your Test Case → AI Agent (Claude/GPT-4) → Your MCP Server
      ↓                    ↓                      ↓
 User Message         Tool Calls            Server Response
      ↓                    ↓                      ↓
User Simulator      Conversation Loop         More Tools
      ↓                    ↓                      ↓
   LLM Judge       Complete Transcript      Pass/Fail + Reasoning

Configuration Files

Server Config - HTTP (examples/server.json):

{
  "name": "linear_mcp_server",
  "transport": "http",
  "url": "https://mcp.linear.app/mcp"
}

Server Config - stdio (examples/servers/time-server-stdio.json):

{
  "name": "Time Server",
  "transport": "stdio",
  "command": "npx -y @modelcontextprotocol/server-time"
}

Server Config - stdio with env (examples/servers/brave-search-stdio.json):

{
  "name": "Brave Search",
  "transport": "stdio",
  "command": "npx -y @modelcontextprotocol/server-brave-search",
  "env": {
    "BRAVE_API_KEY": "your-api-key-here"
  }
}

Test Suite (examples/suite.json):

{
  "suite_id": "example_suite_001",
  "name": "Hacker News MCP Server Tests",
  "test_cases": [
    {
      "test_id": "hackernews_greeting",
      "user_message": "Hello! Can you help me browse Hacker News?",
      "success_criteria": "Agent should respond politely and explain Hacker News capabilities",
      "max_turns": 5
    }
  ]
}

Test Types

  • 💬 Conversational - Real user workflows
  • 🔒 Security - Authentication & vulnerabilities
  • ✅ Compliance - MCP protocol validation

Commands

Test Execution

mcp-t run <suite-id> <server-id>           # Run specific suite
mcp-t run example_suite_001 hackernews_mcp_server -v   # Verbose output

Configuration Management

mcp-t quickstart                 # Complete onboarding
mcp-t create server              # Interactive server setup
mcp-t create suite               # Create test suite
mcp-t create test-case           # Add test to suite
mcp-t list                       # Show all configs
mcp-t show suite example_suite_001   # View specific config

Test Generation

Run wizard that analyzes your MCP server and automatically generates comprehensive test cases

mcp-t generate

Test Results

Understanding Evaluation

{
  "test_id": "hackernews_stories",
  "verdict": "PASS",
  "confidence_score": 0.89,
  "judge_reasoning": "The agent successfully fetched and displayed Hacker News stories. Good use of available tools and clear presentation of results.",
  "conversation_quality": 0.87,
  "tool_calls": [
    { "tool": "get_top_stories", "args": {} },
    { "tool": "get_story_details", "args": { "story_id": 123 } }
  ]
}

Support


Built with ❤️ for the MCP ecosystem

Made in San Francisco, CA

Release files for mcp-testing 0.1.0b4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-testing 0.1.0b4
File Size Uploaded
mcp_testing-0.1.0b4.tar.gz 148.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-testing 0.1.0b4
File Interpreter ABI Platform
mcp_testing-0.1.0b4-py3-none-any.whl Python 3 none any Details

Total release size: 321.3 kB

Release files / mcp_testing-0.1.0b4.tar.gz

Download URL mcp_testing-0.1.0b4.tar.gz
Size 148.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8fa48b624917222c7d87175e4b71d50566f907df8a6b6a4a5a971c12260f2ecb
BLAKE2b-256 checksum
How to use checksums
8bd6c3a7419f0834b1405761de1c1c4106ba67851171df04c4f80da5f51ae6cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Release files / mcp_testing-0.1.0b4-py3-none-any.whl

Download URL mcp_testing-0.1.0b4-py3-none-any.whl
Size 173.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
69ee39861d706eb4817fc28a66fa0c927bff08fd570e237620d19e537e262e7e
BLAKE2b-256 checksum
How to use checksums
6cfd9cf354672726d1c9df6835dfd67bdda76a7787442f932279a7f2b752abc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page