mcp-odoo-connector
Facilitates AI agent connectivity with Odoo ERP environments, offering structured access to fundamental elements like data schemas, records, and computational routines via a defined Model Context Protocol (MCP). This permits the execution of arbitrary Odoo functions, retrieval of personnel and leave records, and streamlines system linkage through adaptable configuration schemas and robust fault recovery mechanisms.
Author

tuanle96
Quick Info
Actions
Tags
Odoo Integration Server via MCP
This repository presents an MCP server implementation designed to bridge AI agents with established Odoo Enterprise Resource Planning (ERP) instances, granting interaction capabilities through the Model Context Protocol.
Core Capabilities
- Complete Odoo Interoperability: Unrestricted ingress to all Odoo data structures, individual data entries, and callable business logic.
- XML-RPC Foundation: Establishes secure, authenticated links to the Odoo deployment utilizing the XML-RPC standard.
- Configuration Versatility: Supports initialization via structured configuration files or environment variables.
- Resource Addressing: Employs Uniform Resource Identifier (URI) patterns for pinpointing Odoo data entities.
- Reliable Failure Management: Provides lucid diagnostic feedback for typical Odoo Application Programming Interface (API) exceptions.
- Sessionless Operation: Adheres to a clean request-response paradigm, ensuring predictable interaction cycles.
Available Toolset
- execute_method
- Invokes a specific, user-defined function on any designated Odoo model.
- Inputs:
model(text): The identifier for the Odoo class (e.g., 'res.partner').method(text): The name of the procedure to run.args(array, optional): Positional arguments passed to the function.kwargs(object, optional): Named arguments supplied.
-
Output: A structured dictionary confirming execution status and returning the method's result.
-
search_employee
- Performs a query to locate personnel records based on identifier names.
- Inputs:
name(text): The substring or full name used for filtering.limit(numeric, optional): Maximum quantity of results permitted (defaults to 20).
-
Output: A structured object indicating success, a list of matching employee names and unique identifiers, and any associated error narrative.
-
search_holidays
- Retrieves time-off records overlapping a defined temporal span.
- Inputs:
start_date(text): The beginning timestamp, formatted as YYYY-MM-DD.end_date(text): The concluding timestamp, formatted as YYYY-MM-DD.employee_id(numeric, optional): An optional identifier to restrict results to a single staff member.
- Output: An object confirming success, a roster of relevant holiday entries, and any error notes.
Resource Endpoints
- odoo://models
- Enumerates every accessible schema within the connected Odoo system.
-
Return Value: A JSON array detailing model attributes.
-
odoo://model/{model_name}
- Fetches detailed metadata for a specific data model, including its field definitions.
- Example:
odoo://model/res.partner -
Return Value: A JSON object containing schema metadata and field specifications.
-
odoo://record/{model_name}/{record_id}
- Fetches a single, specific data instance identified by its primary key.
- Example:
odoo://record/res.partner/1 -
Return Value: A JSON object containing the data payload of the retrieved record.
-
odoo://search/{model_name}/{domain}
- Executes a search operation against a model based on a provided search criterion (domain).
- Example:
odoo://search/res.partner/[["is_company","=",true]] - Return Value: A JSON array containing the found records (capped at 10 results by default).
Operational Setup
Odoo Connection Definition
- Initialization via a dedicated 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"
}
- Alternatively, configuration can be injected through system environment variables:
ODOO_URL: Address of the Odoo server.ODOO_DB: The active database identifier.ODOO_USERNAME: Credentials for authentication.ODOO_PASSWORD: Secret key or password.ODOO_TIMEOUT: Connection timeout setting in seconds (default is 30).ODOO_VERIFY_SSL: Boolean indicating whether to validate TLS/SSL certificates (default is true).HTTP_PROXY: Optional variable to route ODOO communication through a proxy server.
Integration with Claude Desktop Environment
To enable this service within the Claude Desktop configuration file (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"
}
}
}
}
Containerized Deployment (Docker)
Configuration snippet for container orchestration:
{
"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"
}
}
}
}
Deployment Procedures
Python Package Installation
Execute the following command to install via pip:
pip install odoo-mcp
Launching the Server
To start the service using the installed module:
odoo-mcp
For development or testing purposes:
mcp dev odoo_mcp/server.py
# Including supplementary libraries
mcp dev odoo_mcp/server.py --with pandas --with numpy
# Mounting local source code during iteration
mcp dev odoo_mcp/server.py --with-editable .
Image Construction
To create the latest Docker image:
docker build -t mcp/odoo:latest -f Dockerfile .
Input Parameter Specification Conventions
When invoking the Odoo MCP tools, adhere strictly to these guidelines for argument structure:
- Domain Argument Formatting: The search domain parameter accepts multiple structural representations:
- List/Tuple Structure:
[["field_name", "operator", value_instance], ...] - Object/Dictionary Structure:
{"conditions": [{"field": "...", "operator": "...", "value": "..."}]} - A serialized JSON string representing either of the above formats.
-
Examples:
- List:
[["is_company", "=", true]] - Object:
{"conditions": [{"field": "date_order", "operator": ">=", "value": "2025-03-01"}]} - Range Query:
[["date_order", ">=", "2025-03-01"], ["date_order", "<=", "2025-03-31"]]
- List:
-
Fields Argument Structure: This parameter must always be presented as an array listing desired field names:
["name", "email", "phone"]. The server attempts to interpret string inputs as JSON payloads.
Licensing
This specific MCP implementation is distributed under the terms of the MIT License.
== Contextual Information ==
[The following section regarding general business tools is preserved for broader context but may not directly describe the Odoo connector.]
Enterprise Management Systems Overview
Business management utilities encompass the entire spectrum of applications, regulatory frameworks, computational engines, organizational methodologies, and controls utilized by corporate entities to effectively navigate fluid market conditions, maintain competitive parity, and enhance operational throughput. These systems span functional divisions, addressing areas such as resource allocation, operational sequencing, data retention, human capital oversight, strategic assessment, performance monitoring, and governance.
The rapid technological advancements of the recent decade have profoundly reshaped this landscape, creating complexity in tool selection for diverse organizational requirements. This difficulty stems from persistent pressures to reduce expenditures while simultaneously escalating revenue generation, a deeper imperative to comprehend client requirements, and the necessity of delivering products tailored precisely to consumer expectations.
Consequently, leadership must adopt a strategic posture toward adopting these management instruments, rather than passively integrating the newest available solution. Over-reliance on uncustomized tools frequently results in organizational instability. Effective business utilities mandate meticulous selection followed by rigorous tailoring to the entity's specific operational needs, reversing the common error of adapting the organization to the toolset.
Global Tool Adoption Trends (2013 Survey)
A 2013 analysis by Bain & Company quantified the global utilization patterns of these essential business instruments, revealing regional priorities based on market dynamics and corporate performance indicators. The top ten strategic categories identified included:
Strategic planning Customer relationship management Employee engagement surveys Benchmarking Balanced scorecard Core competency Outsourcing Change management programs Supply chain management Mission statement and vision statement Market segmentation Total quality management
Software Applications in Commerce
Software defined as a suite of programs employed by personnel to execute diverse corporate functions is often termed business software or an enterprise application. These applications are engineered to augment productivity, quantitatively measure efficacy, and perform various tasks with high precision. The evolution proceeded from foundational Management Information Systems (MIS) to comprehensive Enterprise Resource Planning (ERP), subsequently incorporating Customer Relationship Management (CRM) capabilities, culminating in the current prevalence of cloud-native business management platforms.
While a direct relationship exists between Information Technology investments and corporate success, value addition is critically dependent on two factors: the excellence of the deployment methodology and the suitability of the chosen tools, optimized through a proper adaptation process.
Solutions Tailored for Small and Medium Enterprises (SMEs)
The toolsets prioritized for SMEs are crucial as they offer pathways to optimize capital use...
