How infovpcs/odoo18_mcp_project works
Project Type and Purpose
• This is a full-stack integration server combining an MCP (Master Control Program) SDK with an Odoo 18 ERP system.
• It offers both HTTP and STDIO interfaces (via mcp_server.py and standalone_mcp_server.py), a Streamlit UI, command-line scripts, and Claude Desktop integration.
• Core goals: dynamic model discovery, CRUD operations, export/import to CSV, advanced NLP search, AI-driven code and documentation generation.
Key Architectural Components
a. User Interfaces
• Command-line and script clients (scripts/dynamic_data_tool.py, various example *.py).
• Claude Desktop via MCP SDK (claude_config.json, update_claude_config.sh).
b. MCP Server
• mcp_server.py: FastAPI-based HTTP and STDIO tool dispatcher.
• Core request handlers (src/mcp/handlers.py, dynamic_handlers.py).
• Client code for STDIO and HTTP transports (src/mcp/client.py).
c. Odoo Integration
• XML-RPC Odoo client wrapper (src/odoo/client.py).
• Dynamic model discovery, CRUD generator, NLP analyzer (src/odoo/dynamic/…).
• Data schemas (src/odoo/schemas.py).
d. AI & RAG
• Odoo documentation RAG pipeline (src/odoo_docs_rag/): embedding storage (embeddings.db), FAISS index, Gemini summarizer, Brave online search.
• Simple and advanced code agents (src/simple_odoo_code_agent/ and src/odoo_code_agent/) implementing LangGraph workflows.
e. Export/Import Agents
• LangGraph agents for CSV export/import (src/agents/export_import/).
• Utility handlers for CSV, field mapping.
f. Data Stores & File System
• Odoo database (external).
• Local volumes: exports/, tmp/, generated_modules/, logs/.
• Document index files: odoo_docs_index/faiss_index.bin, embeddings.db.
g. Infrastructure
• Docker (Dockerfile, docker-compose*.yml).
• Makefile for build/test/dev/prod workflows.
• Environment variables (.env).
• CI/test suite (tests/).
Relationships and Data Flows
1. User (browser/CLI/Claude) → Streamlit or MCP SDK → MCP Server
2. MCP Server → Internal handlers →
a. Odoo XML-RPC client → Odoo ERP → returns data
b. AI clients (Gemini, Ollama, sentence-transformers + FAISS + Brave) → returns summaries/embeddings
3. MCP Server composes results and forwards back to user.
4. Export/Import flows: MCP or scripts → File system (exports/, tmp/) → agents → Odoo.
5. Code-generation: user query → code agent workflow → generated modules → stored in generated_modules/.
6. Documentation RAG: user query → docs_processor → embeddings → FAISS → summarizer → user.
Architectural Patterns & Technologies
• Modular monolith with layered packages: core, mcp, odoo, agents, UI.
• Agent-based workflows using LangGraph for export/import and code generation.
• Micro-service-style interfaces: FastAPI endpoints, standalone server.
• Asynchronous I/O (async/await for MCPConnector, FastAPI).
• Vector search (sentence-transformers + FAISS).
• Streamlit for rapid UI prototyping.
• Docker Compose for multi-container orchestration (mcp-server, standalone-server, test-runner).
Level-of-Detail Recommendations
• Essential architectural elements without overcrowding: group closely related modules.
• Dynamic discovery workflows (agents and RAG) as sub-flows.
• Docker Compose services and how volumes map to host directories.