InseeFrLab / InseeFrLab/McpDiffusion

Mise en place d'une clean archi simple sur le projet

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1
Forks
0
Avg merge
10m
Merged PRs (30d)
3

Description

# 🏗️ Refactor MCP Application vers Clean Architecture

## 📋 Contexte
L'application MCP actuelle mélange logique métier, accès aux données, intégration SDK et définition des tools. Cette forte dépendance croisée rend les tests unitaires complexes, freine l'évolutivité et complique l'intégration de nouvelles fonctionnalités (auth, rate limiting, monitoring, etc.). Nous proposons de refactorer le code pour suivre les principes de la Clean Architecture : **séparation des responsabilités, inversibilité des dépendances et testabilité maximale de la logique métier**.

## 🎯 Objectifs
- Séparer clairement les préoccupations : `Endpoints/Tools` (interface MCP), `Services` (logique métier), `Infrastructure` (DB, clients externes, wiring MCP)
- Rendre la logique métier **framework-agnostic** (indépendante de FastAPI, MCP SDK, SQLAlchemy, etc.)
- Faciliter les tests unitaires et d'intégration via des interfaces (ports/adapters)
- Préparer l'évolution future (authentification, multi-tenancy, nouveaux tools) sans casser les couches existantes

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting the current application structure and locating the MCP tools, services, infrastructure, database and external-client integrations, and wiring described in the issue. Define boundaries and interfaces that separate framework-agnostic business logic from FastAPI, MCP SDK, and SQLAlchemy; done means the responsibilities are separated and the business logic can be unit-tested independently.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.