Skip to main content
Glama
MCP Odoo Bridge Server

MCP Odoo Bridge Server

by aadilakbar

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


Related MCP server: Odoo MCP Server

โœจ 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!

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


๐Ÿ“ 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

Available Tools

11 tools
count_recordsA
Count records matching a domain.

Args:
    model: The Odoo model name
    domain: Search filter as Odoo domain list

Returns:
    Number of matching records

Example:
    Count unpaid invoices: model='account.move', domain=[['payment_state', '!=', 'paid']]

Inputs: model (required), domain. Returns: result

create_recordA
Create a new record in Odoo.

Args:
    model: The Odoo model name
    values: Dictionary of field values for the new record

Returns:
    Success message with the new record ID

Example:
    Create customer: model='res.partner', values={'name': 'New Customer', 'email': 'new@example.com'}

Inputs: model (required), values (required). Returns: result

delete_recordB
Delete a record from Odoo.

Args:
    model: The Odoo model name
    record_id: The ID of the record to delete

Returns:
    Success message

โš ๏ธ WARNING: This action is irreversible!

Inputs: model (required), record_id (required). Returns: result

execute_methodA
Execute a custom method on an Odoo model.

Args:
    model: The Odoo model name
    method: The method name to call
    record_ids: Optional list of record IDs to call the method on
    args: Positional arguments for the method
    kwargs: Keyword arguments for the method

Returns:
    Method result

โš ๏ธ Note: This requires special permission in Odoo settings.

Example:
    Confirm sale order: model='sale.order', method='action_confirm', record_ids=[5]

Inputs: model (required), method (required), record_ids, args, +1 more. Returns: result

get_model_fieldsB
Get field definitions for an Odoo model.

Args:
    model: The Odoo model name
    field_types: Optional list of types to filter (e.g., ['many2one', 'char'])

Returns:
    List of fields with their types and descriptions

Inputs: model (required), field_types. Returns: result

get_recordB
Get a specific record by ID.

Args:
    model: The Odoo model name
    record_id: The ID of the record to retrieve
    fields: List of fields to return (empty = all accessible fields)

Returns:
    JSON object with the record data

Example:
    Get customer details: model='res.partner', record_id=5

Inputs: model (required), record_id (required), fields. Returns: result

get_record_nameC
Get the display name of a record (useful for looking up references).

Args:
    model: The Odoo model name
    record_id: The record ID

Returns:
    Display name of the record

Inputs: model (required), record_id (required). Returns: result

list_modelsA
List all Odoo models available for MCP access.

Returns:
    List of models with their permissions (read, create, update, delete)

Inputs: no named parameters. Returns: result

search_and_read_oneA
Search and return the first matching record (convenience method).

Args:
    model: The Odoo model name
    domain: Search filter as Odoo domain list
    fields: List of fields to return

Returns:
    The first matching record or a message if not found

Inputs: model (required), domain (required), fields. Returns: result

search_recordsA
Search for records in an Odoo model.

Args:
    model: The Odoo model name (e.g., 'res.partner', 'sale.order')
    domain: Search filter as Odoo domain list (e.g., [['is_company', '=', True]])
            Common operators: =, !=, >, <, >=, <=, like, ilike, in, not in
    fields: List of fields to return (empty = smart defaults)
    limit: Maximum records to return (default 80)
    offset: Number of records to skip (for pagination)
    order: Sort order (e.g., 'name asc, id desc')

Returns:
    JSON list of matching records

Examples:
    - Find all companies: model='res.partner', domain=[['is_company', '=', True]]
    - Find orders from this month: model='sale.order', domain=[['date_order', '>=', '2024-01-01']]
    - Find unpaid invoices: model='account.move', domain=[['payment_state', '!=', 'paid']]

Inputs: model (required), domain, fields, limit, +2 more. Returns: result

update_recordB
Update an existing record in Odoo.

Args:
    model: The Odoo model name
    record_id: The ID of the record to update
    values: Dictionary of field values to update

Returns:
    Success message

Example:
    Update customer phone: model='res.partner', record_id=5, values={'phone': '123-456-7890'}

Inputs: model (required), record_id (required), values (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelogโ€ฆ

    TDQS

    A3.8/5.0

    Scored across 11 tools

    Disambiguation5/5

    Every tool has a clearly distinct purpose with no ambiguity. Core CRUD operations (create_record, get_record, update_record, delete_record) are separate from search operations (search_records, search_and_read_one, count_records), metadata tools (list_models, get_model_fields), and specialized utilities (execute_method, get_record_name). The descriptions clearly differentiate each tool's specific function.

    Naming Consistency5/5

    All tools follow a consistent verb_noun naming pattern throughout (e.g., count_records, create_record, search_records). The naming is perfectly uniform with no deviations in style or convention, making the tool set highly predictable and readable.

    Tool Count5/5

    With 11 tools, this server is well-scoped for its purpose as an Odoo bridge. It provides comprehensive coverage of database operations (CRUD, search, count), metadata access, and specialized utilities without being overwhelming. Each tool earns its place in the set.

    Completeness5/5

    The tool surface provides complete CRUD/lifecycle coverage for the Odoo domain with no obvious gaps. It includes all essential operations (create, read, update, delete, search, count), metadata tools for discovery, and specialized utilities like execute_method for custom actions. The set enables full agent workflows without dead ends.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables LLMs to interact with Odoo ERP systems through MCP protocol. Supports multi-server architecture with secure authentication, allowing natural language access to Odoo data, resources, and business operations.
      -
    • A
      license
      B
      quality
      D
      maintenance
      An MCP server that enables AI assistants to interact with Odoo ERP apps like Inventory, CRM, Sales, and Manufacturing. It allows users to read, create, and manage Odoo records and workflows using natural language commands.
      25
      15 npm
      1
      ISC
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that connects AI assistants to Odoo ERP instances via the built-in XML-RPC API without requiring any additional addons. It enables users to search, create, update, and manage Odoo records and models through natural language.
      29 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      An MCP server that enables AI assistants to interact with Odoo ERP systems, allowing natural language access to business data, CRUD operations, and instance management without requiring Odoo module installation.
      1
      MIT