Debug Companion MCP
Enables AI coding agents to debug Python projects by running pytest, extracting failure locations, displaying code context around failures, and optionally requesting fix suggestions from Gemini.
README
Debug Companion MCP (Pytest Debugging Agent)
A local MCP server that helps an AI coding agent debug Python projects by:
- Running pytest safely via subprocess
- Extracting failure locations (file:line)
- Opening code context around the failure
- (Optional) Asking Gemini for a fix suggestion
Requirements
- Python 3.12+
- uv
Install
uv sync
Run the MCP server
uv run python server.py
Available tools
ping— health checkrun_pytest(target, max_output_lines, timeout_seconds)— run pytest safelyextract_failures(pytest_output, limit, base_dir)— parsefile.py:line:from pytest outputopen_context(path, line, radius, base_dir)— return a code window around a linedebug_project(target, ...)— orchestrates:run_pytest → extract_failures → open_context → (optional) Gemini analysis
Recommended demo flow
- Run
debug_projectondemo_project(intentionally contains a failing test). - Observe: extracted
file:line+ code context window. - Apply the suggested fix (or a one-line fix manually).
- Re-run → tests pass.
Environment variables
GEMINI_API_KEY— enable Gemini analysis (optional)MCP_ALLOWED_ROOTS— allow access to absolute paths outside the server root (optional)
CI
GitHub Actions runs server tests on each push/PR:
- workflow:
.github/workflows/tests.yml
Notes
demo_projectis intended for demonstration and may contain a deliberate failing test.- Server tests live under
tests/.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.