AO

altinkaya-opensource/odoo-mcp

API 开发

本页由 AI 翻译,技术细节请以原文为准。 查看原文

5 stars 6 forks 质量 83 趋势 33AGPL-3.0

Model Context Protocol (MCP) for Odoo without any external dependencies

概览

A Model Context Protocol server that gives AI assistants full access to your Odoo ERP instance over XML-RPC. No Odoo module installation required. Just point it at any Odoo 12+ instance. No cloning required — just run directly from GitHub with uv: Block all write operations by adding READONLY_MODE=true. This also disables save_binary_field, because it writes files to the machine running the server: 🚫 Write tools and save_binary_field are disabled when READONLY_MODE=true. When you don't specify which fields to fetch, the server automatically picks the most useful ones. It scores fields based on type, importance patterns (state, amount, partner, etc.), and excludes noisy fields like message_ids, binary blobs, and computed non-stored fields. You always get id, name, display_name, and active. Pass fields=[""] to override and get everything. Domains can be passed as JSON strings, Python repr strings, or native lists:

README

以下为原文 README 节选,完整内容请查看原文。

🔌 mcp-server-odoo

A Model Context Protocol server that gives AI assistants full access to your Odoo ERP instance over XML-RPC.

No Odoo module installation required. Just point it at any Odoo 12+ instance.

🤖 AI Assistant (Claude Code, Claude Desktop, etc.)
       │ MCP (stdio)
       ▼
  📡 mcp-server-odoo
       │ XML-RPC
       ▼
  🏢 Odoo Instance

⚡ Quick Start

No cloning required — just run directly from GitHub with uv:

🖥️ With Claude Code

claude mcp add odoo \
    -e ODOO_URL=http://localhost:8069 \
    -e ODOO_DB=mydb \
    -e ODOO_USER=admin \
    -e ODOO_PASSWORD=admin \
    -- uvx --from git+https://github.com/altinkaya-opensource/odoo-mcp mcp-server-odoo

🖱️ With Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "odoo": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/altinkaya-opensource/odoo-mcp",
        "mcp-server-odoo"
      ],
      "env": {
        "ODOO_URL": "http://localhost:8069",
        "ODOO_DB": "mydb",
        "ODOO_USER": "admin",
        "ODOO_PASSWORD": "admin"
      }
    }
  }
}

🔒 Readonly Mode

Block all write operations by adding READONLY_MODE=true. This also disables save_binary_field, because it writes files to the machine running the server. Use download_binary_field instead: it is allowed in readonly mode and writes only inside ODOO_MCP_DOWNLOAD_DIR (by default ~/.cache/odoo-mcp):

claude mcp add odoo \
    -e ODOO_URL=http://localhost:8069 \
    -e ODOO_DB=mydb \
    -e ODOO_USER=admin \
    -e ODOO_PASSWORD=admin \
    -e READONLY_MODE=true \
    -- uvx --from git+https://github.com/altinkaya-opensource/odoo-mcp mcp-server-odoo

🛠️ Tools

📖 Read Operations

Tool Description
search_records 🔍 Search any model with domain filters, field selection, pagination, and sorting
read_record 📄 Read a single record by ID with smart field selection
get_record_count 🔢 Count records matching a domain filter (lightweight, no data fetched)
list_models 📋 List all non-transient models available in the database
get_model_fields 🏗️ Inspect field definitions (type, required, help text, etc.) for any model
read_group 📊 Group records and compute aggregations (sum, avg, count) with date granularity
save_binary_field 💾 Save a binary/image field from a record directly to a local file
download_binary_field 📥 Download a binary/image field into the configured download directory
在 GitHub 查看完整 README

安装

uvx --from git+https://github.com/altinkaya-opensource/odoo-mcp mcp-server-odoo
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "odoo": { "command": "uvx", "args": [ "--from", "git+https://github.com/altinkaya-opensource/odoo-mcp", "mcp-server-odoo" ], "env": { "ODOO_URL": "http://localhost:8069", "ODOO_DB": "mydb", "ODOO_USER": "admin", "ODOO_PASSWORD": "admin" } } } }