Odoo MCP Server
The Odoo MCP Server connects any Odoo 16+ instance to AI agents via the Model Context Protocol — no Odoo-side setup required — providing read, write, diagnostic, migration, and audit capabilities.
Read & Discovery
list_models– List all model technical names and labelsget_model_fields– Retrieve field metadata for any modelsearch_records/read_record– Bounded, read-only searches and single-record readsaggregate_records– Server-side groupby/sum/count/avg aggregationssearch_employee/search_holidays– Search employees or leave recordsget_odoo_profile– Server version, user context, transport, and installed modulesschema_catalog– Build a bounded model catalog with optional field metadatabuild_domain– Build and validate Odoo domains from structured conditions
Safe Write Workflow
preview_write– Preview acreate,write, orunlinkwithout executing itvalidate_write– Validate a write payload against livefields_getmetadataexecute_approved_write– Execute a token-approved write (requiresODOO_MCP_ENABLE_WRITES=1)execute_method– Execute custom model methods (allowlist or broad-mode gated)chatter_post– Post chatter messages on anymail.threadrecord
Diagnostics
diagnose_odoo_call– Diagnose a model call without executing itdiagnose_access– Analyze ACL and record-rule visibility for the current userinspect_model_relationships– Inspect relationship fields, required fields, and write hints
Migration Helpers
generate_json2_payload– Convert XML-RPC-style calls into JSON-2 request previews (Odoo 19+)upgrade_risk_report– Surface transport, method, and migration risks across Odoo versions
Audit & Planning
scan_addons_source– Scan local addon source code without importing itfit_gap_report– Classify requirements into fit/gap implementation bucketsbusiness_pack_report– Report expected modules, models, and discovery calls for sales, CRM, inventory, accounting, or HR
Utility & Infrastructure
health_check– Report the server's runtime safety postureSupports XML-RPC (Odoo 16–19) and External JSON-2 (Odoo 19+) transports
Streamable HTTP/SSE transport for non-stdio clients
5 reusable agent prompts (diagnostics, fit/gap, JSON-2 migration, safe writes, module audits)
4 resource URIs for browsing models, fields, and records
DNS-rebinding protection and host/origin allowlists for HTTP deployments
Provides comprehensive access to Odoo ERP systems, allowing interaction with Odoo models, records, and methods. Enables searching, reading, creating, updating, and deleting records, as well as executing custom methods on any Odoo model.
Implements XML-RPC communication for secure connections to Odoo instances, enabling the transmission of data between the MCP server and Odoo systems.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Odoo MCP Serversearch for employees named John"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Odoo MCP
Odoo MCP turns any Odoo 16+ database into a Model Context Protocol server — using only your existing credentials. No App Store module, no permission setup, no admin access required. Built for local agents, IDEs, and automation tools that need real Odoo context without hand-rolled scripts or unsafe direct write access.
It speaks XML-RPC for Odoo 16-18 and External JSON-2 for Odoo 19+. It exposes a compact MCP surface with read tools, diagnostics, schema discovery, migration helpers, local addon scanning, and a gated write workflow. One server can serve multiple named Odoo instances at once.
Try it in 30 seconds
Once configured (see Setup), ask your agent things like:
"Show me all customers from Spain with unpaid invoices."
"Find products with stock below 10 units in the main warehouse."
"Audit the
custom_billingaddon for upgrade risks before we move to Odoo 19."
Related MCP server: Odoo MCP Server
Highlights
Capability | What it gives you |
39 MCP tools | Read records and attachments, aggregate server-side, post chatter, inspect schema, build domains, scan addons, diagnose calls, access rules, resolve model renames, validate writes, and fan out across instances. |
Field-level ACL | Opt-in per-instance, per-model field allow/deny enforced on every read path (records, aggregates, knowledge index, resources). First open-source Odoo MCP with it. See docs/field-acl.md. |
Cross-instance queries | Read-only fan-out across many client DBs with merged, attributed, partial-failure-tolerant results — no warehouse, no sync. See docs/partner-playbook.md. |
Workflow prompts | 10 prompts including 5 end-to-end business workflows (invoice approval, PO match, onboarding, expense review, month-end close) that route writes through the gate. |
Background tasks |
|
Local-first knowledge search |
|
Accounting pack |
|
Rate limiting | Opt-in sliding-window budget per instance and tool ( |
Multi-instance | One server, several named Odoo instances — optional |
5 agent prompts | Reusable workflows for failed calls, fit/gap workshops, JSON-2 migration, safe writes, and module audits. |
Odoo 16-19 coverage | XML-RPC by default, JSON-2 opt-in for Odoo 19. |
Streamable HTTP | Local HTTP/SSE support for clients that do not use stdio. |
Smart field selection |
|
Server-side aggregation |
|
Chatter integration |
|
Locale plumbing |
|
Structured logging | JSON formatter and rotating file handler via |
Safe writes | Direct |
Human-in-the-loop approval |
|
Audit trail |
|
Resilience | Read-only calls retry connection errors with exponential backoff; schema caches are TTL- and LRU-bounded; |
Real smoke tests | Docker Compose validation boots disposable Odoo 16.0, 17.0, 18.0, and 19.0 stacks, including restricted users, custom record rules, and packaged addon XML install/update. |
Why Odoo MCP
Trait | Odoo MCP | Other MCP-Odoo bridges |
Setup steps on Odoo side | 0 — works with any Odoo 16+ instance using credentials you already have. | Often require installing an App Store module, configuring enabled models, and granting per-tool permissions. |
Safe write workflow | Approval token + live | Often expose direct |
Diagnostics |
| Usually CRUD only. |
Transport | XML-RPC (16+) and External JSON-2 (Odoo 19+). Ready for the Odoo 22 XML-RPC removal years early. | Usually XML-RPC only — deprecated since Odoo 19, removed in Odoo 22. |
Migration helpers |
| None. |
Multi-instance | Named instances in one config file, per-tool routing, tokens and caches isolated per instance. | Usually one global connection per server process. |
Agent prompts | 5 ready-made prompts for diagnose / fit-gap / JSON-2 migration / safe-write / module-audit. | Usually none. |
HTTP transport security | DNS-rebinding protection, host/origin allowlists, local-bind by default. | Often missing. |
Real Odoo smoke tests | Docker Compose harness boots disposable Odoo 16/17/18/19 stacks per release. | Often mock-based only. |
Framework examples | Copy-paste adapters for Cursor, Claude Code, OpenAI Agents, LangGraph, CrewAI, and n8n in | None. |
Audit & approval UX | JSONL audit trail + native elicitation confirm forms — without installing anything in Odoo. | Audit features usually require an Odoo-side module. |
Comparing specific projects? See the per-project breakdown in docs/comparison.md.
Setup
Two paths to a working server: set it up yourself, or paste one prompt and let your coding agent do it for you.
For humans
The fastest path is the interactive wizard via uvx, which fetches the package on demand:
uvx odoo-mcp --setupThe wizard asks for your Odoo URL, database, and credentials, tests the connection live, writes the config file, and prints ready-to-paste snippets for Claude Code, Cursor, and Claude Desktop. Prefer a quick smoke check instead? uvx odoo-mcp --health.
Using Claude Desktop on macOS? It reads MCP configuration from:
~/Library/Application Support/Claude/claude_desktop_config.jsonUse an absolute Python path because GUI apps may not inherit your shell PATH:
{
"mcpServers": {
"odoo": {
"command": "/opt/homebrew/bin/python3",
"args": ["-m", "odoo_mcp"],
"env": {
"ODOO_URL": "https://your-odoo-instance.com",
"ODOO_DB": "your-database",
"ODOO_USERNAME": "your-user",
"ODOO_PASSWORD": "your-password-or-api-key",
"ODOO_TRANSPORT": "xmlrpc"
}
}
}
}More client configs (Windsurf, VS Code, Zed, Continue.dev, Streamable HTTP) are in docs/client-configs.md.
Other ways to install:
pip install odoo-mcp
# or: pipx install odoo-mcpPrefer a container? See Docker. For local development:
git clone https://github.com/tuanle96/mcp-odoo.git
cd mcp-odoo
uv sync --extra devFor AI agents
Paste this into Claude Code, Cursor, Codex, or any coding agent and it will install the server for you:
Install the odoo-mcp MCP server (https://github.com/tuanle96/mcp-odoo) in this environment:
1. Ask me for my Odoo URL, database name, username, and password or API key.
Treat them as secrets: never echo, print, or log these values.
2. Register the server as a stdio MCP server:
- Claude Code: claude mcp add odoo --env ODOO_URL=<url> --env ODOO_DB=<db>
--env ODOO_USERNAME=<user> --env ODOO_PASSWORD=<secret> -- uvx odoo-mcp
- Any other client: write the equivalent config with "command": "uvx",
"args": ["odoo-mcp"], and the same four env vars.
3. Verify the install: run `uvx odoo-mcp --health`, then call the health_check
MCP tool and confirm the Odoo connection is reachable.
4. Leave writes disabled (do not set ODOO_MCP_ENABLE_WRITES) unless I
explicitly ask you to enable them.
Full machine-readable instructions: https://github.com/tuanle96/mcp-odoo/blob/main/llms-install.mdAlready know your client? One-liners and config snippets:
claude mcp add odoo --env ODOO_URL=https://mycompany.odoo.com --env ODOO_DB=mycompany \
--env ODOO_USERNAME=agent@mycompany.com --env ODOO_PASSWORD=your-api-key -- uvx odoo-mcpClaude Code
.mcp.jsonand Codex CLIconfig.toml:examples/README.mdCursor
.cursor/mcp.json+ agent rules:examples/cursor/Windsurf, VS Code, Zed, Continue.dev, Cline, Streamable HTTP, Docker:
docs/client-configs.mdMachine-readable install guide for agents (Cline-style):
llms-install.md
Framework SDKs
Copy-paste-runnable integrations live in examples/:
Client | Example |
Cursor |
|
Claude Code / Codex CLI | snippets in |
OpenAI Agents SDK |
|
LangGraph |
|
CrewAI |
|
n8n |
|
Configuration reference
Set connection values in the environment:
export ODOO_URL="https://your-odoo-instance.com"
export ODOO_DB="your-database"
export ODOO_USERNAME="your-user"
export ODOO_PASSWORD="your-password-or-api-key"
export ODOO_TRANSPORT="xmlrpc"For Odoo 19 JSON-2:
export ODOO_TRANSPORT="json2"
export ODOO_API_KEY="your-odoo-api-key"
export ODOO_JSON2_DATABASE_HEADER="1"ODOO_JSON2_DATABASE_HEADER=1 sends X-Odoo-Database on JSON-2 calls. Set it to 0 only when host or dbfilter routing already selects the intended database.
Optional environment variables:
Variable | Default | Effect |
| unset | Explicit path to a config file, checked before the standard locations. |
| unset | Inject |
|
| Cap for smart-field selection when caller omits |
|
| Process logger level (DEBUG/INFO/WARNING/ERROR/CRITICAL). |
|
| Truthy → emit JSON-formatted log lines. |
| unset | Path → enable rotating file handler (10MB × 3 backups). |
|
| Required for |
| empty | Exact |
|
| Version-controllable side-effect allowlist with review metadata (see |
|
| Broad mode for |
| unset | Path → append one JSONL line per write-path event (preview/validate/execute/chatter), tokens stored as digests. |
|
| Truthy → |
|
| Extra attempts for read-only calls on connection errors (0–5). Writes never retry. |
|
| Base retry backoff seconds; doubles per retry. |
|
| Schema cache entry lifetime in seconds. |
|
| Max schema cache entries (LRU eviction). |
|
|
|
|
| Sliding window length in seconds for rate tracking. |
|
| Calls allowed per window per |
|
| Worker threads for |
|
| Max retained background tasks (finished tasks evicted oldest-first). |
|
| Seconds a finished background task result stays pollable. |
|
| Total documents allowed across all local BM25 knowledge indexes. |
| shared policy file | Field ACL policy (a |
|
| Bounded concurrency for cross-instance fan-out tools. |
|
| Truthy → |
|
| Truthy → permit non-local HTTP binds (still requires external auth/TLS). |
| local | CSV allowlists for HTTP transports. |
|
| Download cap for |
| unset | OAuth 2.1: authorization server issuer. With the two vars below, the HTTP transport becomes a protected resource server (RFC 9728 metadata + bearer validation). |
| unset | RFC 7662 token introspection endpoint of the authorization server. |
| unset | Canonical URL of this MCP server (RFC 8707 audience check when the AS binds tokens). |
| empty | CSV scopes required on every request. |
| unset | Credentials for the introspection call when the AS requires client auth. |
You can also use odoo_config.json:
{
"url": "https://your-odoo-instance.com",
"db": "your-database",
"username": "your-user",
"password": "your-password-or-api-key"
}Multiple Odoo instances
One server can talk to several Odoo databases. Add an instances map to your config file (auto-detected — a file without instances keeps the flat single-instance shape above):
{
"default": "acme",
"instances": {
"acme": {
"url": "https://acme.odoo.com",
"db": "acme",
"username": "bot",
"api_key": "...",
"transport": "json2"
},
"globex": {
"url": "https://globex.odoo.com",
"db": "globex",
"username": "bot",
"password": "...",
"lang": "fr_FR",
"timeout": 60
}
}
}Every read/write tool accepts an optional
instanceparameter; omitted → thedefaultinstance.defaultitself is optional when only one instance is defined.Each entry supports the same keys as the flat config (
url,db,username,password,api_key,transport,json2_database_header,lang) plustimeoutandverify_ssl. Instance entries are self-contained: credentials and transport never fall back to env vars (so one instance can never inherit another deployment'sODOO_API_KEY). Only non-credential knobs (ODOO_TIMEOUT,ODOO_VERIFY_SSL,ODOO_LOCALE) act as fallback defaults for entries that omit them. Env overrides likeODOO_TRANSPORT/ODOO_API_KEYstill apply to legacy flat configs, as before.ODOO_CONFIG_FILE=/path/to/config.jsonpoints at an explicit config file, checked before./odoo_config.json,~/.config/odoo/config.json, and~/.odoo_config.json.Precedence: when
ODOO_URL/ODOO_DB/ODOO_USERNAME/ODOO_PASSWORDare all set, the environment wins and defines a single instance nameddefault— unset them to use a multi-instance file.Instance names must match
[A-Za-z0-9_-]{1,64}. Clients connect lazily — an instance is only contacted when a tool targets it.Discovery: the
list_instancestool returns configured names, URLs, databases, and transports — never credentials.Write-approval tokens encode the instance name, so a token validated against one instance can never execute on another.
MCP resources (
odoo://…) always use the default instance in this release; use tools for multi-instance access.
Run
Start the MCP server over stdio:
odoo-mcpor:
python -m odoo_mcpStart Streamable HTTP for local clients:
odoo-mcp --transport streamable-http --host 127.0.0.1 --port 8000 --path /mcpNon-local HTTP binds are rejected unless you pass --allow-remote-http or set MCP_ALLOW_REMOTE_HTTP=1. This server does not include built-in HTTP authentication. Put remote HTTP deployments behind your own authentication, TLS, and network policy.
Check runtime posture without starting the server loop:
odoo-mcp --healthMCP Tools
39 tools grouped by use case. Each tool name is a single-purpose handle the agent can call. Tools that talk to Odoo accept an optional instance parameter when multiple instances are configured (see Multiple Odoo instances).
Read & Discover (11)
Tool | Purpose |
| List Odoo model technical names and labels. |
| Read field metadata for one model. |
| Run bounded read-only |
| Read one record by model and ID. Smart-field selection when caller omits |
| Server-side groupby/aggregation via |
| Search employees by name. |
| Search leave records by date range. |
| Read server version, user context, transport, database, and installed module summary. |
| Build a bounded model catalog with optional field metadata. |
| Build and validate an Odoo domain from structured conditions. |
| Read an |
Write & Operate (5)
Tool | Purpose |
| Produce a non-executing approval payload for |
| Validate a write payload against trusted live |
| Execute only a same-session, live-validated, confirmed write when |
| Execute a reviewed model method. Direct |
| Post a chatter message on a |
Diagnose (3)
Tool | Purpose |
| Diagnose a model call without executing it. |
| Diagnose ACL and record-rule visibility for the current Odoo credential. |
| Group relationship fields, required fields, and create/write hints. |
Migrate (3)
Tool | Purpose |
| Convert XML-RPC-shaped input into JSON-2 endpoint, headers, and named body. |
| Surface transport, method, and migration risks across Odoo versions. |
| Resolve outdated model names ( |
Audit & Plan (3)
Tool | Purpose |
| Scan local addon source without importing addon code. |
| Classify requirements into standard, configuration, Studio, custom module, avoid, or unknown. |
| Report expected modules, models, and discovery calls for sales, CRM, inventory, accounting, or HR. |
Knowledge search — local-first (3)
Tool | Purpose |
| Fetch a bounded record slice once and build a local BM25 index (accent-insensitive; data never leaves the machine). |
| Relevance-ranked free-text search over indexed records with zero further RPC calls. |
| Report per-model index sizes and the |
Accounting (2)
Tool | Purpose |
| Aged AR/AP report bucketed by days overdue (not due / 1-30 / 31-60 / 61-90 / 90+), with per-partner totals. |
| Open receivable/payable item counts plus the draft invoice backlog. |
Background tasks (4)
Tool | Purpose |
| Run an allowlisted long read operation ( |
| Poll a task's status and result. |
| Cancel a pending or running task. |
| List live and recently finished tasks. |
Cross-instance fan-out — read-only (3)
One question across many configured instances, merged and attributed. See the partner playbook.
Tool | Purpose |
| Search every opted-in instance (or a list/tag selection); rows tagged with |
| Group/aggregate per instance plus additive grand totals across the fleet. |
| AR/AP aging across every client DB with combined buckets — the partner-network sweep. |
Utility (2)
Tool | Purpose |
| Report non-secret MCP runtime posture, including rate-limit counters and field-ACL status when enabled. |
| List configured Odoo instance names, URLs, databases, transports, and cross-instance tags — never credentials. |
Resources
URI | Description |
| List available models. |
| Read model metadata and fields. |
| Read one record. |
| Search records with a bounded domain. |
Prompts
10 prompts: 5 diagnostic, plus 5 operational workflow prompts that encode end-to-end business processes and route every write through the approval gate.
Prompt | Use it for |
| Root-cause a failing Odoo call before retrying. |
| Turn raw requirements into Odoo fit/gap buckets. |
| Plan XML-RPC or JSON-RPC migration to External JSON-2. |
| Review a proposed |
| Audit local addon source with scan, risk, and business evidence. |
| Triage draft invoices and post each through the write gate with human checkpoints. |
| Three-way match a purchase order against receipt and bill; flags discrepancies (read-only). |
| Dedup-check, then gated-create a customer with contacts and payment terms. |
| Policy-check pending expense claims, then gated approve/refuse. |
| Read-only month-end checklist: aging, unreconciled items, draft backlog. |
Safe Write Model
Writes are intentionally boring.
preview_writecreates a canonical, non-executing payload.validate_writechecks model metadata, required fields, readonly fields, relation hints, record IDs, and payload shape.execute_approved_writeruns only when all gates pass:the approval came from
validate_writein the same server process,validation used trusted, non-empty live Odoo
fields_getmetadata,the token has not expired or been consumed,
confirm=trueis passed,ODOO_MCP_ENABLE_WRITES=1is set.
Odoo access rules, record rules, and server-side constraints still decide the final result.
Batch creates go through the same gates: pass values_list (one dict per
record, max 100) to preview_write/validate_write — execution maps to a
single atomic Odoo create(vals_list) call. Per-record differing write
values are deliberately unsupported (they would need one non-atomic RPC per
record). Optional extras: ODOO_MCP_ELICIT_WRITES=1 adds a native
human-confirmation form, ODOO_MCP_AUDIT_LOG records every write-path event.
Reviewed side-effect methods such as sale.order.action_confirm can be enabled
one by one:
export ODOO_MCP_ALLOWED_SIDE_EFFECT_METHODS="sale.order.action_confirm,res.partner.message_post"ODOO_MCP_ALLOW_UNKNOWN_METHODS=1 is still supported for trusted deployments,
but health_check reports it as broad mode. Prefer exact allowlist entries when
you only need a small number of reviewed methods.
Docker
Use the prebuilt GHCR image:
docker pull ghcr.io/tuanle96/mcp-odoo:latestOr build it locally:
docker build -t mcp/odoo:latest -f Dockerfile .Run over stdio from an MCP client (replace mcp/odoo:latest with ghcr.io/tuanle96/mcp-odoo:latest to use the prebuilt image):
{
"mcpServers": {
"odoo": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e", "ODOO_URL",
"-e", "ODOO_DB",
"-e", "ODOO_USERNAME",
"-e", "ODOO_PASSWORD",
"-e", "ODOO_TRANSPORT",
"-e", "ODOO_API_KEY",
"mcp/odoo:latest"
]
}
}
}Run Streamable HTTP locally:
docker run --rm \
-p 127.0.0.1:8000:8000 \
-e ODOO_URL \
-e ODOO_DB \
-e ODOO_USERNAME \
-e ODOO_PASSWORD \
-e ODOO_TRANSPORT \
-e ODOO_API_KEY \
mcp/odoo:latest \
--transport streamable-http \
--host 0.0.0.0 \
--port 8000 \
--allow-remote-httpTest
Run the normal quality gates:
uv run python -m ruff check .
uv run python -m mypy src
uv run python -m pytestRun real Odoo smoke tests:
uv run --python 3.12 --with-editable . scripts/odoo_compose_smoke.py \
--versions 16.0 17.0 18.0 19.0 \
--timeout 360 \
--inspector-smokeThe smoke harness boots disposable Docker Compose stacks, validates direct Odoo access, validates MCP stdio, and for Odoo 19 also validates JSON-2 and Streamable HTTP.
Run the multi-instance smoke (one stack, three databases, two accounts on one instance):
uv run --python 3.12 --with-editable . scripts/odoo_multi_instance_smoke.pyCompatibility
XML-RPC remains the default transport for broad compatibility. Odoo 19 supports External JSON-2 through ODOO_TRANSPORT=json2. XML-RPC and JSON-RPC are deprecated since Odoo 19 and scheduled for removal in Odoo 22 (fall 2028), so new integrations should plan for JSON-2.
Documentation
Guide | Covers |
How Odoo MCP compares to other Odoo MCP bridges | |
System shape, transports, safety boundaries | |
Multi-database config, routing, isolation model | |
From error text to root cause (ACL, record rules, routing) | |
Cache/retry knobs, batching patterns, N+1 detection | |
Claude Desktop, Docker, Streamable HTTP setups | |
Local gates and the Docker Compose smoke harness |
Contributing
Issues, pull requests, and compatibility reports are welcome. Start with CONTRIBUTING.md, include your Odoo version, transport, client type, and the verification you ran.
Security
Do not publish logs that contain Odoo credentials, API keys, database names from private environments, or full Odoo debug traces. Report vulnerabilities through SECURITY.md.
License
MIT. See LICENSE.
Maintenance
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/tuanle96/mcp-odoo'
If you have feedback or need assistance with the MCP directory API, please join our Discord server