jmceleney/odoo-mcp
If you are the rightful owner of odoo-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Odoo MCP Server is a Model Context Protocol server that integrates Odoo functionality with AI assistants like Claude, enabling seamless interaction and data manipulation.
Odoo MCP - Model Context Protocol Server for Odoo
This package provides a Model Context Protocol (MCP) server that exposes Odoo functionality to AI assistants like Claude.
Features
- XML-RPC communication with Odoo
- Model discovery and inspection
- Data querying
- MCP server for AI integration
Installation
Using Claude Code (Recommended)
The easiest way to use this MCP server with Claude Code is via uvx:
# Install with environment variables
claude mcp add --transport stdio odoo \
--env ODOO_URL=https://your-odoo-server.com \
--env ODOO_DB=your_database_name \
--env ODOO_USERNAME=your_username \
--env ODOO_PASSWORD=your_password \
--env MODEL_EXCLUSION_PREFIXES=ir.,mail.,bus.,base. \
-- uvx --from git+https://github.com/jmceleney/odoo-mcp odoo-mcp
Using with Cursor IDE
To use this MCP server with Cursor IDE, you need to configure it in your MCP settings file.
Prerequisites:
- Cursor version 0.47.x or above
- Node.js v18.x.x or above
Configuration Steps:
-
Create or edit the MCP configuration file at
~/.cursor/mcp.json(for global settings) or.cursor/mcp.jsonin your project directory (for project-specific settings) -
Add the Odoo MCP server configuration:
{
"mcpServers": {
"odoo": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/jmceleney/odoo-mcp",
"odoo-mcp"
],
"env": {
"ODOO_URL": "https://your-odoo-server.com",
"ODOO_DB": "your_database_name",
"ODOO_USERNAME": "your_username",
"ODOO_PASSWORD": "your_password",
"MODEL_EXCLUSION_PREFIXES": "ir.,mail.,bus.,base."
}
}
}
}
-
Restart Cursor IDE to load the new configuration
-
The Odoo MCP tools will now be available in Cursor's AI chat. You can ask Cursor to use them, for example: "Please use the Odoo MCP to list all customer models"
Using with .env file:
If you prefer to keep credentials in a .env file, omit the env section from the configuration and ensure your .env file is in your project directory.
Using with VSCode and GitHub Copilot
To use this MCP server with Visual Studio Code and GitHub Copilot, you'll need to configure it as an MCP server.
Prerequisites:
- Visual Studio Code version 1.99 or later (1.102+ recommended for general availability features)
- GitHub Copilot and GitHub Copilot Chat extensions installed and enabled
- Node.js installed for using
uvx - MCP policy enabled by your organisation administrator (if applicable)
Configuration Steps:
Option 1: Using the Command Palette (Recommended)
- Open VS Code and press
Ctrl+Shift+P(Windows/Linux) orCmd+Shift+P(Mac) - Type "MCP: Add Server" and select it
- Choose whether to add globally or to your workspace
- When prompted, manually edit the configuration file that opens
Option 2: Manual Configuration
-
Create or edit the MCP configuration file:
- For workspace-specific: Create
.vscode/mcp.jsonin your project root - For global settings: Run
MCP: Open User Configurationfrom the Command Palette
- For workspace-specific: Create
-
Add the Odoo MCP server configuration:
{
"servers": {
"odoo": {
"type": "stdio",
"command": "uvx",
"args": [
"--from",
"git+https://github.com/jmceleney/odoo-mcp",
"odoo-mcp"
],
"env": {
"ODOO_URL": "https://your-odoo-server.com",
"ODOO_DB": "your_database_name",
"ODOO_USERNAME": "your_username",
"ODOO_PASSWORD": "your_password",
"MODEL_EXCLUSION_PREFIXES": "ir.,mail.,bus.,base."
}
}
}
}
- Save the file and reload VS Code
Using the MCP Server:
- Open GitHub Copilot Chat in VS Code (click the Copilot icon in the sidebar)
- Select Agent Mode from the dropdown menu
- Click the tools 🔧 icon to view available MCP tools
- The Odoo MCP tools should now be available
- You can ask Copilot to use them, for example: "Use the Odoo MCP to search for customers"
Using with .env file:
If you prefer to keep credentials in a .env file in your project directory, you can omit the env section from the configuration, and the MCP server will read from the .env file automatically.
Note: Copilot may automatically suggest MCP tools when relevant, or you can explicitly request them in your prompts. By default, VS Code will ask for permission before activating MCP tools.
Configuration with .env file
Alternatively, create a .env file in your project directory:
# .env
ODOO_URL=https://your-odoo-server.com
ODOO_DB=your_database_name
ODOO_USERNAME=your_username
ODOO_PASSWORD=your_password
MODEL_EXCLUSION_PREFIXES=ir.,mail.,bus.,base.
Then add the MCP server without environment variables (it will read from .env):
claude mcp add --transport stdio odoo -- uvx --from git+https://github.com/jmceleney/odoo-mcp odoo-mcp
Verify Installation
Check that the server is configured:
claude mcp list
You should see odoo in the list of configured MCP servers.
Remove the Server
If you need to remove the server:
claude mcp remove odoo
Local Development Installation
For local development, install the package in editable mode:
# Clone the repository
git clone https://github.com/jmceleney/odoo-mcp.git
cd odoo-mcp
# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate
# Install in editable mode
pip install -e .
# Run the server
odoo-mcp
# or
python -m odoo_mcp
Testing with uvx
You can test the installation with uvx before adding to Claude Code:
# Test from local directory
cd odoo-mcp
uvx --from . odoo-mcp
# Test from GitHub
uvx --from git+https://github.com/jmceleney/odoo-mcp odoo-mcp
Configuration
The server is configured using environment variables or a .env file:
# .env file example
ODOO_URL=http://localhost:8069
ODOO_DB=your_database_name
ODOO_USERNAME=your_odoo_username
ODOO_PASSWORD=your_secure_password
MODEL_EXCLUSION_PREFIXES=ir.,mail.,bus.,base.
Available Configuration Options
| Variable | Description | Default | Required |
|---|---|---|---|
| ODOO_URL | URL of the Odoo server | - | Yes |
| ODOO_DB | Database name | - | Yes |
| ODOO_USERNAME | Username for authentication | - | Yes |
| ODOO_PASSWORD | Password for authentication | - | Yes |
| LOG_LEVEL | Logging level | INFO | No |
| REQUEST_TIMEOUT | Timeout for requests (seconds) | 30 | No |
| MAX_CONNECTIONS | Maximum number of connections | 5 | No |
| MODEL_EXCLUSION_PREFIXES | Comma-separated list of model prefixes to exclude from model listings and relationship data | ir.,mail.,bus.,base. | No |
Usage
MCP Tools
The MCP server provides tools for AI assistants including:
- Discovery Tools:
list_models,get_model_fields,get_detailed_field_info - Search Tools:
search_records,count_records,search_partners_by_name,search_customers,customer_count - Module Tools:
get_settings,get_module_info,search_products_by_category
See the for the complete list of available tools.
Example Usage with Claude
In Claude, you can interact with Odoo by using these tools:
Please use the Odoo MCP to list all customer models.
Development
Running Tests
pytest
Code Style
# Format code
black .
# Check types
mypy .
# Lint code
flake8 .
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
Documentation
For detailed setup and deployment instructions, see:
- - Comprehensive setup instructions
- - Docker and container deployment
Security
- All operations are read-only by default
- Credentials are handled securely through environment variables
- Use HTTPS for production Odoo connections
- Restrict API user permissions in Odoo
License
MIT License - see file for details.