Skip to content

feat: Split MCP into Query and File servers, add tests, configure Tesseract French (BRIC-10)#12

Merged
Kaiohz merged 4 commits intomainfrom
BRIC-10/split-mcp-add-tests
Apr 12, 2026
Merged

feat: Split MCP into Query and File servers, add tests, configure Tesseract French (BRIC-10)#12
Kaiohz merged 4 commits intomainfrom
BRIC-10/split-mcp-add-tests

Conversation

@Kaiohz
Copy link
Copy Markdown
Collaborator

@Kaiohz Kaiohz commented Apr 11, 2026

Summary

  • Split single mcp_tools.py into two separate MCP servers:
    • RAGAnythingQuery at /rag/mcpquery_knowledge_base, query_knowledge_base_multimodal
    • RAGAnythingFiles at /files/mcplist_files, read_file
  • Remove stdio transport support (streamable HTTP only), remove MCP_TRANSPORT config field
  • Add tesseract-ocr-fra to Dockerfile for French OCR support
  • Replace print() with logger.debug() in kreuzberg_adapter
  • Add ~85 new tests covering MCP tools, MinioAdapter, LightRAG multimodal, config properties, indexing request validators

Test Results

  • 216 tests passing, 0 failures
  • Coverage: 82% → 90%
  • QA: 28/28 integration tests, 8/8 acceptance criteria verified
  • SonarQube: 0 new issues
  • Trivy: 0 critical/high findings
  • Linter: ruff check + format clean

DO NOT MERGE

Per user request, this PR should not be merged yet.

Jira

BRIC-10

Kaiohz added 4 commits April 11, 2026 10:11
…seract French (BRIC-10)

- Split mcp_tools.py into mcp_query_tools.py (RAGAnythingQuery at /rag/mcp)
  and mcp_file_tools.py (RAGAnythingFiles at /files/mcp)
- Remove stdio transport (streamable HTTP only)
- Remove MCP_TRANSPORT config field
- Add tesseract-ocr-fra to Dockerfile for French OCR
- Replace print() with logger.debug() in kreuzberg_adapter
- Add ~85 new tests covering MCP tools, MinioAdapter, LightRAG multimodal,
  config properties, and indexing request validators
- Coverage: 82% → 90%, 216 tests passing
@Kaiohz
Copy link
Copy Markdown
Collaborator Author

Kaiohz commented Apr 12, 2026

📊 Code Confidence Score: 8/10

✅ Points positifs

  • Architecture hexagonale respectée : nouveau port StoragePort.list_folders() + PostgresHealthPort, use cases séparés (ListFoldersUseCase, LivenessCheckUseCase), adapters MinIO et asyncpg
  • Séparation MCP propre : mcp_query_tools.py (Query) / mcp_file_tools.py (File) — chaque serveur MCP a sa responsabilité
  • ~1500 lignes de tests (9 fichiers) : mcp_query (379l), minio (321l), lightrag multimodal (252l), health liveness (205l), mcp_file (177l), config (106l), list_folders (34l), file_routes (76l), requests indexing (65l)
  • Liveness probe GET /health/live checke Postgres + MinIO
  • MCP_TRANSPORT supprimé — streamable HTTP uniquement, simplifie la config
  • tesseract-ocr-fra ajouté au Dockerfile

⚠️ Points d'attention

  • kreuzberg_adapter.py : ExtractionConfig en dur au niveau module (_KREUZBERG_CONFIG) — pas injectable, difficile à tester avec d'autres configs
  • Pas de validation sur prefix dans list_folders — énumération de buckets possible si utilisateur malveillant
  • .DS_Store dans le diff — à retirer du commit

🔴 Risques identifiés

  • Aucun test d'intégration pour les endpoints MCP montés sur FastAPI (les tests unitaires mockent les use cases, mais personne ne teste que les routes MCP sont bien montées et répondent)

Recommandation

Merger après avoir retiré le .DS_Store et idéalement ajouté une validation sur le paramètre prefix.


Review automatique par SoluBot 🤖

@Kaiohz Kaiohz merged commit a147b8e into main Apr 12, 2026
1 check passed
@Kaiohz
Copy link
Copy Markdown
Collaborator Author

Kaiohz commented Apr 13, 2026

🟢 Code Review — BRIC-10: Split MCP into Query & File servers

✅ Points positifs

  • Architecture hexagonale respectée : mcp_query_tools.py + mcp_file_tools.py bien séparés
  • ~85 nouveaux tests, couverture 82% → 90%
  • Liveness probe /health/live vérifie Postgres + MinIO
  • tesseract-ocr-fra dans Dockerfile pour OCR français
  • Validation path traversal sur read_file
  • Error handling propre : 404/422
  • Suppression du transport stdio (streamable HTTP only) = simplification
  • ListFoldersUseCase ajouté pour les prefixes de buckets

⚠️ Points d'attention

  1. kreuzberg_adapter.py : ExtractionConfig hardcodé au niveau module (_KREUZBERG_CONFIG) — pas injectable, difficile à tester avec d'autres configs
  2. Pas de validation prefix dans list_folders — risque d'énumération si un utilisateur malveillant envoie des prefixes wildcards

🔴 Risques

  • Pas de tests d'intégration pour les nouveaux endpoints MCP montés sur FastAPI

Score de confiance : 8/10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant