RH

r-huijts/mcp-server-tester

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

10 stars 4 forks 质量 64 趋势 18MIT

Automated testing tool for Model Context Protocol (MCP) servers - WORK IN PROGRESS

概览

: This project is under active development and has not been thoroughly tested yet. Features may be incomplete, contain bugs, or change significantly. Use at your own risk in non-production environments only. A powerful, configuration-driven testing tool for Model Context Protocol (MCP) servers. This project provides a comprehensive solution for validating, benchmarking, and ensuring reliability of MCP servers that integrate with AI models like Claude. This tool is moving toward an alpha release and currently offers: - ✅ Basic configuration framework - ✅ MCP server connection and CLI support - ✅ Test generation using Claude AI - ✅ Natural language query generation for tests - ✅ Comprehensive response validation with multiple rules - ✅ Report generation in console, JSON, HTML, and Markdown formats - 🚧 Broader automated test coverage of the tester - 🚧 Production hardening and packaging improvements If you're interested in contributing, please feel free to open issues and submit pull...

README

以下为原文 README 节选,完整内容请查看原文。

MCP Server Tester

⚠️ WORK IN PROGRESS: This project is under active development and has not been thoroughly tested yet. Features may be incomplete, contain bugs, or change significantly. Use at your own risk in non-production environments only.

A powerful, configuration-driven testing tool for Model Context Protocol (MCP) servers. This project provides a comprehensive solution for validating, benchmarking, and ensuring reliability of MCP servers that integrate with AI models like Claude.

Current Status

This tool is moving toward an alpha release and currently offers:

  • ✅ Basic configuration framework
  • ✅ MCP server connection and CLI support
  • ✅ Test generation using Claude AI
  • ✅ Natural language query generation for tests
  • ✅ Comprehensive response validation with multiple rules
  • ✅ Report generation in console, JSON, HTML, and Markdown formats
  • 🚧 Broader automated test coverage of the tester
  • 🚧 Production hardening and packaging improvements

If you’re interested in contributing, please feel free to open issues and submit pull requests.

Introduction

The Model Context Protocol (MCP) enables AI models to access external tools and data sources through standardized interfaces. As MCP servers grow in complexity and importance, ensuring their correct functionality becomes critical. The MCP Server Tester addresses this need by:

  • Automating tests for all tools exposed by an MCP server
  • Leveraging Claude AI to generate intelligent, contextually-relevant test cases
  • Validating responses against expected outcomes and schemas
  • Providing detailed reports to identify issues and performance bottlenecks

This tool is designed for MCP server developers, AI integration teams, and quality assurance professionals who need to ensure their MCP implementations are robust, reliable, and correctly follow the protocol specifications.

Concept

The Model Context Protocol is a standard that allows AI models to call external tools. An MCP server exposes one or more tools through a simple HTTP interface. Each tool describes its name, parameters, and response schema so that a model can invoke it safely.

mcp-server-tester automates the process of checking that an MCP server and its tools work correctly:

  1. Discovery – it queries the server for all available tools.
  2. Test generation – it uses Claude AI to create realistic test cases for each tool.
  3. Execution – it runs those tests against the server.
  4. Validation – it verifies the responses using configurable rules.
  5. Reporting – it summarizes the results in the console or in JSON, HTML, or Markdown formats.

The goal is to quickly spot mismatches between expected and actual behaviour so that you can fix issues before exposing the tools to production models.

Purpose

  • Reliability – catch bugs or inconsistent behaviour in your MCP server.
  • Regression testing – run the same set of tests whenever the server changes.
在 GitHub 查看完整 README

安装

npx -y @modelcontextprotocol/server-filesystem ./
新手?先看 mcpskill.org 教程 →

配置

{ "numTestsPerTool": 3, "timeoutMs": 10000, "outputFormat": "console", "outputPath": "./reports/results.json", "verbose": false, "mcpServers": { "filesystem": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "./"], "env": { "DEBUG": "true" } }, "github": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "your-github-token-here" } }, "dev-server": { "command": "node", "args": ["/absolute/path/to/your/dev-server.js"], "env": { "DEBUG": "true", "NODE_ENV": "development" } } } }