MCP Odoo Bridge Server

MCP Odoo Bridge Server

Enables AI assistants to interact with Odoo data using natural language to search, read, create, and update records. It acts as a secure bridge between MCP clients and Odoo instances version 17.0 through 19.0.

Category
访问服务器

README

MCP Odoo Bridge Server

MCP Odoo Python License

Licensed under the Apache License, Version 2.0 - See LICENSE for details.

A Model Context Protocol (MCP) server that enables AI assistants like Claude to interact with Odoo data using natural language.

🎯 What is MCP?

The Model Context Protocol is an open standard by Anthropic that enables AI assistants to securely connect to external data sources. This server acts as a bridge between Claude (or other MCP clients) and your Odoo instance.

Learn more: MCP Documentation


✨ Features

Feature Description
🔍 Search Records Find records using natural language or Odoo domain syntax
📖 Read Records Get detailed record information by ID
📊 Count Records Get counts matching criteria
➕ Create Records Create new records (with permission)
✏️ Update Records Modify existing records (with permission)
🗑️ Delete Records Remove records (with permission)
📋 List Models Discover available models
🔧 Get Fields Understand model structure
⚡ Execute Methods Run custom methods (if enabled)
🔐 API Key Auth Secure authentication via API keys
📝 Audit Logging All operations logged for compliance

📋 Prerequisites

  1. Odoo instance (17.0, 18.0, or 19.0 recommended)
  2. Python 3.10+ installed
  3. AD Odoo MCP Bridge module installed in Odoo (see Odoo Module)

🚀 Installation

1. Clone the Repository

git clone https://github.com/yourusername/ad-mcp-bridge-server.git
cd ad-mcp-bridge-server

2. Install Dependencies

pip install -e .

Or with uv:

uv pip install -e .

3. Install the Odoo Module

Install the ad_odoo_mcp_bridge module in your Odoo instance:

  1. Add the module folder to your Odoo addons path
  2. Go to Apps → Install "AD Odoo MCP Bridge"

⚙️ Configuration

Environment Variables

The server requires the following environment variables:

Variable Required Description Example
ODOO_URL Yes Your Odoo instance URL https://mycompany.odoo.com
ODOO_API_KEY Yes* API key for authentication 0ef5b399e9ee9c11b053dfb6eeba8de473c29fcd
ODOO_USER Yes* Username (if not using API key) admin
ODOO_PASSWORD Yes* Password (if not using API key) admin
ODOO_DB No Database name (auto-detected if not set) mycompany
ODOO_MAX_RECORDS No Default max records per query (default: 100) 200
ODOO_TIMEOUT No Request timeout in seconds (default: 30) 60
ODOO_YOLO No YOLO mode - bypasses MCP security (⚠️ DEV ONLY) off, read, true

* Authentication: You must provide either ODOO_API_KEY or both ODOO_USER and ODOO_PASSWORD.

MCP Transport Options

Variable Required Description Example
MCP_TRANSPORT No Transport type: stdio or streamable-http (default: stdio) streamable-http
MCP_HOST No Host for HTTP transport (default: localhost) 0.0.0.0
MCP_PORT No Port for HTTP transport (default: 8000) 8080

YOLO Mode Values

Value Description
off All operations require explicit MCP Bridge permissions (default)
read Allows read-only operations on all models without configuration
true ⚠️ DANGEROUS - Allows all operations including write/delete without restrictions

⚠️ Warning: YOLO mode bypasses security checks and should NEVER be used in production. It's intended only for local development and testing.

Create a .env File (Optional)

ODOO_URL=https://mycompany.odoo.com
ODOO_DB=mycompany
ODOO_API_KEY=your-api-key-here

🔌 Usage with Claude Desktop

Step 1: Generate API Key in Odoo

  1. Go to MCP Bridge → Configuration → API Keys
  2. Click Create → Select user → Generate Key
  3. Copy the key (shown only once!)

Step 2: Configure Claude Desktop

Edit claude_desktop_config.json:

Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "odoo": {
      "command": "python",
      "args": ["-m", "ad_mcp_bridge_server"],
      "cwd": "/path/to/ad-mcp-bridge-server/src",
      "env": {
        "ODOO_URL": "http://localhost:8069",
        "ODOO_DB": "your_database",
        "ODOO_API_KEY": "your-api-key"
      }
    }
  }
}

Windows Note: Use the full Python path if needed:

"command": "C:\\path\\to\\venv\\Scripts\\python.exe"

Step 3: Restart Claude Desktop

Close and reopen Claude Desktop. You should see the 🔧 Tools icon.

Step 4: Start Chatting!

Try these prompts:

  • "Show me all customers from the United States"
  • "What's the status of order SO/2024/0153?"
  • "Create a new lead for ABC Company"
  • "How many unpaid invoices do we have?"

🔌 Usage with VS Code

Create .vscode/mcp.json in your workspace:

{
  "servers": {
    "odoo": {
      "command": "python",
      "args": ["-m", "ad_mcp_bridge_server"],
      "cwd": "/path/to/ad-mcp-bridge-server/src",
      "env": {
        "ODOO_URL": "http://localhost:8069",
        "ODOO_DB": "your_database",
        "ODOO_API_KEY": "your-api-key"
      }
    }
  }
}

🧪 Testing with MCP Inspector

Use the official MCP debugging tool:

npx @modelcontextprotocol/inspector python -m ad_mcp_bridge_server

This opens a web UI to test all tools interactively.


🏗️ Odoo Module

This MCP server requires the AD Odoo MCP Bridge module installed in Odoo.

Compatibility

Odoo Version Status
19.0 ✅ Fully Supported
18.0 ✅ Supported
17.0 ✅ Supported
16.0 ✅ Supported

Module Features

  • Model Configuration: Choose which models AI can access
  • Permission Control: Set read/create/update/delete per model
  • API Key Management: Generate and manage API keys
  • Audit Logging: Track all AI operations
  • Rate Limiting: Control request frequency
  • YOLO Mode: Quick access mode for development

Module Installation

  1. Copy ad_odoo_mcp_bridge folder to your Odoo addons path
  2. Restart Odoo
  3. Go to Apps → Remove "Apps" filter → Search "MCP" → Install

🔐 Security

  • API Key Authentication: All requests require a valid API key
  • Permission Inheritance: AI inherits Odoo user's permissions
  • Audit Trail: All operations logged with IP, timestamp, and details
  • Rate Limiting: Configurable per-key request limits
  • Field Exclusions: Sensitive fields can be blocked

📚 API Endpoints (Odoo Module)

The Odoo module exposes these JSON-RPC endpoints:

Endpoint Description
GET /mcp/health Health check
POST /mcp/info Server information
POST /mcp/models List enabled models
POST /mcp/fields Get model fields
POST /mcp/search Search records
POST /mcp/read Read record by ID
POST /mcp/count Count records
POST /mcp/create Create record
POST /mcp/write Update record
POST /mcp/unlink Delete record
POST /mcp/execute Execute method

🛠️ Development

Run Locally

cd src
export ODOO_URL=http://localhost:8069
export ODOO_DB=mydb
export ODOO_API_KEY=your-key
python -m ad_mcp_bridge_server

Project Structure

ad-mcp-bridge-server/
├── src/
│   └── ad_mcp_bridge_server/
│       ├── __init__.py
│       ├── __main__.py      # Entry point
│       ├── config.py        # Pydantic settings
│       ├── odoo_client.py   # Odoo HTTP client
│       └── server.py        # MCP server & tools
├── pyproject.toml
├── README.md
└── .env.example

📖 MCP Resources


🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

☕ Support

Thank you for using this project! If you find it helpful and would like to support my work, kindly consider buying me a coffee. Your support is greatly appreciated!

<a href="https://ko-fi.com/aadilakbar" target="_blank"> <img src="https://ko-fi.com/img/githubbutton_sm.svg" alt="Buy Me a Coffee at ko-fi.com" /> </a>

And don't forget to give the project a ⭐ star if you like it!


📄 License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.


🙏 Acknowledgments

  • Anthropic for Claude and MCP
  • Odoo for the amazing ERP platform
  • FastMCP for the Python MCP framework

📝 About

A Model Context Protocol (MCP) server that enables AI assistants to securely interact with Odoo ERP systems through standardized resources and tools for data retrieval and manipulation.

Made with ❤️ for the Odoo and AI community

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选