npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cisco_open/mcptoolkit-test

v1.0.0

Published

Automated testing framework for Model Context Protocol (MCP) servers

Readme

MCP Toolkit: Test Servers

Test MCP servers with declarative YAML scenarios auto-generated from MCP Descriptions (mcpdesc files).

You may use mcptest for:

  • Validation: Verify your MCP server responds correctly to all tool calls
  • Regression detection: Record golden files and catch unintended changes automatically
  • CI/CD integration: Export execution logs for fast mock-based testing with mcpmock

License: Apache-2.0 Status: pre-release Node.js: >=20.x mcpdesc

⚠️ Pre-release notice: the mcptest CLI is functional but has seen limited real-world testing compared to other MCP Toolkit tools. Core workflows (generate, run, record) have been validated against the chess-coach example server; broader compatibility and edge cases are still being hardened. Feedback and bug reports are welcome.

Features

  • ✅ Auto-generate test scenarios from mcpdesc files (zero manual work)
  • ✅ AI-assisted scenario generation with GitHub Copilot
  • ✅ Golden file regression detection with fuzzy matching (timestamps, UUIDs, IDs)
  • ✅ Export execution logs for mock integration and fast CI/CD
  • ✅ Supports stdio and streamable-http transports (legacy SSE supported)
  • ✅ Three coverage strategies: basic, full, edge-cases

Quick Start

npm install -g @cisco_open/mcptoolkit-test

# Generate test scenarios from your server description
mcptest generate --mcpdesc server.mcpdesc.json --output scenarios/ --coverage full

# Run tests against your server
mcptest run --scenarios scenarios/ --server http://localhost:8000

For a complete walkthrough, see Tutorial: Chess Coach.

Installation

npm install -g @cisco_open/mcptoolkit-test

# Verify
mcptest --help

For development / local builds:

git clone https://github.com/cisco-open/mcptoolkit-test.git
cd mcptoolkit-test
npm install && npm run build && npm link

Workflows

1. Generate Test Scenarios

Auto-generate a complete test suite from an mcpdesc file:

mcptest generate \
  --mcpdesc server.mcpdesc.json \
  --output scenarios/ \
  --coverage full

Or use GitHub Copilot for AI-assisted generation:

# Generate a Copilot prompt auto-configured for your project
mcptest schema --copilot-prompt

Paste the output into GitHub Copilot chat — it reads your mcpdesc and generates realistic scenarios with proper assertions for all tools.

👉 Tutorial: Chess Coach

2. Run Tests

Execute scenarios against your MCP server:

# HTTP server
mcptest run --scenarios scenarios/ --server http://localhost:8000

# Stdio server with environment variables
mcptest run \
  --scenarios scenarios/ \
  --server stdio:///path/to/python?args=-m,my_mcp_server \
  --env DATABASE_PATH=/path/to/db

Results show pass/fail with timing and detailed failure context:

Test Results: 3/4 passed (75%)

✓ query_games - basic test (9ms)
✓ query_games - with filters (7ms)
✓ detect_themes - basic test (647ms)
✗ get_statistics - basic test (FAILED)
  Tool: get_statistics
  Error: Parameter validation failed

3. Record & Detect Regressions

Capture baseline responses, then compare on every run:

# Record baselines
mcptest record \
  --scenarios scenarios/ \
  --server http://localhost:8000 \
  --golden golden/

# Run with regression detection
mcptest run \
  --scenarios scenarios/ \
  --server http://localhost:8000 \
  --golden golden/

Golden files automatically normalize non-deterministic values during comparison: ISO-8601 timestamps → <TIMESTAMP>, UUIDs → <UUID>, and id-like properties (e.g. id, sessionId, user_id) → <ID>. To ignore additional volatile fields, pass their names to --fuzzy-match when recording (e.g. --fuzzy-match createdAt,requestId); those fields are then ignored by name wherever they appear in the response, including nested objects and arrays. Use --incremental to skip re-recording unchanged scenarios.

👉 Execution Logs Workflow

CLI Commands

mcptest generate — Auto-Generate Scenarios

mcptest generate --mcpdesc <path> --output <path> [options]

Options:
  -d, --mcpdesc <path>       mcpdesc file (JSON or YAML)
  -o, --output <path>        Output directory for scenarios
  -c, --coverage <strategy>  basic | full | edge-cases  (default: basic)
  -m, --merge                Preserve existing manual tests
  -v, --verbose              Detailed logging

mcptest run — Execute Tests

mcptest run --scenarios <path> --server <url> [options]

Options:
  -s, --scenarios <path>   Scenario file or directory
  -S, --server <url>       MCP server URL
  -g, --golden <path>      Golden files directory (enables regression detection)
  -t, --transport <type>   Transport type (auto-detected from URL)
  -e, --env <KEY=VALUE>    Environment variables (repeatable)
  -v, --verbose            Detailed logging
  --pretty                 Pretty-print JSON output

mcptest record — Record Golden Files

mcptest record --scenarios <path> --server <url> --golden <path> [options]

Options:
  -s, --scenarios <path>   Scenario file or directory
  -S, --server <url>       MCP server URL
  -g, --golden <path>      Golden files directory
  --export <path>          Export execution log for mcpmock integration
  -i, --incremental        Skip existing golden files
  --fuzzy-match <fields>   Comma-separated field names to ignore during
                           comparison (e.g. createdAt,requestId); the built-in
                           timestamp / UUID / id rules always apply
  -e, --env <KEY=VALUE>    Environment variables (repeatable)
  -v, --verbose            Detailed logging

mcptest validate — Validate Scenarios

mcptest validate --scenarios <path> [--verbose]

mcptest merge-logs — Merge Execution Logs

mcptest merge-logs --old <path> --new <path> --output <path> [--verbose]

mcptest schema — Show Schema and Examples

mcptest schema [--json] [--examples] [--ai-guide] [--copilot-prompt]

mcptest completion — Shell Completion

eval "$(mcptest completion bash)"   # Bash — add to ~/.bashrc for persistence

mcptest agents — Developer Reference

mcptest agents [--workflow] [--copilot] [--full]

Scenario Format

Scenarios are YAML files:

name: "tool_name - test description"
description: "What this test validates"
tools:
  - name: "tool_name"
    arguments:
      param1: value1
    assertions:
      - type: "response-type"
        expected: "string"
      - type: "contains-text"
        expected: "expected text"

Available assertion types: response-type, contains-text, error, error-code, array-length, array-length-max, golden-file

Note: MCP servers return TextContent (strings), not direct JSON. Use response-type: "string" for tool responses.

mcptest schema --examples   # See full examples

Supported Transports

| Transport | URL pattern | Notes | |---|---|---| | Streamable HTTP | http://... or https://... | Modern MCP servers | | Stdio | stdio:///path/to/bin?args=... | Local command-line servers | | SSE | sse://... | Legacy, still supported |

Troubleshooting

Scenarios fail to validate:

mcptest validate --scenarios scenarios/ --verbose

Connection issues with stdio server:

# Verify the server starts correctly
mcptest run --scenarios scenarios/ --server stdio:///path/to/server --verbose

Golden file mismatches after expected changes:

# Re-record only changed scenarios
mcptest record --scenarios scenarios/ --server http://localhost:8000 --golden golden/ --incremental

Development

npm install           # Install dependencies
npm run build         # Build TypeScript
npm run watch         # Watch mode
npm test              # Run tests
npm run test:watch    # Watch mode for tests
npm run test:coverage # Coverage report

Related Projects

License

This software is licensed under the Apache License 2.0. See LICENSE for details.