This project provides an enhanced, production-ready Odoo MCP (Middleware/Connector/Proxy) Server, designed to act as a secure and intelligent bridge between your Odoo instance and modern AI agents like ChatGPT and Google Gemini, especially within automation platforms like n8n.
This server exposes a secure, JSON-RPC 2.0 compliant API that translates simple, standardized requests into complex Odoo XML-RPC commands. This allows AI agents to safely and effectively query and manipulate your Odoo data without needing direct access to your Odoo instance.
- AI Agent Ready: Provides a clear, well-defined set of tools for AI agents to interact with Odoo.
- Secure: Implements API Key authentication to protect your Odoo data from unauthorized access.
- Robust: Includes comprehensive error handling to provide clear feedback to the AI agent.
- High-Performance: Built on FastAPI for asynchronous, high-throughput performance.
- Easy to Deploy: Comes with a simple, Docker-based deployment process.
- Broad Odoo Compatibility: Designed to be a general-purpose solution for Odoo versions 10.0 through 18.0.
This project is an enhanced version of the original odoo-mcp-server created by Václav Zeman. We extend our sincere thanks to him for providing the excellent foundation for this project.
This enhanced version was fixed and improved by Mahmoud Abdel Latif to be a more general-purpose, secure, and AI-ready solution for the Odoo, n8n, and AI communities.
The Odoo MCP Server acts as a secure intermediary:
- AI Agent (ChatGPT/Gemini): The AI agent, running in a platform like n8n, decides it needs to query Odoo.
- n8n Workflow: The AI agent calls a tool in its n8n workflow.
- MCP Client Node: The n8n MCP Client node sends a secure, JSON-RPC request to the Odoo MCP Server, including the secret API Key.
- Odoo MCP Server: The server validates the API Key, receives the request, and translates it into a standard Odoo XML-RPC call.
- Odoo Instance: The MCP server executes the command on your Odoo instance.
- Response: The result is passed back through the chain to the AI agent, which then formulates a natural language response for the user.
- A server running a Linux distribution (e.g., Ubuntu 22.04)
- Docker and Docker Compose installed
- A running Odoo instance (version 10.0 to 18.0)
git clone https://github.com/mah007/odooMCP.git
cd odooMCPCreate a .env file in the root of the project directory:
cp docker-compose.example.yml .envNow, edit the .env file with your specific configuration:
# Odoo Connection Details
ODOO_URL=https://your-odoo-instance.com
ODOO_DB=your_database_name
ODOO_USERNAME=your_odoo_user
ODOO_API_KEY=your_odoo_api_key_or_password
# MCP Server Configuration
MCP_HOST=0.0.0.0
MCP_PORT=8000
MCP_DEBUG=false
MCP_LOG_LEVEL=INFO
# NEW: API Key for MCP Server Authentication
# Generate a strong key with: openssl rand -hex 32
MCP_API_KEY=your_super_secret_mcp_api_key
# Cache Configuration
CACHE_ENABLED=true
CACHE_TTL=300
CACHE_MAX_SIZE=1000docker-compose up --build -dCheck the logs to ensure the server started correctly:
docker-compose logs -fYou should see a message like: Uvicorn running on http://0.0.0.0:8000.
- Add the MCP Client Node: In your n8n workflow, add the MCP Client node.
- Configure the Endpoint: Set the Endpoint URL to your server:
http://<your_server_ip>:8000. - Add API Key Authentication:
- Authentication:
Header Auth - Name:
X-API-Key - Value: Your
MCP_API_KEYfrom the.envfile.
- Authentication:
This project is made with ❤️ by Mahmoud Abdel Latif for the Odoo, n8n, and AI communities.
If you encounter any errors or bugs, or have suggestions for improvements, please open an issue on the GitHub repository. We welcome all feedback and contributions!
This project is licensed under the MIT License. See the LICENSE file for details.

