DevGuard MCP
Provides deterministic debugging tools for FastAPI/Python projects, enabling structured failure reports, code quality checks, and context packing.
README
DevGuard MCP
Serveur MCP (Model Context Protocol) qui booste le débogage backend FastAPI/Python et la qualité de code, pour n'importe quel agent : Cline, Claude Code, Cursor…
L'idée : au lieu de laisser l'agent deviner, on lui donne des outils déterministes qui rapportent des faits structurés (assertions échouées, traceback localisé, etc.).
Les 7 outils (v1 complète)
| Outil | Pilier | Ce qu'il fait |
|---|---|---|
run_pytest |
Runtime | Lance pytest, renvoie échecs structurés (assertion + traceback localisé user vs lib). |
call_endpoint |
Runtime | Frappe un endpoint HTTP ; sur 422, erreurs de validation Pydantic champ par champ. |
get_openapi_schema |
Doc vérifiée | Synthétise /openapi.json : routes, params, modèle de corps (champs + requis), codes réponse. |
parse_traceback |
Runtime | Traceback brut → type, message, frames, cause probable (code utilisateur). |
pack_debug_context |
Contexte | Condense les fichiers d'un bug en un seul document (repomix, multi-langages) : vision holistique instantanée au lieu de longues navigations. |
lint |
Qualité | ruff en JSON : chaque violation avec code de règle + lien doc officielle + auto-fixable. |
log_debug_note |
Mémoire | Note une découverte de debug (anti-boucle) dans .devguard/journal.jsonl. |
get_debug_notes |
Mémoire | Relit les notes du projet (récentes d'abord, filtre par tag). |
Boucle de débogage type
get_debug_notes— repartir de ce qui est déjà connu.run_pytest/call_endpoint— voir l'échec réel (assertion, champ 422).pack_debug_context(error_text=<le traceback>)— condenser les fichiers du bug en un seul document, pour saisir d'un coup comment ils s'articulent.get_openapi_schema— connaître le contrat exact de l'endpoint (si API).- corriger,
lintpour la qualité, re-run_pytestpour valider. log_debug_note— consigner la cause pour la prochaine fois.
pack_debug_contextest agnostique du langage (repomix + tree-sitter) : il marche sur du Python, JS/TS, Go, Java… même si les autres outils ciblent Python.
Forcer le "pack avant debug" (règle harness, pas MCP)
Un MCP ne peut pas forcer l'agent. Pour que le pack soit systématique, ajoute une
règle côté client, ex. dans les règles Cline / CLAUDE.md :
« Avant de déboguer un problème touchant plusieurs fichiers, appelle d'abord
pack_debug_contextavec le traceback pour obtenir une vue consolidée. »
Installation (dev)
cd devguard-mcp
uv sync
uv run pytest # tests du MCP lui-même
Brancher dans Cline
Dans les réglages MCP de Cline (cline_mcp_settings.json) :
{
"mcpServers": {
"devguard": {
"command": "uv",
"args": ["--directory", "D:/mcp/devguard-mcp", "run", "devguard-mcp"]
}
}
}
Puis l'agent peut appeler run_pytest(project_dir="D:/mon-projet-fastapi").
Brancher dans Claude Code
claude mcp add devguard -- uv --directory D:/mcp/devguard-mcp run devguard-mcp
Architecture
src/devguard/
server.py entrypoint MCP (enregistre les 7 outils)
models.py contrats Pydantic (retours structurés stricts)
core/
process.py exécution sous-process robuste (timeout, utf-8)
parsing.py parsers traceback + JUnit XML pytest
tools/
debug.py run_pytest
api.py call_endpoint + get_openapi_schema
quality.py lint (ruff)
context.py pack_debug_context (repomix)
memory.py journal de débogage
Prérequis
- Python ≥ 3.11,
uv. - Node +
repomix(npm i -g repomix) pourpack_debug_context.
Développement
uv sync --extra dev
uv run pytest # 25 tests
uv run python -m ruff check src/
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.