tuanle96_mcp_odoo

tuanle96_mcp_odoo

by tuanle96
An MCP server implementation that integrates with Odoo ERP systems, enabling AI assistants to interact with Odoo data and functionality.

Odoo MCP Server Integration

Overview

The Odoo MCP Server Integration is an implementation of the Model Context Protocol (MCP) that enables seamless interaction between AI assistants and Odoo ERP systems. This server provides a bridge for AI tools like Claude to access and manipulate Odoo data, offering a wide range of functionalities from searching records to executing custom methods.

Features

  • Comprehensive Odoo Integration: Full access to Odoo models, records, and methods.
  • XML-RPC Communication: Secure connection to Odoo instances via XML-RPC.
  • Flexible Configuration: Support for config files and environment variables.
  • Resource Pattern System: URI-based access to Odoo data structures.
  • Error Handling: Clear error messages for common Odoo API issues.
  • Stateless Operations: Clean request/response cycle for reliable integration.

Tools

Search Records

  • Inputs: model, domain, fields, limit
  • Returns: Matching records with requested fields.

Read Record

  • Inputs: model, id, fields
  • Returns: Record data with requested fields.

Create Record

  • Inputs: model, values
  • Returns: Dictionary with the new record ID.

Update Record

  • Inputs: model, id, values
  • Returns: Dictionary indicating success.

Delete Record

  • Inputs: model, id
  • Returns: Dictionary indicating success.

Execute Method

  • Inputs: model, method, args, kwargs
  • Returns: Dictionary with the method result.

Get Model Fields

  • Inputs: model
  • Returns: Dictionary with field definitions.

Search Employee

  • Inputs: name, limit
  • Returns: List of matching employee names and IDs.

Search Holidays

  • Inputs: start_date, end_date, employee_id
  • Returns: List of holidays found.

Resources

odoo://models

  • Returns: JSON array of model information.

odoo://model/{model_name}

  • Returns: JSON object with model metadata and field definitions.

odoo://record/{model_name}/{record_id}

  • Returns: JSON object with record data.

odoo://search/{model_name}/{domain}

  • Returns: JSON array of matching records (limited to 10 by default).

Configuration

Odoo Connection Setup

  1. Create a configuration file named odoo_config.json:
{
  "url": "https://your-odoo-instance.com",
  "db": "your-database-name",
  "username": "your-username",
  "password": "your-password-or-api-key"
}
  1. Alternatively, use environment variables:
  2. ODOO_URL
  3. ODOO_DB
  4. ODOO_USERNAME
  5. ODOO_PASSWORD
  6. ODOO_TIMEOUT
  7. ODOO_VERIFY_SSL
  8. HTTP_PROXY

Usage with Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "odoo": {
      "command": "python",
      "args": ["-m", "odoo_mcp"],
      "env": {
        "ODOO_URL": "https://your-odoo-instance.com",
        "ODOO_DB": "your-database-name",
        "ODOO_USERNAME": "your-username",
        "ODOO_PASSWORD": "your-password-or-api-key"
      }
    }
  }
}

Docker

{
  "mcpServers": {
    "odoo": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "-e", "ODOO_URL", "-e", "ODOO_DB", "-e", "ODOO_USERNAME", "-e", "ODOO_PASSWORD", "mcp/odoo"],
      "env": {
        "ODOO_URL": "https://your-odoo-instance.com",
        "ODOO_DB": "your-database-name",
        "ODOO_USERNAME": "your-username",
        "ODOO_PASSWORD": "your-password-or-api-key"
      }
    }
  }
}

Installation

Python Package

pip install odoo-mcp

Running the Server

# Using the installed package
odoo-mcp

# Using the MCP development tools
mcp dev odoo_mcp/server.py

# With additional dependencies
mcp dev odoo_mcp/server.py --with pandas --with numpy

# Mount local code for development
mcp dev odoo_mcp/server.py --with-editable .

Build

Docker Build

docker build -t mcp/odoo:latest -f Dockerfile .

Parameter Formatting Guidelines

Domain Parameter

  • Supported formats: List format, Object format, JSON string.
  • Examples:
  • List format: [["is_company", "=", true]]
  • Object format: {"conditions": [{"field": "date_order", "operator": ">=", "value": "2025-03-01"}]}
  • Multiple conditions: [["date_order", ">=", "2025-03-01"], ["date_order", "<=", "2025-03-31"]]

Fields Parameter

  • Should be an array of field names: ["name", "email", "phone"].

License

This MCP server is licensed under the MIT License.

About

Topics

Resources

License

Activity

Stars

Watchers

Forks

Releases

Contributors

Languages

Features & Capabilities

Categories
mcp_server model_context_protocol python docker odoo api_integration xml-rpc erp

Implementation Details

Stats

0 Views
34 GitHub Stars

Repository Info

tuanle96 Organization

Similar MCP Servers

continuedev_continue by continuedev
25049
21423
9300