The Odoo MCP Server is a robust and efficient implementation of the Model Context Protocol (MCP) designed to interact seamlessly with Odoo ERP systems. This server provides tools and resources to facilitate integration, automation, and enhanced functionality for Odoo-based workflows.
- Product Management: Retrieve product catalogs, search products, and get detailed product information
- Order Processing: Create sales orders, and retrieve order details
- Invoice Generation: Automatically create and post invoices from sales orders
- Payment Processing: Handle payment registration and processing workflows
- Multi-language Support: Support for English, Arabic, French, and Spanish product names
- Secure Authentication: XML-RPC based authentication with Odoo instances
The project follows a modular architecture with clear separation of concerns:
odoo-mcp-server/
├── src/mcpserver/
│ ├── __init__.py # Package initialization
│ ├── __main__.py # Application entry point
│ ├── config.py # Configuration management and validation
│ ├── deployment.py # MCP server deployment setup
│ ├── odoo_mcp_server.py # Core server implementation
│ └── tools.py # MCP tools and Odoo operations
├── pyproject.toml # Project configuration and dependencies
├── .python-version # Python version specification
└── README.md # Project documentation
- OdooMCPServer: Main server class handling Odoo connections and tool registration
- OdooConfig: Configuration management with environment variable validation
- OdooTools: Collection of MCP tools for Odoo operations
- FastMCP: MCP server framework integration
- Python 3.12 or higher
- Access to an Odoo instance (v17+ recommended)
- Valid Odoo user credentials with appropriate permissions
The MCP server runs on your local computer (where Claude Desktop is installed), not on your Odoo server. You need to install UV on your local machine:
macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | shWindows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"After installation, restart your terminal to ensure UV is in your PATH.
git clone git@github.com:sameeroz/odoo-mcp-server.git
cd odoo-mcp-serverUsing uv:
uv syncAdd this configuration to your MCP settings:
{
"mcpServers": {
"odoo": {
"command": "uv",
"args": ["run", "src/mcpserver/__main__.py"],
"env": {
"ODOO_URL": "https://your-odoo-instance.com",
"ODOO_USERNAME": "your-username-here",
"ODOO_PASSWORD": "your-password-here",
"ODOO_DATABASE": "your-database-name-here"
}
}
}
}Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"odoo": {
"command": "uv",
"args": ["run", "src/mcpserver/__main__.py"],
"env": {
"ODOO_URL": "https://your-odoo-instance.com",
"ODOO_USERNAME": "your-username-here",
"ODOO_PASSWORD": "your-password-here",
"ODOO_DATABASE": "your-database-name-here"
}
}
}
}Cursor
Add to ~/.cursor/mcp_settings.json:
{
"mcpServers": {
"odoo": {
"command": "uv",
"args": ["run", "src/mcpserver/__main__.py"],
"env": {
"ODOO_URL": "https://your-odoo-instance.com",
"ODOO_USERNAME": "your-username-here",
"ODOO_PASSWORD": "your-password-here",
"ODOO_DATABASE": "your-database-name-here"
}
}
}
}VS Code (with GitHub Copilot)
Add to your VS Code settings (~/.vscode/mcp_settings.json or workspace settings):
{
"github.copilot.chat.mcpServers": {
"odoo": {
"command": "uv",
"args": ["run", "src/mcpserver/__main__.py"],
"env": {
"ODOO_URL": "https://your-odoo-instance.com",
"ODOO_USERNAME": "your-username-here",
"ODOO_PASSWORD": "your-password-here",
"ODOO_DATABASE": "your-database-name-here"
}
}
}
}Zed
Add to ~/.config/zed/settings.json:
{
"context_servers": {
"odoo": {
"command": "uv",
"args": ["run", "src/mcpserver/__main__.py"],
"env": {
"ODOO_URL": "https://your-odoo-instance.com",
"ODOO_USERNAME": "your-username-here",
"ODOO_PASSWORD": "your-password-here",
"ODOO_DATABASE": "your-database-name-here"
}
}
}
}get_products
- Retrieve product catalog with optional language and limit parameters
- Supports: English (en), Arabic (ar), French (fr), Spanish (es)
get_product_details
- Get detailed information for a specific product by name
- Returns: name, price, description
get_order_details
- Retrieve sales order information with customizable fields
- Supports filtering by order IDs and field selection
create_order
- Create new sales orders with automatic invoice and payment processing
- Parameters: customer_name, product_id, create_invoice, finish_payment
# Get products in Arabic
products = await mcp_client.call_tool("get_products", {
"product_names_lang": "ar",
"limits": 10
})
# Create an order with invoice and payment
result = await mcp_client.call_tool("create_order", {
"customer_name": "John Doe",
"product_id": 123,
"create_invoice": True,
"finish_payment": True
})| Variable | Description | Required | Example |
|---|---|---|---|
ODOO_URL |
Odoo instance URL | Yes | https://demo.odoo.com |
ODOO_DATABASE |
Database name | Yes | demo_db |
ODOO_USERNAME |
Odoo username | Yes | admin |
ODOO_PASSWORD |
Odoo password | Yes | admin123 |
- URL must start with
http://orhttps:// - All environment variables are required
- Connection timeout: 30 seconds
OdooMCPServer: Main server orchestratorOdooConfig: Configuration management with validationOdooTools: MCP tool implementationsConfigValidationError: Custom exception for configuration errors
To add new MCP tools:
- Add the tool method to the
OdooToolsclass intools.py - Use the
@self.mcp.tool()decorator - Include proper type hints and docstrings
- Credentials: Store sensitive information in environment variables
- Validation: All inputs are validated before processing
- Error Handling: Sensitive information is not exposed in error messages
- Timeouts: Connection timeouts prevent hanging requests
- Permissions: Ensure Odoo user has minimal required permissions
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow PEP 8 style guidelines
- Add type hints to all functions
- Include comprehensive docstrings
- Write tests for new functionality
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
- Issues: Report bugs and feature requests via GitHub Issues
- Community: Join discussions in the project's GitHub Discussions
- Model Context Protocol - The underlying protocol specification
- Odoo - The ERP system this server integrates with
- FastMCP - The MCP server framework used
- Initial release
- Basic product and order management tools
- Invoice and payment processing
- Multi-language support
Made with ❤️ by Sameeroz for the MCP and Odoo communities