
Comprehensive validation tool for Model Context Protocol (MCP) servers with security analysis and JSON reporting
概览
A comprehensive validation tool for Model Context Protocol (MCP) servers to ensure protocol compliance, security, and proper implementation. - : Tests the complete MCP initialization handshake - : Validates JSON-RPC 2.0 format and required fields - : Verifies advertised capabilities (resources, tools, prompts) - : Integrates with mcp-scan for vulnerability detection - : Ensures servers match their registry schema definitions - : Exports comprehensive JSON reports with validation checklists - : Provides programmatic validation for CI/CD pipelines - ✅ : Complete MCP handshake and capability testing - ✅ : stdio, HTTP, and SSE transports with full OAuth 2.0 support - ✅ : Full OAuth 2.
README
以下为原文 README 节选,完整内容请查看原文。
MCP Validation Tool
A comprehensive validation tool for Model Context Protocol (MCP) servers to ensure protocol compliance, security, and proper implementation.
Goal
This tool validates MCP servers by:
- Protocol Compliance: Tests the complete MCP initialization handshake
- Standard Conformance: Validates JSON-RPC 2.0 format and required fields
- Capability Testing: Verifies advertised capabilities (resources, tools, prompts)
- Security Analysis: Integrates with mcp-scan for vulnerability detection
- Registry Validation: Ensures servers match their registry schema definitions
- Detailed Reporting: Exports comprehensive JSON reports with validation checklists
- Automated Testing: Provides programmatic validation for CI/CD pipelines
Features
- ✅ Protocol Validation: Complete MCP handshake and capability testing
- ✅ Multi-Transport Support: stdio, HTTP, and SSE transports with full OAuth 2.0 support
- ✅ OAuth 2.0 Authentication: Full OAuth 2.0 Dynamic Client Registration (RFC 7591)
- ✅ Automatic Browser Opening: Seamless OAuth authentication flow
- ✅ Security Scanning: Integrated mcp-scan vulnerability analysis
- ✅ JSON Reports: Comprehensive validation reports with linked security scans
- ✅ Step-by-Step Logging: Real-time validation progress with detailed feedback
- ✅ Tool Discovery: Lists all available tools, prompts, and resources
- ✅ Environment Variables: Configurable environment setup
- ✅ Timeout Handling: Configurable validation timeouts
- ✅ Exit Codes: Proper exit codes for automation
- ✅ Verbose Mode: Optional detailed output
Installation
# Clone and install
git clone https://github.com/modelcontextprotocol/mcp-validation
cd mcp-validation
uv sync
Or install directly:
pip install mcp-validation
Usage
Basic Validation
# Validate a Python MCP server (stdio transport)
mcp-validate -- python server.py
# Validate a Node.js MCP server (stdio transport)
mcp-validate -- node server.js
# Validate npx packages (use -- separator for flags)
mcp-validate -- npx -y kubernetes-mcp-server@latest
# Validate servers via container runtime (podman/docker)
mcp-validate -- podman run -i --rm hashicorp/terraform-mcp-server
HTTP Transport Validation
# Validate HTTP MCP servers with OAuth 2.0 Dynamic Client Registration
mcp-validate --transport http --endpoint https://example.com/api/mcp
# With pre-registered OAuth credentials
mcp-validate --transport http --endpoint https://gitlab.com/api/v4/mcp \
--client-id YOUR_CLIENT_ID --client-secret YOUR_CLIENT_SECRET
# With personal access token
mcp-validate --transport http --endpoint https://api.example.com/mcp \
--auth-token YOUR_ACCESS_TOKEN
# Local HTTP server
mcp-validate --transport http --endpoint http://localhost:3000/mcp
SSE Transport Validation
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →