| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 3934 |
| Technical Name |
mcp_odoo_connector |
| License | LGPL-3 |
MCP Server is a powerful Odoo 17.0 module that securely connects AI assistants like Claude, Cursor, VS Code Copilot, Gemini, and ChatGPT to your Odoo ERP using the Model Context Protocol (MCP) standard. It provides REST API endpoints, XML-RPC proxy, and a built-in OWL Chatbot widget â all with fine-grained access control, full audit logging, rate limiting, response caching, and LLM-optimized output formatting.
Whether you need AI to read customer data, create sales orders, analyze inventory, or chat directly inside Odoo â MCP Server ensures every request is authenticated, authorized, logged, and delivered in a format AI assistants understand best.
- ✅ REST API with 13 endpoints + XML-RPC proxy with 2 endpoints
- ✅ Built-in OWL Chatbot widget (Ollama / OpenAI / Gemini)
- ✅ Bearer Token (API Key) + Basic Auth support
- ✅ Per-model CRUD access control with field-level restrictions
- ✅ Rate limiting (configurable per minute per user)
- ✅ IP whitelist for production security
- ✅ Full audit logging with duration tracking
- ✅ Response caching with configurable TTL
- ✅ LLM-optimized output formatting
- ✅ YOLO mode for development (bypasses permissions)
- ✅ AI Function Calling â CRUD via chatbot
Get up and running in 5 minutes
❶ Install the Module
- Copy the
mcp_odoo_connectorfolder to your Odoo addons path. - Restart Odoo server.
- Go to Apps → Update Apps List → Search "MCP Server" → Click Install.
❷ Enable MCP Server
- Go to Settings (top menu).
- Scroll to the MCP Server section.
- Toggle Enable MCP Server to ON.
- Click Save.
❸ Expose Models
By default, no models are exposed. You must explicitly add each model you want AI to access:
- Go to Settings → MCP Server → Model Access.
- Click New.
- Select a Model (e.g.,
Contact / res.partner). - Toggle permissions: Read, Write, Create, Delete.
- (Optional) Set Allowed Fields as JSON:
["name", "email", "phone"] - Click Save.
| Model | Technical Name | Recommended Permissions |
|---|---|---|
| Contacts | res.partner |
Read, Write, Create |
| Products | product.template |
Read only |
| Sale Orders | sale.order |
Read, Write, Create |
| Invoices | account.move |
Read only |
| Tasks | project.task |
Read, Write, Create |
| Employees | hr.employee |
Read only |
❹ Generate API Key
- Go to Settings → Users & Companies → Users.
- Select your user.
- Go to the API Keys tab.
- Click New API Key → Enter a description (e.g., "MCP Claude") → Scope:
rpc. - Copy the generated key — you will need it for AI client configuration.
❺ Install Python Dependencies (for MCP Bridge)
pip install "mcp[cli]" httpx
❻ Test the API
curl http://localhost:8069/mcp/api/v1/health
Expected response:
{"status": "ok", "mcp_enabled": true, ...}
➤ Public (No Auth Required)
| Method | Endpoint | Description |
|---|---|---|
| GET | /mcp/api/v1/health |
Health check with status, version, timestamp |
| GET | /mcp/api/v1/system/info |
Odoo version, database, exposed model count |
➤ Authenticated (Bearer Token or Basic Auth)
| Method | Endpoint | Description |
|---|---|---|
| POST | /mcp/api/v1/auth/validate |
Validate credentials, return user info |
| GET | /mcp/api/v1/models |
List all exposed models with permissions |
| GET | /mcp/api/v1/models/<model>/fields |
Get field metadata for a model |
| POST | /mcp/api/v1/models/<model>/search |
Search records with domain filter |
| POST | /mcp/api/v1/models/<model>/read |
Read specific records by IDs |
| POST | /mcp/api/v1/models/<model>/browse |
Paginated browse with offset/limit |
| POST | /mcp/api/v1/models/<model>/count |
Count records matching domain |
| POST | /mcp/api/v1/models/<model>/create |
Create new record |
| POST | /mcp/api/v1/models/<model>/write |
Update existing records |
| POST | /mcp/api/v1/models/<model>/unlink |
Delete records |
| POST | /mcp/api/v1/models/<model>/call |
Call arbitrary model method |
➤ XML-RPC Endpoints
| Endpoint | Methods |
|---|---|
/mcp/xmlrpc/2/common |
version(), authenticate() |
/mcp/xmlrpc/2/object |
execute_kw() |
➤ Usage Examples
Search Partners (curl):
curl -X POST http://localhost:8069/mcp/api/v1/models/res-partner/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"domain": [["is_company", "=", true]], "fields": ["name", "email"], "limit": 5}'
Note: Use dashes (res-partner) instead of dots (res.partner) in URL paths.
Create a Record (curl):
curl -X POST http://localhost:8069/mcp/api/v1/models/res-partner/create \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"values": {"name": "New Partner", "email": "new@example.com", "is_company": true}}'
Connect your favorite AI assistant to Odoo using the included MCP Bridge script
Install dependencies first: pip install "mcp[cli]" httpx
💻 VS Code (Copilot / Claude)
Create .vscode/mcp.json in your workspace:
{
"servers": {
"odoo": {
"command": "python3",
"args": ["/path/to/mcp_odoo_connector/mcp_bridge.py"],
"env": {
"ODOO_URL": "http://localhost:8069",
"ODOO_API_KEY": "your-api-key-here",
"ODOO_DB": "your-database-name"
}
}
}
}
🤖 Claude Desktop
Config:
~/.config/claude/claude_desktop_config.json
{
"mcpServers": {
"odoo": {
"command": "python3",
"args": ["/path/to/mcp_odoo_connector/mcp_bridge.py"],
"env": {
"ODOO_URL": "http://localhost:8069",
"ODOO_API_KEY": "your-api-key-here",
"ODOO_DB": "your-database-name"
}
}
}
}
📡 Claude Code (CLI)
Run in your terminal:
claude mcp add-json odoo '{
"command": "python3",
"args": ["/path/to/mcp_odoo_connector/mcp_bridge.py"],
"env": {
"ODOO_URL": "http://localhost:8069",
"ODOO_API_KEY": "your-api-key-here",
"ODOO_DB": "your-database-name"
}
}' -s user
🖱 Cursor IDE
Config: ~/.cursor/mcp.json
{
"mcpServers": {
"odoo": {
"command": "python3",
"args": ["/path/to/mcp_odoo_connector/mcp_bridge.py"],
"env": {
"ODOO_URL": "http://localhost:8069",
"ODOO_API_KEY": "your-api-key-here",
"ODOO_DB": "your-database-name"
}
}
}
}
Replace
/path/to/mcp_odoo_connector/mcp_bridge.py with the actual full path. ODOO_DB is required for
multi-database servers.
Chat with AI directly inside Odoo â no external tools required
OpenAI
GPT-4o, GPT-4o-mini, and all OpenAI models. Enter your API key in settings and start chatting.
Google Gemini
Gemini Pro and Flash models. Paste your Google AI API key and connect instantly.
Ollama (Local)
Run LLMs locally â Llama 3, Mistral, Phi-3, and more. No API key needed. Full privacy.
🔧 AI Function Calling (Tool Use)
The chatbot can perform CRUD operations directly from the conversation:
- "Create a new customer named John Doe" → AI creates the record in Odoo
- "Update partner 14's phone to +1 555-0200" → AI updates the record
- "Show me all unpaid invoices" → AI searches and returns results
- "Delete test partner ID 99" → AI deletes the record
- 🔒 Use HTTPS in Production â Always deploy behind a reverse proxy (Nginx/Caddy) with TLS certificates.
- 🔑 Unique API Keys â Generate a separate API key for each AI integration. Revoke individually if compromised.
- 🌐 Enable IP Whitelist â In production, restrict access to known IP addresses via MCP Server settings.
- 🛡 Minimal Model Exposure â Only expose models your AI needs. Use field restrictions to hide sensitive columns.
- ⛔ Disable YOLO Mode â YOLO mode bypasses all permission checks. Never enable it in production.
- 📊 Review Audit Logs â Regularly check audit logs for suspicious activity. Auto-cleanup after 90 days (configurable).
| HTTP | Error Code | Meaning |
|---|---|---|
| 401 | AUTH_INVALID |
Missing or invalid credentials |
| 403 | BLOCKED_MODEL |
Model is security-blocked (ir.rule, etc.) |
| 403 | OPERATION_DENIED |
Operation not allowed on this model |
| 404 | MODEL_NOT_FOUND |
Model not exposed via MCP |
| 429 | RATE_LIMITED |
Rate limit exceeded â wait and retry |
| 500 | INTERNAL_ERROR |
Server error â check Odoo logs |
What is MCP Server?
MCP Server is an Odoo module that implements the Model Context Protocol standard, allowing AI assistants like Claude, Cursor, VS Code Copilot, and ChatGPT to securely read and write Odoo data through REST API, XML-RPC endpoints, and a built-in chatbot widget.
Which AI assistants are supported?
Any AI client that supports the MCP standard can connect, including Claude Desktop, Claude Code CLI, VS Code Copilot, and Cursor IDE. The built-in chatbot also supports OpenAI (GPT-4o), Google Gemini, and Ollama (local LLMs).
How do I authenticate API requests?
You can use either Bearer Token authentication (using Odoo's native API key system) or HTTP Basic Auth (login:password). API keys are recommended for production â generate them in Settings → Users → API Keys tab.
Is it safe to use in production?
Yes â the module includes multiple security layers: Bearer token auth, IP whitelisting, per-user rate limiting, per-model CRUD permissions, field-level restrictions, blocked security-sensitive models, and complete audit logging. Just make sure YOLO mode is disabled and you use HTTPS.
What is YOLO mode?
YOLO mode is a development-only feature that bypasses MCP permission checks. It has two levels: "read_only" (skips permissions for read operations) and "full" (skips all permissions). Never enable it in production environments.
Can I use model names with dots in URLs?
Use dashes instead of dots in URL paths. For example, use
res-partner instead of res.partner. The API
automatically converts dashes back to dots internally.
Does the chatbot support function calling?
Yes! The built-in chatbot supports AI function calling (tool use) for all three providers â OpenAI, Gemini, and Ollama. The AI can create, read, update, and delete records directly from the chat interface.
Need Any Help?
Having trouble? We're happy to help you get started.
Developed & maintained by Mohamed Saied
Please log in to comment on this module