MCP Server for Odoo Integration
Project description
Odoo MCP Server
An MCP server implementation that integrates with Odoo ERP systems, enabling AI assistants to interact with Odoo data and functionality through the Model Context Protocol.
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
- Search for records in any Odoo model
- Inputs:
model(string): The model name (e.g., 'res.partner')domain(array): Search domain (e.g., [['is_company', '=', true]])fields(optional array): Optional fields to fetchlimit(optional number): Maximum number of records to return
- Returns: Matching records with requested fields
-
read_record
- Read details of a specific record
- Inputs:
model(string): The model name (e.g., 'res.partner')id(number): The record IDfields(optional array): Optional fields to fetch
- Returns: Record data with requested fields
-
create_record
- Create a new record in Odoo
- Inputs:
model(string): The model name (e.g., 'res.partner')values(object): Dictionary of field values
- Returns: Dictionary with the new record ID
-
update_record
- Update an existing record
- Inputs:
model(string): The model name (e.g., 'res.partner')id(number): The record IDvalues(object): Dictionary of field values to update
- Returns: Dictionary indicating success
-
delete_record
- Delete a record from Odoo
- Inputs:
model(string): The model name (e.g., 'res.partner')id(number): The record ID
- Returns: Dictionary indicating success
-
execute_method
- Execute a custom method on an Odoo model
- Inputs:
model(string): The model name (e.g., 'res.partner')method(string): Method name to executeargs(optional array): Positional argumentskwargs(optional object): Keyword arguments
- Returns: Dictionary with the method result
-
get_model_fields
- Get field definitions for a model
- Inputs:
model(string): The model name (e.g., 'res.partner')
- Returns: Dictionary with field definitions
Resources
-
odoo://models
- Lists all available models in the Odoo system
- Returns: JSON array of model information
-
odoo://model/{model_name}
- Get information about a specific model including fields
- Example:
odoo://model/res.partner - Returns: JSON object with model metadata and field definitions
-
odoo://record/{model_name}/{record_id}
- Get a specific record by ID
- Example:
odoo://record/res.partner/1 - Returns: JSON object with record data
-
odoo://search/{model_name}/{domain}
- Search for records that match a domain
- Example:
odoo://search/res.partner/[["is_company","=",true]] - Returns: JSON array of matching records (limited to 10 by default)
Configuration
Odoo Connection Setup
- 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"
}
- Alternatively, use environment variables:
ODOO_URL: Your Odoo server URLODOO_DB: Database nameODOO_USERNAME: Login usernameODOO_PASSWORD: Password or API keyODOO_TIMEOUT: Connection timeout in seconds (default: 30)ODOO_VERIFY_SSL: Whether to verify SSL certificates (default: true)
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
When using the MCP tools for Odoo, pay attention to these parameter formatting guidelines:
-
Domain Parameter:
- The following domain formats are supported:
- List format:
[["field", "operator", value], ...] - Object format:
{"conditions": [{"field": "...", "operator": "...", "value": "..."}]} - JSON string of either format
- List format:
- 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"]]
- List format:
- The following domain formats are supported:
-
Fields Parameter:
- Should be an array of field names:
["name", "email", "phone"] - The server will try to parse string inputs as JSON
- Should be an array of field names:
License
This MCP server is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file odoo_mcp-0.0.2.tar.gz.
File metadata
- Download URL: odoo_mcp-0.0.2.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c27f5ba4480d69c605dadbd18ce535d8a8289f044beaf8400c6462536f44383b
|
|
| MD5 |
554079399b3cf7ce034dae9c0faf580e
|
|
| BLAKE2b-256 |
7dda7f5a7ac2b6b747392219342e6b2bf9f6b8c579a3d0e8bf6efda2bb75801d
|
File details
Details for the file odoo_mcp-0.0.2-py3-none-any.whl.
File metadata
- Download URL: odoo_mcp-0.0.2-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68f81b3746d971dd5450d7ffe2ac7757e9d0b20c6d63f4632559e82be218689a
|
|
| MD5 |
67228e3f179148cfedcce6cbfa6c6838
|
|
| BLAKE2b-256 |
41ca3a16bfb32227bae671c51c54cb1ced655c0f90c3072aab76286630522f08
|