Odoo MCP
Safety-first Model Context Protocol server for Odoo that enables AI assistants to safely inspect records, explain business data, prepare controlled changes, and rollback supported operations.
README
Odoo MCP
Safety-first Model Context Protocol server for Odoo 16, 17, 18, and 19. It uses standard MCP transports, so it can be connected to Codex, Claude Code, Google Antigravity, Gemini, and other MCP clients.
What It Does
Odoo MCP lets an AI assistant safely inspect Odoo records, explain business data, inspect model fields, prepare controlled changes, record those changes, and roll supported changes back.
Typical uses include:
- Accounting review and exception reporting
- Implementation and configuration inspection
- Audit queries and MCP change-history review
- Website page, menu, view, and theme work
- Safe, approved updates to supported Odoo records
Documentation
- Quick start
- Odoo authorization
- Codex, Claude, Antigravity, and MCP client configuration
- Security policy
Requirements
- Python 3.10 or newer
- Odoo 16, 17, 18, or 19
- An Odoo user permitted to use the required applications and records
- An API key generated for that Odoo user
- An MCP-compatible client such as Codex, Claude Code, or Antigravity
Use a dedicated Odoo bot user. Do not connect the main administrator account.
Installation
Clone the repository after it is published:
git clone https://github.com/techniondigitalsolutions/odoo-mcp.git
cd odoo-mcp
For the current local checkout:
cd /Users/osamahalnihmi/odoo-mcp
Create an isolated Python environment and install the server:
python3 -m venv .venv
. .venv/bin/activate
pip install -e .
Windows PowerShell:
py -m venv .venv
.venv\Scripts\Activate.ps1
pip install -e .
The MCP command is:
/absolute/path/odoo-mcp/.venv/bin/python -m odoo_mcp.server
Always use an absolute path in the AI client's configuration.
Odoo Authorization
Create a dedicated Odoo user such as:
Name: Odoo MCP Bot
Login: odoo-mcp@example.com
Grant only the minimum access groups required for its job:
- Auditor: read access to the applications being reviewed
- Accountant assistant: required accounting read access
- Implementer: access only to relevant implementation areas
- Website editor: minimum website editing permissions
Then generate an API key:
- Sign in as the dedicated user.
- Open the user menu and select Preferences or My Profile.
- Open Account Security.
- Select New API Key.
- Use a description such as
Odoo MCP - laptop. - Select the shortest practical expiration.
- Generate and securely store the key.
Odoo normally displays the complete key only once. Never commit it to Git or paste it into prompts, screenshots, issues, skills, or documentation.
Environment
Every MCP client configuration must provide:
ODOO_URL=https://your-company.odoo.com
ODOO_DATABASE=database-name
ODOO_USERNAME=odoo-mcp@example.com
ODOO_API_KEY=your-private-api-key
ODOO_API_MODE=auto
ODOO_ALLOW_MUTATIONS=false
ODOO_API_MODE=auto selects XML-RPC for Odoo 16-18 and JSON-2 for Odoo 19.
Keep mutations disabled until read operations and Odoo permissions are tested.
Optional limits:
ODOO_MAX_READ_RECORDS=100
ODOO_MAX_MUTATION_RECORDS=20
ODOO_PLAN_TTL_SECONDS=300
ODOO_JOURNAL_PATH=~/.local/state/odoo-mcp/journal.sqlite3
Codex Configuration
Add this to the user Codex configuration, normally ~/.codex/config.toml:
[mcp_servers.odoo]
command = "/absolute/path/odoo-mcp/.venv/bin/python"
args = ["-m", "odoo_mcp.server"]
[mcp_servers.odoo.env]
ODOO_URL = "https://your-company.odoo.com"
ODOO_DATABASE = "database-name"
ODOO_USERNAME = "odoo-mcp@example.com"
ODOO_API_KEY = "your-private-api-key"
ODOO_API_MODE = "auto"
ODOO_ALLOW_MUTATIONS = "false"
Restart Codex after saving the configuration.
Claude Code Configuration
Register the local server:
claude mcp add odoo \
--env ODOO_URL=https://your-company.odoo.com \
--env ODOO_DATABASE=database-name \
--env ODOO_USERNAME=odoo-mcp@example.com \
--env ODOO_API_KEY=your-private-api-key \
--env ODOO_API_MODE=auto \
--env ODOO_ALLOW_MUTATIONS=false \
-- /absolute/path/odoo-mcp/.venv/bin/python -m odoo_mcp.server
Restart Claude Code after registering the server.
Antigravity And Other MCP Clients
Add a local stdio server through the client's MCP settings:
{
"servers": {
"odoo": {
"type": "stdio",
"command": "/absolute/path/odoo-mcp/.venv/bin/python",
"args": ["-m", "odoo_mcp.server"],
"env": {
"ODOO_URL": "https://your-company.odoo.com",
"ODOO_DATABASE": "database-name",
"ODOO_USERNAME": "odoo-mcp@example.com",
"ODOO_API_KEY": "your-private-api-key",
"ODOO_API_MODE": "auto",
"ODOO_ALLOW_MUTATIONS": "false"
}
}
}
}
Client configuration formats vary. The required concept is always a local
stdio command, argument list, and private per-server environment variables.
Additional examples are available in config/.
Install The Built-In Skill
The repository includes the portable
odoo-website-theme-design skill.
Codex:
ln -s /absolute/path/odoo-mcp/skills/odoo-website-theme-design \
~/.codex/skills/odoo-website-theme-design
Claude Code and the current local Antigravity build:
ln -s /absolute/path/odoo-mcp/skills/odoo-website-theme-design \
~/.claude/skills/odoo-website-theme-design
On systems without symlink support, copy the complete skill directory instead.
Test The Connection
Restart the AI client and ask:
Use
odoo_connection_infoand report the Odoo version, protocol, mutation status, and rollback scope.
The initial result should show mutations_enabled: false.
Then test a small read:
Use
odoo_search_readonres.company, request onlyname, and return at most five records.
If access is denied, adjust the dedicated Odoo user's permissions rather than switching to an administrator account.
Enable Safe Changes
Change the client environment only after read-only testing succeeds:
ODOO_ALLOW_MUTATIONS=true
Restart the client. Supported changes follow this sequence:
- The AI calls
preview_odoo_mutation. - You review the exact model, record IDs, and values.
- You explicitly approve the change.
- The AI calls
apply_odoo_mutationwith the single-use preview token. - The MCP journals the previous state and verifies the result.
- The MCP returns a
change_id.
Keep the change_id when the change may need to be reversed.
Rollback
Ask the AI to call:
rollback_change(change_id)
Rollback currently restores supported scalar-field writes and removes records created through this MCP. It refuses to overwrite records changed again after the original MCP operation.
Rollback cannot reverse sent emails, webhooks, payments, custom automation side effects, or changes made outside this MCP. Maintain normal Odoo database backups.
Safety Model
- Read-only by default: set
ODOO_ALLOW_MUTATIONS=trueto enable changes. - No generic method execution and no direct delete tool.
- Sensitive models and fields are blocked or redacted.
- Every mutation requires a short-lived preview token.
- An owner-only local snapshot is journaled before each change.
- Every action is written to a local SQLite audit journal.
rollback_changerestores writes and removes records created by this MCP.- Rollback refuses to overwrite records changed again after the MCP operation.
- Record counts, fields, models, and values are bounded by policy.
Rollback covers Odoo records changed through this server. It does not replace database backups and cannot reverse external side effects such as sent email, webhooks, payment operations, or custom automation triggered by a write. The initial rollback engine permits scalar-field writes only; relational field changes require a future relation-aware snapshot format.
Credentials are read only from environment variables and are never returned by tools or stored in the journal.
Troubleshooting
Authentication Failed
- Verify that the login belongs to the API key's user.
- Confirm that the key is complete, active, and unexpired.
- Confirm that the URL and database belong to the same Odoo instance.
Access Denied
Authentication succeeded, but the dedicated user lacks a required access group, model permission, or record-rule permission. Grant only the missing access.
MCP Server Does Not Appear
- Use an absolute Python path.
- Confirm installation with
.venv/bin/pip show odoo-mcp. - Restart the AI client.
- Check that the client's JSON or TOML syntax is valid.
Changes Are Disabled
This is the expected default. Review the authorization and rollback behavior
before setting ODOO_ALLOW_MUTATIONS=true.
Development
.venv/bin/python -m unittest discover -s tests
.venv/bin/ruff check .
.venv/bin/python -m compileall src
The bundled website skill is in
skills/odoo-website-theme-design.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。