Odoo MCP Server
Connect Any AI Assistant to Your Odoo ERP
The most flexible Model Context Protocol server for Odoo.
Connect Claude, Cursor, Gemini, Windsurf, and any MCP-compatible AI assistant
to your Odoo ERP. Available as a standalone CLI tool (uvx odoo-mcp-native)
or as a native Odoo module with built-in SSE and OAuth 2.0 for remote clients.
Two Connection Modes
Mode 1 - Standalone (stdio)
Runs as a standalone process on any machine. Talks to Odoo via standard XML-RPC - no Odoo module installation required. Works with any Odoo version that has XML-RPC enabled.
Install: uv tool install odoo-mcp-native
Or run directly: uvx odoo-mcp-native
{
"mcpServers": {
"odoo": {
"command": "odoo-mcp-native",
"env": {
"ODOO_URL": "http://localhost:8069",
"ODOO_DB": "mydb",
"ODOO_USER": "admin",
"ODOO_PASSWORD": "admin"
}
}
}
}
Mode 2 - Native Odoo Module (SSE)
Runs inside Odoo as an installed module. Exposes SSE and HTTP POST endpoints with full OAuth 2.0 security. Ideal for remote web-based clients like Claude.ai that connect over HTTPS.
Requires: Odoo on Python 3.10+ + module installed
Uses: Direct ORM (no XML-RPC overhead)
Server URL: https://your-odoo.com/mcp/sse Authorization: Bearer YOUR_API_KEY OAuth Discovery: /.well-known/oauth-authorization-server
Seven Powerful MCP Tools
Full CRUD & Business-Logic Execution via Natural Language
The module registers seven MCP tools. Each tool operates through the Odoo ORM and respects all standard access rights and record rules.
odoo_create
| Description | Create a new record in any Odoo model |
| Example | "Create a new customer for Acme Corp with email info@acme.com" |
odoo_read
| Description | Read specific fields from records by their IDs |
| Example | "Read the name and email of customer #42" |
odoo_write
| Description | Update existing records with new values |
| Example | "Update John's phone number to +1-555-0199" |
odoo_unlink
| Description | Delete records by their IDs |
| Example | "Remove the test contact we created earlier" |
odoo_search_read
| Description | Search records with a domain filter and read their fields in one call. Supports offset, limit, and ordering. |
| Example | "Show me all customers from Spain" / "Find unpaid invoices from last month" |
odoo_search_count
| Description | Count records matching a domain without fetching data |
| Example | "How many open sales orders do we have?" |
odoo_execute_action
| Description | Call any business-logic method - action_confirm, button_validate, etc. |
| Example | "Confirm sales order SO/2024/001" |
Four Built-In MCP Resources
Let AI Explore Your Odoo Schema Automatically
Resources allow the AI to introspect your database schema before making tool calls, leading to more accurate queries and fewer errors.
| Resource URI | Description |
|---|---|
odoo://models |
List every installed model in the Odoo database. The AI uses this to discover what data is available. |
odoo://model/{model_name} |
Full field definitions for a specific model (field name, type, help text, selection values, relations). |
odoo://record/{model_name}/{id} |
Read all field values for a single record by ID. |
odoo://search/{model_name}/{domain} |
Quick search: returns up to 10 records matching a JSON-encoded Odoo domain. |
Remote Connection Setup
Three Ways to Connect to a Remote Odoo Instance
Option 1 - Standalone stdio to Remote Odoo
Best for: Your AI client runs locally, Odoo is on a remote server.
The standalone server runs on your machine and connects to the remote Odoo via
XML-RPC over the network. No bridge, no tunnel needed - just change ODOO_URL.
{
"mcpServers": {
"odoo": {
"command": "odoo-mcp-native",
"env": {
"ODOO_URL": "https://your-odoo-instance.com",
"ODOO_DB": "production",
"ODOO_USER": "admin",
"ODOO_PASSWORD": "your-api-key"
}
}
}
}
Requires: odoo-mcp-native installed locally.
Odoo's /xmlrpc/2/ endpoint must be reachable. HTTPS recommended.
Option 2 - Standalone streamable-http (MCP Proxy Server)
Best for: Multiple AI clients sharing one connection, or clients that only support HTTP-based MCP.
Run the standalone server as an HTTP service on any machine. It accepts MCP connections over HTTP and proxies them to Odoo via XML-RPC.
Step 1 - Start the MCP HTTP server (on any machine that can reach Odoo):
ODOO_URL=https://your-odoo-instance.com \ ODOO_DB=production \ ODOO_USER=admin \ ODOO_PASSWORD=your-api-key \ odoo-mcp-native --transport streamable-http --host 0.0.0.0 --port 8000
Step 2 - Connect your AI client to the MCP endpoint:
{
"mcpServers": {
"odoo": {
"url": "http://your-mcp-server:8000/mcp/"
}
}
}
Note: Don't put flags in command. Use args:
"command": "odoo-mcp-native", "args": ["--transport", "streamable-http", "--port", "8000"]
Option 3 - Native Odoo Module (SSE + OAuth 2.0)
Best for: Web-based AI clients (Claude.ai) that connect directly to a URL with OAuth. Zero middleware.
Step 1 - Install the Odoo module (requires Python 3.10+ and pip install mcp anyio) and configure in Settings -> General Settings -> MCP Server.
Step 2 - Expose Odoo publicly (if needed):
# Quick tunnel (Pinggy) ssh -p 443 -R0:localhost:8069 a.pinggy.io # Production (nginx) - add to your location /mcp/ block: proxy_buffering off; proxy_cache off; proxy_set_header X-Accel-Buffering no; proxy_http_version 1.1;
Step 3 - Connect your AI client:
Server URL: https://your-odoo.com/mcp/sse Authorization: Bearer YOUR_API_KEY OAuth 2.0 discovery (auto-detected by compliant clients): https://your-odoo.com/.well-known/oauth-authorization-server
Quick Reference - Client Configs
Claude Desktop / Cursor / VS Code / Windsurf / Gemini (stdio)
{
"mcpServers": {
"odoo": {
"command": "odoo-mcp-native",
"env": {
"ODOO_URL": "https://your-odoo-instance.com",
"ODOO_DB": "production",
"ODOO_USER": "admin",
"ODOO_PASSWORD": "your-api-key"
}
}
}
}
HTTP-only Clients (streamable-http)
{
"mcpServers": {
"odoo": {
"url": "http://your-mcp-server:8000/mcp/"
}
}
}
Claude.ai & Web-Based Clients (Native Module - SSE)
- Server URL:
https://your-odoo-instance.com/mcp/sse - Authorization:
Bearer YOUR_API_KEY
OAuth 2.0 discovery is auto-detected by compliant clients.
Environment Variables (Standalone Mode)
| Variable | Required | Default | Description |
|---|---|---|---|
ODOO_URL |
No | http://localhost:8069 |
Odoo server URL |
ODOO_DB |
Yes | (required) | Database name |
ODOO_USER |
Yes | (required) | Login username |
ODOO_PASSWORD |
Yes | (required) | Password or API key |
HTTP Endpoints (Native Module Mode)
| Method | Path | Purpose |
|---|---|---|
| GET | /mcp/sse | Open an SSE stream (new MCP session) |
| POST | /mcp/sse?session_id=... | Send a JSON-RPC message to an active session |
| POST | /mcp/messages?session_id=... | Legacy message endpoint (backward compat) |
| GET | /.well-known/oauth-authorization-server | RFC 8414 OAuth discovery |
| GET | /.well-known/oauth-protected-resource | RFC 9470 resource metadata |
| GET/POST | /oauth/authorize | OAuth authorization consent page |
| POST | /oauth/token | Exchange auth code or refresh token |
Real-World Use Cases
Customer Service
Instantly look up orders, create support tickets, and update contact info through conversation.
Sales Intelligence
Create leads, update pipeline stages, and generate sales reports from your AI chat.
Inventory & MRP
Check stock levels, create manufacturing orders, and confirm deliveries conversationally.
Finance & Invoicing
Create invoices, update payment terms, and query overdue balances with natural language.
HR & Payroll
Look up employee records, manage leave requests, and update department assignments.
Project Management
Create tasks, update deadlines, and track milestones through your AI assistant.
Architecture
Standalone Mode (stdio / streamable-http)
Runs as a separate process on any machine. Communicates with Odoo via XML-RPC over the network.
- No Odoo module needed
- Works with any Odoo version
- Installable via pip or uvx
- Runs on any machine with network access to Odoo
Native Module Mode (SSE + OAuth 2.0)
Runs inside Odoo as an installed module. AI clients connect directly
via HTTPS to the /mcp/sse endpoint.
- Requires module installed on Odoo 15
- OAuth 2.0 + PKCE security
- Zero middleware - direct ORM access
- Respects all Odoo ACLs and record rules
Data Privacy & Protection
This module connects your Odoo data to external AI models (Claude, Cursor, Gemini, etc.). No data is sent automatically. Data is only transmitted when you explicitly prompt the AI to query your database. You maintain complete control over access via credentials, API keys, and the global enable/disable toggle in Odoo settings.
Support
For questions, bug reports, or feature requests please contact us at rashid.habib@outlook.com.
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module