MCP Test Server
A comprehensive Model Context Protocol (MCP) server designed specifically for testing MCP scanners and validating MCP implementations. This server provides a rich set of tools, resources, and prompts to exercise various aspects of the MCP specification.
π Scanner Compatible: This repository is fully configured to be detected by the APIsec MCP Audit Scanner.
β‘ Quick Start: Want to test scanner detection immediately? See QUICK_START.md
Scanner Detection Documentation
QUICK_START.md - Get scanned in 10 minutes
SCANNER_GUIDE.md - Detailed detection guide
SCANNER_CHECKLIST.md - Verification checklist
Features
π οΈ Tools
The server exposes multiple tools with varying complexity levels:
echo - Basic string echo for testing simple parameter handling
add_numbers - Numeric operations testing
format_json - JSON object handling and formatting
list_operations - Array/list manipulation (sort, reverse, count, join)
complex_schema - Nested object schemas with various types
timestamp - Tools with optional parameters only
π¦ Resources
Multiple resource types for testing resource discovery and reading:
static-text - Plain text resource
json-data - Structured JSON data
markdown-doc - Formatted markdown documentation
config - Configuration file example
π¬ Prompts
Sample prompts to test prompt capabilities:
test-prompt - Basic prompt with required argument
debug-prompt - Multi-argument prompt with optional parameters
Installation
From Source
Development Installation
Usage
Running the Server
Command Line
After installation, run the server directly:
Python Module
Alternatively, run as a Python module:
Testing with MCP Client
The server uses stdio transport, so you can test it with any MCP-compatible client:
Configuration for MCP Clients
Add to your MCP client configuration (e.g., Claude Desktop config):
Or with explicit Python path:
Testing MCP Scanners
This server is ideal for testing MCP scanner tools because it provides:
Diverse Tool Schemas - From simple strings to complex nested objects
Multiple Resource Types - Different MIME types and content structures
Edge Cases - Tools with no required parameters, optional fields, enums
Standard Compliance - Follows MCP specification strictly
Scanner Detection - Multiple configuration files for detection testing
Scanner Detection
This repository is configured to be detected by MCP scanner tools like the APIsec MCP Audit Scanner.
Detection files included:
mcp.json- Claude Desktop style configurationmcp.yaml- YAML format configuration.mcp/config.json- Hidden directory configpackage.json- npm dependencies with@modelcontextprotocol/sdkrequirements.txt- Python dependencies withmodelcontextprotocol
π See for detailed scanner testing instructions.
Scanner Test Checklist
Discovers all 6 tools
Parses complex nested schemas correctly
Identifies all 4 resources with correct URIs
Handles tools with optional-only parameters
Recognizes prompt capabilities
Correctly interprets enum constraints
Handles array and object types
Project Structure
Requirements
Python 3.10 or higher
mcp >= 0.9.0
Development
Running Tests
Code Style
This project follows PEP 8 guidelines. Format code with:
API Reference
Tools
echo
Input:
message(string, required)Output: Echoes the input message
Purpose: Test basic string parameter handling
add_numbers
Input:
a(number),b(number)Output: Sum of the two numbers
Purpose: Test numeric parameter handling
format_json
Input:
data(object),indent(number, default: 2)Output: Formatted JSON string
Purpose: Test object parameter handling
list_operations
Input:
items(array),operation(enum),separator(string, optional)Output: Result of list operation
Purpose: Test array handling and enum constraints
complex_schema
Input: Nested object with user info and options
Output: Processed data structure
Purpose: Test complex nested schema parsing
timestamp
Input:
format(enum, optional)Output: Current timestamp in specified format
Purpose: Test tools with all-optional parameters
Resources
All resources use URIs in the format mcp://test/{resource-name}:
mcp://test/static-text- Plain text contentmcp://test/json-data- Structured JSONmcp://test/markdown-doc- Markdown documentationmcp://test/config- Configuration data
Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
License
MIT License - see LICENSE file for details
Support
For issues, questions, or contributions, please open an issue on the repository.
Changelog
v0.1.0 (Initial Release)
Basic MCP server implementation
6 diverse tools for testing
4 resource types
2 sample prompts
Complete documentation
Related Projects
Note: This is a testing server. Do not use in production environments.