MCP server for Odoo ERP integration - enables AI assistants to interact with Odoo
Project description
MCP Server for Odoo
A Model Context Protocol (MCP) server that enables AI assistants to interact with Odoo ERP systems. This server provides tools for searching, creating, updating, and managing Odoo records through a standardized interface.
Demo
Features
- 🔍 Search Records: Query any Odoo model with complex domain filters
- ➕ Create Records: Add new records to any Odoo model
- ✏️ Update Records: Modify existing records
- 🗑️ Delete Records: Remove records from the system
- 📊 Read Records: Fetch detailed information about specific records
- 🔗 Execute Methods: Call custom methods on Odoo models
- 📋 List Models: Discover available models in your Odoo instance
- 🔧 Model Introspection: Get field definitions for any model
Installation
Via pip (recommended)
pip install odoo-mcp-server
From source
git clone https://github.com/vzeman/odoo-mcp-server.git
cd odoo-mcp-server
pip install -e .
Configuration
Environment Variables
Create a .env file in your project directory or set these environment variables:
ODOO_URL=https://your-instance.odoo.com
ODOO_DB=your-database-name
ODOO_USERNAME=your-username@example.com
ODOO_API_KEY=your-api-key-here
Getting Odoo Credentials
-
API Key:
- Log into your Odoo instance
- Go to Settings → Users & Companies → Users
- Select your user
- Under "API Keys" or "Security" tab, create a new API key
- Copy the key immediately (it won't be shown again)
-
Database Name:
- Usually visible in the URL when logged in
- Or check Settings → Activate Developer Mode → Database Info
-
Username:
- Your login email address
Usage with Claude Desktop
Add this configuration to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"odoo": {
"command": "python",
"args": ["-m", "mcp_server_odoo"],
"env": {
"ODOO_URL": "https://your-instance.odoo.com",
"ODOO_DB": "your-database",
"ODOO_USERNAME": "your-email@example.com",
"ODOO_API_KEY": "your-api-key"
}
}
}
}
Available Tools
search_records
Search for records in any Odoo model.
Parameters:
model(required): The Odoo model name (e.g., 'res.partner', 'sale.order')domain: Odoo domain filter (default: [])fields: List of fields to returnlimit: Maximum number of recordsoffset: Number of records to skiporder: Sort order (e.g., 'name asc, id desc')
Example prompts:
- "Find all customers in California"
- "Show me sales orders from last month"
- "List products with stock quantity below 10"
get_record
Get detailed information about specific records.
Parameters:
model(required): The Odoo model nameids(required): List of record IDsfields: List of fields to return (optional)
Example prompts:
- "Show me details of customer with ID 42"
- "Get information about sales order SO0123"
create_record
Create new records in Odoo.
Parameters:
model(required): The Odoo model namevalues(required): Dictionary of field values
Example prompts:
- "Create a new customer named 'Acme Corp' with email contact@acme.com"
- "Add a new product called 'Widget Pro' with price $99.99"
update_record
Update existing records.
Parameters:
model(required): The Odoo model nameids(required): List of record IDs to updatevalues(required): Dictionary of field values to update
Example prompts:
- "Update customer 42's phone number to +1-555-0123"
- "Change the status of sales order SO0123 to confirmed"
delete_record
Delete records from Odoo (use with caution).
Parameters:
model(required): The Odoo model nameids(required): List of record IDs to delete
Example prompts:
- "Delete the test customer record with ID 999"
- "Remove cancelled sales orders older than 2 years"
execute_method
Execute custom methods on Odoo models.
Parameters:
model(required): The Odoo model namemethod(required): Method name to executeids: List of record IDs (if method requires)args: Additional positional argumentskwargs: Additional keyword arguments
Example prompts:
- "Confirm sales order SO0123"
- "Send invoice INV/2024/0001 by email"
list_models
Discover available models in your Odoo instance.
Parameters:
transient: Include transient (wizard) models (default: false)
Example prompts:
- "What models are available in Odoo?"
- "Show me all installed models"
get_model_fields
Get field definitions for a model.
Parameters:
model(required): The Odoo model namefields: Specific fields to get info for (optional)
Example prompts:
- "What fields are available on the customer model?"
- "Show me the structure of sales orders"
Common Use Cases
Customer Management
"Find all customers who haven't made a purchase in 6 months"
"Create a new contact for Acme Corp named John Doe"
"Update the credit limit for customer 'BigCo Industries'"
Sales Operations
"Show me all draft quotations"
"Create a sales order for customer Acme Corp with 10 units of Product A"
"Convert quotation SO0123 to a confirmed order"
Inventory Management
"List all products with stock below reorder point"
"Update the quantity on hand for SKU-12345"
"Find all pending stock moves"
Financial Operations
"Show me all unpaid invoices"
"Create a vendor bill for Office Supplies Inc"
"List payments received today"
Model Reference
Common Odoo models you can interact with:
res.partner- Customers, suppliers, and contactssale.order- Sales orders and quotationsaccount.move- Invoices and billsproduct.product- Product variantsproduct.template- Product templatesstock.move- Stock movementspurchase.order- Purchase ordersproject.project- Projectsproject.task- Project taskshr.employee- Employeesres.users- System usersres.company- Companies
Security Considerations
- Store credentials securely using environment variables
- Use API keys instead of passwords when possible
- Grant minimum necessary permissions to the API user
- Regularly rotate API keys
- Monitor API usage through Odoo's logs
Troubleshooting
Authentication Failed
- Verify your API key is active in Odoo
- Check if the username is correct (usually your email)
- Ensure the database name matches exactly
Connection Refused
- Verify the Odoo URL (should not include
/web) - Check if your IP is whitelisted (if applicable)
- Ensure XML-RPC is enabled on your Odoo instance
Model Not Found
- The model might require additional modules to be installed
- Use
list_modelsto see available models - Check if you have permissions for that model
Development
Running Tests
pip install -e ".[dev]"
pytest
Type Checking
mypy mcp_server_odoo
Linting
ruff check .
ruff format .
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For issues and feature requests, please use the GitHub issue tracker.
Project details
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_server-0.1.3.tar.gz.
File metadata
- Download URL: odoo_mcp_server-0.1.3.tar.gz
- Upload date:
- Size: 3.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cae49fe7cc45df034527b7e1dddc0869e8c4ba25b4dd5db37d2e1a1120d00c64
|
|
| MD5 |
4a17451c36538c624d37755e0ce06c94
|
|
| BLAKE2b-256 |
1e1761ef8a1249fcecb8243465eecee6b5586f44489b1d22eaefcec62a9b52f8
|
File details
Details for the file odoo_mcp_server-0.1.3-py3-none-any.whl.
File metadata
- Download URL: odoo_mcp_server-0.1.3-py3-none-any.whl
- Upload date:
- Size: 21.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b38152ad73ccf04aeb263cfeaf249fe52cc1627d86d7e4d6eb499149e6548637
|
|
| MD5 |
77dc8e8314fdd75d78a3c58c7ccf7096
|
|
| BLAKE2b-256 |
b7a6a26faa5ceb57f7c43084b3e2e204f7e042c97721ec1d4c2ccab2cdd81b0a
|