pytest-mcp-server
Provides tools for registering, analyzing, and debugging pytest test failures, including systematic debugging principles, failure pattern analysis, and debug prompt generation.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@pytest-mcp-serverRegister a new pytest failure for the login test"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Pytest MCP Server
A Model Context Protocol (MCP) server for debugging pytest failures using systematic debugging principles.
โ Status: Production Ready
This MCP server is fully functional and ready for use. All 8 tools work correctly with proper error handling and response formatting that complies with the official MCP specification.
Related MCP server: qa-toolkit-mcp
๐งช Testing Status
โ Server Functionality: Perfect
All tools work correctly with valid inputs
Proper error handling for invalid inputs
Compliant with MCP error reporting standards
Successfully tested with direct JSON-RPC calls
Compatible with MCP Inspector and real MCP clients
โ ๏ธ Framework Testing Limitation: Known Issue
MCP Testing Framework shows 1 validation error due to a bug in mcp-framework 0.2.13
Root Cause: mcp-framework returns validation errors with
"type": "error"instead of MCP-compliant"type": "text"Impact: Testing framework validation fails, but server works perfectly in real usage
Status: Documented issue, affects testing only, not production functionality
This is a known pattern documented in the official Standardized Error Reporting Formats for Model Context Protocol Servers document regarding SDK implementation challenges.
๐ Tools Available
register_pytest_failure - Register a new test failure
list_failures - List all registered failures
get_failure_info - Get detailed information about a specific failure
debug_with_principle - Apply debugging principles systematically
analyze_failures - Analyze patterns in test failures
generate_debug_prompt - Generate LLM prompts for debugging
pytest_docs_guide - Get pytest documentation guidance
example_tool - Example tool for testing
๐ Quick Start
Installation
npm install -g pytest-mcp-serverUsage with Claude Desktop
Add to your Claude Desktop MCP configuration:
{
"mcpServers": {
"pytest-mcp-server": {
"command": "pytest-mcp-server",
"args": ["start"],
"env": {
"DATA_DIR": "./pytest-data"
}
}
}
}Usage as HTTP Server
# Start HTTP server on port 3001
pytest-mcp-server start-http
# Or specify custom port
PORT=8080 pytest-mcp-server start-httpDirect Usage
# Start MCP server (stdio mode)
pytest-mcp-server start
# Test with MCP Inspector
npx @modelcontextprotocol/inspector pytest-mcp-server start๐ Example Usage
1. Register a Test Failure
{
"name": "register_pytest_failure",
"arguments": {
"test_name": "test_user_authentication",
"file_path": "/tests/test_auth.py",
"line_number": 45,
"error_message": "AssertionError: Expected status 200, got 401",
"traceback": "Full traceback here..."
}
}2. Apply Debugging Principles
{
"name": "debug_with_principle",
"arguments": {
"failure_id": "1234567890",
"principle_number": 1,
"analysis": "This test is checking user authentication flow. The system expects a valid JWT token but seems to be receiving an invalid or expired token."
}
}3. Get Failure Analytics
{
"name": "analyze_failures",
"arguments": {
"analysis_type": "patterns"
}
}๐ง Development
Prerequisites
Node.js 18.19.0 or higher
npm or yarn
Setup
# Clone the repository
git clone <repository-url>
cd pytest-mcp-server
# Install dependencies
npm install
# Build the project
npm run build
# Start development server
npm run watchTesting
# Test with simple script
./test-simple.sh
# Test with MCP Testing Framework (shows known validation issue)
mcp-test --test-config mcp-test-config.json --test-mcp-servers
# Test with Dagger (containerized testing)
./test-dagger-simple.sh๐ Data Storage
The server stores data in JSON files:
failures.json- Test failure recordsdebug_sessions.json- Debugging session data
Default location: ./data/ (configurable via DATA_DIR environment variable)
๐ Known Issues
MCP Framework Validation Error
Issue: mcp-framework 0.2.13 returns validation errors with non-compliant
"type": "error"Expected: MCP specification requires
"type": "text"for all error contentImpact: MCP Testing Framework validation fails (false negative)
Workaround: Use direct testing or MCP Inspector for validation
Status: Reported to framework maintainers
See framework-issue-report.md for detailed technical analysis.
๐ค Contributing
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.
๐ Related
Note: This server is production-ready and fully functional. The testing framework validation issue is a known limitation of the current mcp-framework implementation and does not affect real-world usage.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityAmaintenanceAn MCP server for running Playwright tests and reading structured results, failed test details, and attachment content, designed for AI agents doing test failure analysis.5130MIT
- AlicenseAqualityCmaintenanceAn MCP server that reads test reports and provides regression analysis tools for comparing runs, identifying regressions, fixes, and persistent failures.3MIT
- AlicenseNot gradedqualityBmaintenanceMCP server for hunting bugs in Python functions via adversarial input generation and minimized regression tests.MIT
- AlicenseNot gradedqualityBmaintenanceThis MCP server enables automated maintenance and code analysis for Python/pytest repositories in isolated Docker environments. It supports read-only investigations, fix-and-verify tasks, and provides full audit trails with SQLite event history and artifact exports.MIT
Related MCP Connectors
Official MCP server for Qase โ manage test cases, runs, suites, defects via AI tools.
MCP server for the Fail Modes taxonomy โ a knowledge base of AI system failure modes
Remote MCP for A2A failure replay MCP, structured receipts, audit logs, and reviewer-ready evidence.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/tosin2013/pytest-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server