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

@ricker-np/mcptest

v0.1.0

Published

Zero-config test runner for MCP servers

Readme

mcptest

npm version License: MIT

Zero-config test runner for MCP (Model Context Protocol) servers


Features

  • Zero configuration — auto-detects your MCP server from package.json or mcptest.config.ts
  • Protocol compliance testing — validates conformance to MCP spec 2025-06-18
  • Schema validation — checks inputSchema of every tool against JSON Schema
  • JUnit XML output — drop-in CI/CD integration with --reporter junit
  • SSE transport support — test servers over stdio or Server-Sent Events
  • Fast startup — cold start under 500ms

Installation

# Global install
npm install -g mcptest

# Or use directly with npx
npx mcptest run

Quick Start

Step 1: Install mcptest in your MCP server project

cd my-mcp-server
npm install --save-dev mcptest

Step 2: Run mcptest

npx mcptest run

Step 3: mcptest auto-detects your server and runs tests

mcptest reads your package.json to find the server entry point, connects via stdio, and automatically generates and runs protocol compliance tests for every tool your server exposes.

mcptest v0.1.0
Auto-detected server: node dist/index.js (stdio)

  initialize            PASS
  tools/list            PASS
  tools/call: add       PASS
  tools/call: subtract  PASS
  Schema: add           PASS
  Schema: subtract      PASS

  6 passed  0 failed  (312ms)

Step 4: Fix any FAIL results

Each failure includes a clear message explaining what went wrong and how to fix it:

  tools/call: divide    FAIL
  Error: Tool response missing required field "content"
  Expected: { content: [...] }
  Received: { result: 0 }

Step 5: Integrate with CI/CD

Add JUnit XML output for test result tracking in your pipeline:

npx mcptest run --reporter junit --output test-results.xml

Commands

mcptest run [options]

Run protocol compliance and schema tests against your MCP server.

| Option | Default | Description | |--------|---------|-------------| | --server <cmd> | auto-detect | Server launch command (e.g. node dist/index.js) | | --transport <type> | stdio | Transport type: stdio or sse | | --url <url> | — | SSE server URL (required when --transport sse) | | --timeout <ms> | 30000 | Per-test timeout in milliseconds | | --reporter <type> | default | Output format: default or junit | | --output <file> | — | Write report to file (requires --reporter junit) | | --mode <mode> | conservative | Test generation mode: conservative or strict |

mcptest validate [target] [options]

Validate tool inputSchema definitions without running a live server.

| Option | Default | Description | |--------|---------|-------------| | [target] | . | Path to MCP server source or built file | | --strict | false | Fail on warnings as well as errors |

mcptest init [options]

Initialize a mcptest.config.ts configuration file in the current directory.

| Option | Default | Description | |--------|---------|-------------| | --transport <type> | stdio | Pre-fill transport type in generated config |


Configuration

Create mcptest.config.ts in your project root to override defaults:

import type { McptestConfig } from 'mcptest';

export default {
  server: 'node dist/index.js',
  transport: 'stdio',
  timeout: 30000,
  mode: 'conservative',
} satisfies Partial<McptestConfig>;

Configuration file is optional — mcptest works without one by auto-detecting your server.


CI/CD Integration

GitHub Actions

name: MCP Protocol Tests

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
      - run: npm ci
      - run: npm run build
      - run: npx mcptest run --reporter junit --output test-results.xml
      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: test-results
          path: test-results.xml

The JUnit XML output is compatible with GitHub Actions test reporting, Jenkins, GitLab CI, and most other CI systems.


License

MIT — see LICENSE for details.