/ 目录 / 演练场 / mcp-server-odoo
● 社区 ivnvxd ⚡ 即开即用

mcp-server-odoo

作者 ivnvxd · ivnvxd/mcp-server-odoo

Query and safely update any Odoo ERP model from chat — orders, contacts, products — with smart field selection and read-only guardrails.

mcp-server-odoo connects to any Odoo 16+ instance via XML-RPC. It exposes record search/read/create/update/delete with auto-selection of meaningful fields per model, plus a YOLO-read mode for any Odoo version. Use API key auth (recommended) or user/password.

为什么要用

核心特性

实时演示

实际使用效果

server-odoo.replay ▶ 就绪
0/0

安装

选择你的客户端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "server-odoo": {
      "command": "uvx",
      "args": [
        "mcp-server-odoo"
      ],
      "_inferred": true
    }
  }
}

打开 Claude Desktop → Settings → Developer → Edit Config。保存后重启应用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "server-odoo": {
      "command": "uvx",
      "args": [
        "mcp-server-odoo"
      ],
      "_inferred": true
    }
  }
}

Cursor 使用与 Claude Desktop 相同的 mcpServers 格式。项目级配置优先于全局。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "server-odoo": {
      "command": "uvx",
      "args": [
        "mcp-server-odoo"
      ],
      "_inferred": true
    }
  }
}

点击 Cline 侧栏中的 MCP Servers 图标,然后选 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "server-odoo": {
      "command": "uvx",
      "args": [
        "mcp-server-odoo"
      ],
      "_inferred": true
    }
  }
}

格式与 Claude Desktop 相同。重启 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "server-odoo",
      "command": "uvx",
      "args": [
        "mcp-server-odoo"
      ]
    }
  ]
}

Continue 使用服务器对象数组,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "server-odoo": {
      "command": {
        "path": "uvx",
        "args": [
          "mcp-server-odoo"
        ]
      }
    }
  }
}

加入 context_servers。Zed 保存后热重载。

claude mcp add server-odoo -- uvx mcp-server-odoo

一行命令搞定。用 claude mcp list 验证,claude mcp remove 卸载。

使用场景

实战用法: mcp-server-odoo

Answer ad-hoc sales questions against Odoo

👤 Ops managers, founders using Odoo as their source of truth ⏱ ~10 min beginner

何时使用: 'What were last week's top 5 customers by revenue?' — without writing XML-RPC.

前置条件
  • Odoo API key — Odoo: user profile > Preferences > API Keys > New
  • ODOO_URL, ODOO_DB, ODOO_API_KEY env vars — Set in your MCP client config
步骤
  1. List available models
    list_models — which Odoo models can we query in this instance?✓ 已复制
    → Model catalog with descriptions
  2. Run the query
    In sale.order, find orders with date_order between last Monday and today, group by partner_id, sum amount_total, top 5.✓ 已复制
    → Ranked customer list with totals
  3. Drill in
    For the top customer, show the last 3 orders with their line items.✓ 已复制
    → Detailed breakdown

结果: A business answer from ERP data without leaving chat.

注意事项
  • Multi-currency totals aren't converted — Specify currency_id in the filter, or convert in the LLM layer
  • ODOO_YOLO=true is dangerous in prod — Use ODOO_YOLO=read or leave unset; enable full access only in a staging DB
搭配使用: notion

Clean up stale CRM leads in Odoo

👤 Sales ops ⏱ ~30 min intermediate

何时使用: Leads pile up with no activity; you want to reassign or archive.

步骤
  1. Find stale leads
    In crm.lead, find leads where stage_id is not 'Won' and last activity > 60 days ago.✓ 已复制
    → Stale lead list
  2. Propose actions
    Classify each: archive, reassign to team lead, or ping current owner.✓ 已复制
    → Classification per lead
  3. Apply in batches (read-only first!)
    Dry run only: show what would change if I archived the 'archive' bucket.✓ 已复制
    → Dry-run summary; then confirm before update_record

结果: A cleaner pipeline with auditable changes.

注意事项
  • Archiving leads other teams depend on — Always dry-run first; tag archived leads rather than delete

Draft follow-ups for unpaid invoices

👤 AR and finance ⏱ ~25 min intermediate

何时使用: Monthly dunning run.

步骤
  1. Pull overdue invoices
    In account.move, find invoices where state='posted', payment_state='not_paid', invoice_date_due < today - 15.✓ 已复制
    → Overdue list with partner + amount
  2. Draft a polite follow-up per customer
    For each, draft an email in the customer's preferred language using ODOO_LOCALE settings.✓ 已复制
    → Per-invoice draft text

结果: Dunning emails ready to send (human still reviews).

组合

与其他 MCP 搭配,撬动十倍杠杆

server-odoo + notion

Pull a sales snapshot from Odoo, post to Notion for stakeholders

Run last-month sales by product category from Odoo, post as a Notion table under Finance / Monthly.✓ 已复制
server-odoo + postgres

Cross-reference Odoo data with a warehouse replica for heavy analytics

For top-10 Odoo customers, pull their web-session counts from the Postgres analytics DB.✓ 已复制

工具

此 MCP 暴露的能力

工具输入参数何时调用成本
list_models (none) First-run discovery 1 XML-RPC call
search_records model: str, domain?: filter, fields?: str[], limit?: int Any read query 1 XML-RPC call
get_record model, id Known id, need full detail 1 call
create_record model, values: object Only with ODOO_YOLO=true or API key granting write 1 call (write)
update_record model, id, values Writes — confirm first 1 call (write)
delete_record model, id Rarely — archive is usually better 1 call (write, destructive)
list_resource_templates (none) Explore available resource URIs free

成本与限制

运行它的成本

API 配额
Bounded by Odoo server; no per-call cost
每次调用 Token 数
Smart-field responses keep responses under 1k tokens per record
费用
Free; you need an Odoo instance (community or enterprise)
提示
Always pass explicit fields= on big models like product.template to avoid pulling 200 fields.

安全

权限、密钥、影响范围

最小权限: API key or user with read rights on the models you query
凭据存储: ODOO_API_KEY in env var; never commit to repo
数据出站: Calls to your Odoo instance only
切勿授予: ODOO_YOLO=true in production

故障排查

常见错误与修复

Access Denied on model

API key user doesn't have access rights for that model. Grant or switch user.

验证: Odoo: Settings > Users > Access Rights
Database not found

Set ODOO_DB explicitly; auto-detection fails when db listing is disabled.

验证: curl -d '{"jsonrpc":"2.0","method":"call","params":{"service":"db","method":"list"}}' $ODOO_URL/jsonrpc
MCP Odoo module not installed

In standard mode, install the mcp_odoo community module, or switch to ODOO_YOLO=read mode.

验证: Odoo: Apps > search mcp_odoo

替代方案

mcp-server-odoo 对比其他方案

替代方案何时用它替代权衡
Direct XML-RPC via fetch MCPYou only need one specific queryNo smart field selection; boilerplate-heavy
postgres MCP on Odoo's DBYou want raw SQL and can connect to the underlying PostgresBypasses Odoo ACLs — dangerous without care

更多

资源

📖 阅读 GitHub 上的官方 README

🐙 查看未解决的 issue

🔍 浏览全部 400+ MCP 服务器和 Skills