io.github.singleflo/odoo-assistant

io.github.singleflo/odoo-assistant

An MCP server that acts as a virtual Odoo employee, enabling LLMs to query, create, update, and execute workflows on Odoo records with configurable safety levels.

Category
访问服务器

README

<!-- mcp-name: io.github.singleflo/odoo-assistant -->

Odoo Assistant MCP Server

An Odoo virtual employee via the Model Context Protocol (MCP). This server exposes Odoo's business logic, records, and workflows to LLMs, allowing them to query, create, update, and act on Odoo data safely.

Quickstart

1. Install

Run the server directly:

uvx odoo-assistant

Or install it into your environment:

uv pip install odoo-assistant

Installing from source for development remains possible:

uv pip install git+https://github.com/singleflo/odoo-assistant-mcp

2. Configure Environment Variables

Two variables are required; everything else is discovered or has a default:

  • ODOO_BASE_URL: The base URL of your Odoo instance (e.g., https://mycompany.odoo.com).
  • ODOO_API_KEY: The Odoo API key (Odoo 14+, generate under Settings > Users > API Keys > New). An account password is not accepted: a key is per-user, scoped and revocable on its own.

Optional configuration:

  • ODOO_DB: The database name. Discovered automatically when the instance serves exactly one database; required when it serves several — the error names them all.
  • ODOO_USER: The login. Discovered from the key at the cost of up to 59 extra round trips; discovery fails if the key owner's uid is 60 or higher. Setting it saves the probe.
  • ODOO_MCP_MAX_LEVEL: The highest safety level this server may execute, 0 to 4 (default: 3). This is how you make the server read-only or let it delete — see Choosing the ceiling.
  • ODOO_MCP_PROTECTED_HOSTS: Comma-separated hosts this server refuses to write to (empty by default — no host is baked into the package). A listed host still allows reads; writing needs ODOO_ALLOW_PROD_WRITE=yes as a deliberate override.

Safety Layer

Every write and action passes through a dynamic safety classifier before reaching Odoo. Operations are classified into levels L0 to L5:

Level Name Description Default Status
L0 L0_READ Read-only queries (search_read, read, search_count). Allowed
L1 L1_WRITE Single record writes and creations. Allowed
L2 L2_BATCH Batch writes affecting multiple records. Allowed
L3 L3_STATE_CHANGE Workflow state transitions (e.g., confirming orders, posting invoices). Allowed
L4 L4_DESTRUCTIVE Destructive operations (e.g., unlink, action_cancel, archiving). Blocked
L5 L5_PRIVATE / L5_UNKNOWN Private methods or unknown operations. Blocked

Choosing the ceiling

ODOO_MCP_MAX_LEVEL sets the highest level this server may execute. Each value is cumulative — it permits its own level and everything below:

Value What it permits
0 Reads only.
1 + single-record writes and creations.
2 + batches above 5 records.
3 Default. + confirming orders, posting invoices, sending mail.
4 + unlink, action_cancel, archiving.
5 Accepted, but identical to 4 in effect — see below.

Two behaviours are worth knowing before you pick a number:

  • 5 does not unlock L5. Both L5 variants are refused before the ceiling is ever read. L5_PRIVATE is refused because Odoo itself rejects every method starting with _, so no ceiling could deliver it; L5_UNKNOWN is refused because a method nobody classified has, by definition, unreviewed effects. The way to allow such a method is to add it to WRITE_L1/L3/L4 in safety_layer.py — in code, reviewed — never through configuration.
  • An invalid value refuses startup. ODOO_MCP_MAX_LEVEL="O" raises rather than falling back to the default, because the fallback is write-capable: a typo must not hand you a writing server you believed was read-only.

The ceiling is set out of band, by a human, and read from the process environment at startup. The model running against this server cannot raise it; when a call exceeds the ceiling the refusal names the level required, so the agent can explain what the operation would change and leave the decision to you.

Note that this is the authority of this server, not of the account. An agent with shell access can always bypass an MCP server by invoking Odoo directly. A limit that must hold regardless of the client belongs in the Odoo access rights of the user the API key belongs to, where the Odoo server enforces it.

Odoo Version Support

Odoo 14.0 is the absolute minimum supported version because this server authenticates using API keys only, which do not exist in Odoo 13 or earlier.

Odoo Version API Keys XML-RPC Officially Maintained (Aug 2026) Support Level / Notes
≤ 13.0 No Yes No Unsupported. Cannot authenticate with this server.
14.0 Yes Yes No Protocol-compatible. Untested against a live instance.
15.0 Yes Yes No Protocol-compatible. Untested against a live instance.
16.0 Yes Yes No Protocol-compatible. Untested against a live instance.
17.0 Yes Yes Yes (until Sep 2026) Protocol-compatible. Untested against a live instance.
18.0 Yes Yes Yes (until Sep 2027) Primary target. Verified and fully supported against a live instance.
19.0 Yes Yes Yes (until Sep 2028) Protocol-compatible. Untested against a live instance. API keys require description and expiry (max 3 months).

API Key Generation Path

To generate an API key, log in to your Odoo instance and navigate to: Preferences / My Profile → Account Security → New API Key

Transport & Deprecation Note

The client automatically detects if the native JSON-2 API is available at /json/2/<model>/<method> (which uses Authorization: bearer <API_KEY>) and falls back to XML-RPC if it is not. Please note that XML-RPC and JSON-RPC are deprecated in Odoo 19 and scheduled for removal in Odoo 22.

Sources

Tools and Resources

The server exposes 19 tools and 2 resource types:

Tools

  1. search_read: Search and read records in one call (Odoo search_read).
  2. read_record: Read one record by id, always with named fields.
  3. count_records: Count the records matching a domain (Odoo search_count).
  4. instance_overview: Summarise the connected instance: version, companies, volumes per area, in-house modules, anomalies.
  5. required_fields: List what Odoo demands before a create on a model, the default it would apply, and how existing records actually use it.
  6. create_record: Create a record, reusing an existing match when unique_on is given.
  7. write_record: Write field values to one record and report what actually changed.
  8. run_action: Run a workflow method and report the state it left behind.
  9. cancel_record: Cancel a record through action_cancel, following the wizard it returns.
  10. notify_user: Notify users on a record's chatter. Internal by default.
  11. create_activity: Schedule an activity: the only notification that carries a deadline.
  12. download_docs: Save every document of a record to disk, chatter files included.
  13. generate_pdf: Render the PDF of a record and return where it was saved.
  14. list_message_targets: List who can be messaged and where — internal users with presence (online/away/offline) and the caller's open conversations. Ask this before sending.
  15. read_conversation: Read a Discuss conversation, newest first.
  16. send_direct_message: Send a 1-to-1 Discuss message that appears in the user's chat systray in real time — no email, reaches them whatever their notification setting says.
  17. send_channel_message: Post to an existing Discuss channel, refusing a room that holds a non-employee.
  18. explore_module: Discover a module's structure by interrogating the live instance.
  19. list_known_modules: List the modules this server has learned: name, generation date, records.

Tools 10-11 (notify_user, create_activity) notify ABOUT a record and land in the Inbox bell; tools 14-17 are Discuss conversations that land in the chat systray. "Message user X" is the second kind — send_direct_message, not notify_user.

Resources

  • odoo://skill: Access the Odoo assistant skill instructions.
  • odoo://ref/*: Access generated reference documentation for explored modules.

Host Configuration Examples

Every example below carries only what matters: the two required variables, and the ceiling — the one setting that decides whether this server can write, made visible in the file the human owns. The database and the login are discovered, and 3 is the ceiling's default. Note the quotes: environment values are strings.

Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "odoo-assistant": {
      "command": "uvx",
      "args": [
        "odoo-assistant"
      ],
      "env": {
        "ODOO_BASE_URL": "https://mycompany.odoo.com",
        "ODOO_API_KEY": "your-api-key-here",
        "ODOO_MCP_MAX_LEVEL": "3"
      }
    }
  }
}

Cursor

Add this to your .cursor/mcp.json or configure it in the Cursor settings UI:

{
  "mcpServers": {
    "odoo-assistant": {
      "command": "uvx",
      "args": [
        "odoo-assistant"
      ],
      "env": {
        "ODOO_BASE_URL": "https://mycompany.odoo.com",
        "ODOO_API_KEY": "your-api-key-here",
        "ODOO_MCP_MAX_LEVEL": "3"
      }
    }
  }
}

VS Code Copilot

Add this to your VS Code settings.json:

{
  "mcp.servers": {
    "odoo-assistant": {
      "command": "uvx",
      "args": [
        "odoo-assistant"
      ],
      "env": {
        "ODOO_BASE_URL": "https://mycompany.odoo.com",
        "ODOO_API_KEY": "your-api-key-here",
        "ODOO_MCP_MAX_LEVEL": "3"
      }
    }
  }
}

opencode

Add this to opencode.json or .opencode/opencode.json in your project, or to ~/.config/opencode/opencode.json to make the server available everywhere:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "odoo-assistant": {
      "type": "local",
      "enabled": true,
      "command": [
        "uvx",
        "odoo-assistant"
      ],
      "timeout": 120000,
      "environment": {
        "ODOO_BASE_URL": "https://mycompany.odoo.com",
        "ODOO_API_KEY": "your-api-key-here",
        "ODOO_MCP_MAX_LEVEL": "3"
      }
    }
  }
}

opencode's shape differs from the hosts above in ways it rejects outright: the key is mcp (not mcpServers), type is required, command is a single array holding the program and its arguments (there is no separate args), and the environment block is environment (not env).

Set timeout deliberately. It defaults to 5000 ms, and the first call of a session pays for authentication plus, for instance_overview, dozens of XML-RPC round trips — comfortably past five seconds against a real instance.

opencode reads its config once at startup and does not hot-reload it, so quit and restart after editing. Anything you change here — the ceiling included — takes effect only on the next launch.

ChatGPT (Custom Connectors)

To connect this server to ChatGPT via Custom Connectors:

  1. Go to Settings → Connectors → Add Connector.
  2. Enter the server URL or select from the Registry.
  3. Enter your Odoo credentials when prompted.

Hermes

Add the server using the Hermes CLI:

hermes mcp add odoo-assistant \
  --env ODOO_BASE_URL=https://mycompany.odoo.com \
  --env ODOO_API_KEY=your-api-key-here \
  --env ODOO_MCP_MAX_LEVEL=3 \
  --args run odoo-assistant

The examples omit the optional variables. Set ODOO_DB when the instance serves several databases, ODOO_USER to skip the uid probe, and ODOO_MCP_MAX_LEVEL to change the ceiling from its default of 3.

License

This project is licensed under the MIT License. See the LICENSE file for details.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选