Skip to main content
Glama
IDRIMalek

Smart-MCP

by IDRIMalek

Smart MCP Pipeline

🎯 Le dĂ©fi

Utiliser un petit modĂšle local (9B) sur un GPU grand public (RTX 3060 12Go) pour gĂ©nĂ©rer automatiquement des diagrammes draw.io complexes — tableaux, kanbans, GANTT, formes — une tĂąche oĂč mĂȘme de gros modĂšles cloud Ă©chouent.

Related MCP server: Excalidraw Architect MCP

🧠 L'approche

  • RAG (ChromaDB) : 26+ patterns de diagrammes stockĂ©s et rĂ©injectĂ©s dans le prompt

  • Classification macro : FORME/TABLEAU/KANBAN/GANTT/AGENDA/TEXTE → spĂ©cialisation du prompt

  • ModĂšle local : qwen3.5:9b-hermes (65536 tokens contexte, entiĂšrement sur GPU)

  • CoĂ»t : 0€ (pas d'API cloud)

📊 Dashboard temps rĂ©el

🚀 http://192.168.1.100:8050
  • Auto-refresh 3s avec tendances et graphiques

  • Toggle AUTO/MANUEL : mode auto = batchs de tests, mode manuel = exĂ©cution live du pipeline

  • Filtres : source, macro, status, modĂšle — tous les rĂ©sultats historiques visibles

  • Diagrammes persistants : liens cliquables → ouvrir direct dans draw.io (GitHub)

  • Vue ChromaDB : patterns, types, stats en haut du dashboard

📐 Diagramme persistant F1-F17

Le diagramme complet de l'architecture Smart MCP est versionné dans le repo :

  • 13 pages : Vue Macro, Pipeline, Infrastructure, Workflows, Benchmarks, Carte SystĂ©mique, Architecture LLM, Optimisation, Kanban, Test, Banc de Test (F16), AmĂ©lioration Continue (F17)

đŸ§Ș RĂ©sultats

Métrique

Smart MCP (9B local)

Coût

0€ / mois

Tests CI

214 ✅ local / 208 ✅ CI

Tableaux

✅ 100%

Kanbans

✅ 90%

Formes

✅ 100%

Temps moyen

5-15s

Contexte

65536 tokens

VRAM

6.6 GB

🏗 Architecture

User Prompt → Classifier (LLM) → RAG ChromaDB (26 patterns)
                                    ↓
                              LLM local (9B) → XML draw.io → Dashboard
                                    ↓
                              Test Runner (214 tests) → CI/CD GitHub Actions

🚀 DĂ©marrage rapide

# 1. Installer les dépendances
pip install -r requirements.txt

# 2. Seeder ChromaDB
python -c "from brain.seed_patterns import seed; from brain.shape_templates import seed_shapes; seed(); seed_shapes()"

# 3. Lancer le dashboard
python dashboard/app.py     # → http://0.0.0.0:8050

# 4. Lancer les tests (214)
python ci_tests.py          # → ci_results.json

# 5. Mode CI (sans ChromaDB réelle)
CI=true CI_CHROMA_PATH=/tmp/chroma python ci_tests.py  # → 208 tests

🔬 CI/CD (GitHub Actions)

  • Workflow : .github/workflows/ci.yml

  • Jobs : lint (ruff) → test (208 tests sans LLM, seed ChromaDB dynamique)

  • DĂ©clenchĂ© : push/PR vers main

📁 Structure

Smart-MCP/
├── brain/                  # RAG, seed patterns, templates XML
│   ├── rag.py             # ChromaDB RAGBrain
│   ├── seed_patterns.py   # Seed 26 patterns
│   └── shape_templates.py # SHAPE_PATTERNS (15 formes + 5 architectures)
├── dashboard/              # Dash dashboard + test runner
│   ├── app.py             # App Dash (956 lignes)
│   └── test_runner.py     # Runner pipelines
├── diagrams/               # Diagrammes .drawio persistants (13 pages)
├── models/                 # LLM client
│   └── llm_client.py      # LLMClient avec classify_intent
├── mcp_client/             # MCP draw.io client
│   └── drawio.py
├── skills/                 # Skills Hermes pour agents
│   ├── smart-mcp-pipeline.md
│   └── drawio-mcp-integration.md
├── .github/workflows/      # CI/CD
│   └── ci.yml             # Lint + 208 tests
├── tests/                  # Tests unitaires
├── smart_mcp.py            # Pipeline principal
├── smart_mcp_server.py     # Serveur MCP
├── ci_tests.py             # Suite >200 tests (8 sections A-H)
├── SOUL.md                 # Macro-rùgles de classification
└── README.md               # Ce fichier

🧠 ChromaDB Visualisation

  • 2 collections : diagram_patterns (patterns XML) + feedback_history

  • 26 patterns : 5 architectures + 15 formes + 4 couleurs + 1 test + 1 gĂ©nĂ©rĂ©

  • Chemin : ~/.hermes/profiles/default2/home/.smart-mcp/brain/chroma.sqlite3

🔑 Points clĂ©s

  • Classification automatique via LLM local

  • RAG avec ChromaDB (26+ patterns)

  • Dashboard temps rĂ©el avec mode auto/manuel

  • CI/CD GitHub Actions (208 tests sans LLM)

  • 214 tests local / 208 CI — 100% verts

  • Diagramme persistant F1-F17 liĂ© au dashboard

  • Mode manuel avec exĂ©cution live du pipeline

  • Visualisation ChromaDB (Neo4J / graphe)

  • Mode auto-apprentissage

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    A
    maintenance
    Enables AI coding assistants to turn natural-language descriptions of systems and data into editable, auto-laid-out Excalidraw diagrams across 25 types — from architecture and sequence diagrams to Gantt charts and scatter plots — plus optionally persist the architecture as a queryable, version-controlled knowledge graph. Runs fully offline with export to SVG and PNG, and diagrams can be revised afterward in natural language.
    -
  • F
    license
    Not graded
    quality
    A
    maintenance
    Enables AI assistants to turn natural-language descriptions of systems, flows, and data into hand-drawn-style Excalidraw diagrams across 25 types—architecture, sequence, swimlane, ER, Gantt, charts and more—with automatic layout, architecture-aware styling of 50+ technologies, and export to SVG/PNG. It also lets users revise diagrams conversationally and optionally persist their system as a queryable, version-controlled architecture knowledge graph, all running fully offline with no API keys.
    -
  • F
    license
    Not graded
    quality
    A
    maintenance
    Enables AI assistants to turn plain-language descriptions of systems, flows, and data into 25 kinds of fully laid-out, hand-drawn Excalidraw diagrams — architecture, sequence, ER, swimlane, Gantt, charts and more — with auto-styling for 50+ technologies and revision in natural language. Runs fully offline, exports to SVG and PNG without a browser or Node.js, and can optionally persist the architecture as a queryable knowledge graph.
    -
  • F
    license
    Not graded
    quality
    A
    maintenance
    Enables users to generate and revise 25 types of hand-drawn Excalidraw diagrams—including architecture, flowcharts, sequence, ER, Gantt, and charts—from natural-language specs without managing coordinates. It can also persist architecture as a queryable, version-controlled knowledge graph and export offline to SVG or PNG.
    -