Sponsored by Deepsite.site

MCP Server for Odoo

Created By
ivnvxd8 months ago
A Model Context Protocol (MCP) server that enables AI assistants to securely interact with Odoo ERP systems through standardized resources and tools for data retrieval and manipulation.
Content

MCP Server for Odoo

CI codecov Code style: black Ruff Checked with mypy Python 3.10+ License: MPL 2.0

An MCP server that enables AI assistants like Claude to interact with Odoo ERP systems. Access business data, search records, and work with Odoo through natural language.

Features

  • 🔍 Search and retrieve any Odoo record (customers, products, invoices, etc.)
  • 📊 Browse multiple records and get formatted summaries
  • 🔢 Count records matching specific criteria
  • 📋 Inspect model fields to understand data structure
  • 🔐 Secure access with API key or username/password authentication
  • 🎯 Smart pagination for large datasets
  • 💬 LLM-optimized output with hierarchical text formatting

Installation

Prerequisites

  • Python 3.10 or higher
  • Access to an Odoo instance (version 18.0+)
  • The Odoo MCP module installed on your Odoo server
  • An API key generated in Odoo (Settings > Users > API Keys)

Add this configuration to your MCP settings:

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "odoo": {
      "command": "uvx",
      "args": ["mcp-server-odoo"],
      "env": {
        "ODOO_URL": "https://your-odoo-instance.com",
        "ODOO_API_KEY": "your-api-key-here",
        "ODOO_DB": "your-database-name"
      }
    }
  }
}
Cursor

Add to ~/.cursor/mcp_settings.json:

{
  "mcpServers": {
    "odoo": {
      "command": "uvx",
      "args": ["mcp-server-odoo"],
      "env": {
        "ODOO_URL": "https://your-odoo-instance.com",
        "ODOO_API_KEY": "your-api-key-here",
        "ODOO_DB": "your-database-name"
      }
    }
  }
}
VS Code (with GitHub Copilot)

Add to your VS Code settings (~/.vscode/mcp_settings.json or workspace settings):

{
  "github.copilot.chat.mcpServers": {
    "odoo": {
      "command": "uvx",
      "args": ["mcp-server-odoo"],
      "env": {
        "ODOO_URL": "https://your-odoo-instance.com",
        "ODOO_API_KEY": "your-api-key-here",
        "ODOO_DB": "your-database-name"
      }
    }
  }
}
Zed

Add to ~/.config/zed/settings.json:

{
  "context_servers": {
    "odoo": {
      "command": "uvx",
      "args": ["mcp-server-odoo"],
      "env": {
        "ODOO_URL": "https://your-odoo-instance.com",
        "ODOO_API_KEY": "your-api-key-here",
        "ODOO_DB": "your-database-name"
      }
    }
  }
}

Alternative Installation Methods

Using pip
# Install globally
pip install mcp-server-odoo

# Or use pipx for isolated environment
pipx install mcp-server-odoo

Then use mcp-server-odoo as the command in your MCP configuration.

From source
git clone https://github.com/ivnvxd/mcp-server-odoo.git
cd mcp-server-odoo
pip install -e .

Then use the full path to the package in your MCP configuration.

Configuration

Environment Variables

The server requires the following environment variables:

VariableRequiredDescriptionExample
ODOO_URLYesYour Odoo instance URLhttps://mycompany.odoo.com
ODOO_API_KEYYes*API key for authentication0ef5b399e9ee9c11b053dfb6eeba8de473c29fcd
ODOO_USERYes*Username (if not using API key)admin
ODOO_PASSWORDYes*Password (if not using API key)admin
ODOO_DBNoDatabase name (auto-detected if not set)mycompany

*Either ODOO_API_KEY or both ODOO_USER and ODOO_PASSWORD are required.

Setting up Odoo

  1. Install the MCP module:

    • Download the mcp_server module
    • Install it in your Odoo instance
    • Navigate to Settings > MCP Server
  2. Enable models for MCP access:

    • Go to Settings > MCP Server > Enabled Models
    • Add models you want to access (e.g., res.partner, product.product)
    • Configure permissions (read, write, create, delete) per model
  3. Generate an API key:

    • Go to Settings > Users & Companies > Users
    • Select your user
    • Under the "API Keys" tab, create a new key
    • Copy the key for your MCP configuration

Usage Examples

Once configured, you can ask Claude:

  • "Show me all customers from Spain"
  • "Find products with stock below 10 units"
  • "List today's sales orders over $1000"
  • "Search for unpaid invoices from last month"
  • "Count how many active employees we have"
  • "Show me the contact information for Microsoft"

Available Tools

search_records

Search for records in any Odoo model with filters.

{
  "model": "res.partner",
  "domain": [["is_company", "=", true], ["country_id.code", "=", "ES"]],
  "fields": ["name", "email", "phone"],
  "limit": 10
}

get_record

Retrieve a specific record by ID.

{
  "model": "res.partner",
  "record_id": 42,
  "fields": ["name", "email", "street", "city"]
}

list_models

List all models enabled for MCP access.

{}

create_record

Create a new record in Odoo.

{
  "model": "res.partner",
  "values": {
    "name": "New Customer",
    "email": "customer@example.com",
    "is_company": true
  }
}

update_record

Update an existing record.

{
  "model": "res.partner",
  "record_id": 42,
  "values": {
    "phone": "+1234567890",
    "website": "https://example.com"
  }
}

delete_record

Delete a record from Odoo.

{
  "model": "res.partner",
  "record_id": 42
}

Resources

The server also provides direct access to Odoo data through resource URIs:

  • odoo://res.partner/record/1 - Get partner with ID 1
  • odoo://product.product/search?domain=[["qty_available",">",0]] - Search products in stock
  • odoo://sale.order/browse?ids=1,2,3 - Browse multiple sales orders
  • odoo://res.partner/count?domain=[["customer_rank",">",0]] - Count customers
  • odoo://product.product/fields - List available fields for products

Security

  • Always use HTTPS in production environments
  • Keep your API keys secure and rotate them regularly
  • Configure model access carefully - only enable necessary models
  • The MCP module respects Odoo's built-in access rights and record rules
  • Each API key is linked to a specific user with their permissions

Troubleshooting

Connection Issues

If you're getting connection errors:

  1. Verify your Odoo URL is correct and accessible
  2. Check that the MCP module is installed: visit https://your-odoo.com/mcp/health
  3. Ensure your firewall allows connections to Odoo
Authentication Errors

If authentication fails:

  1. Verify your API key is active in Odoo
  2. Check that the user has appropriate permissions
  3. Try regenerating the API key
  4. For username/password auth, ensure 2FA is not enabled
Model Access Errors

If you can't access certain models:

  1. Go to Settings > MCP Server > Enabled Models in Odoo
  2. Ensure the model is in the list and has appropriate permissions
  3. Check that your user has access to that model in Odoo's security settings
Debug Mode

Enable debug logging for more information:

{
  "env": {
    "ODOO_URL": "https://your-odoo.com",
    "ODOO_API_KEY": "your-key",
    "ODOO_MCP_LOG_LEVEL": "DEBUG"
  }
}

Development

Running from source
# Clone the repository
git clone https://github.com/ivnvxd/mcp-server-odoo.git
cd mcp-server-odoo

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest --cov

# Run the server
python -m mcp_server_odoo
Testing with MCP Inspector
# Using uvx
npx @modelcontextprotocol/inspector uvx mcp-server-odoo

# Using local installation
npx @modelcontextprotocol/inspector python -m mcp_server_odoo

License

This project is licensed under the Mozilla Public License 2.0 (MPL-2.0) - see the LICENSE file for details.

Contributing

Contributions are very welcome! Please see the CONTRIBUTING guide for details.

Support

Thank you for using this project! If you find it helpful and would like to support my work, kindly consider buying me a coffee. Your support is greatly appreciated!

Buy Me A Coffee

And do not forget to give the project a star if you like it! :star:

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
CursorThe AI Code Editor
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Serper MCP ServerA Serper MCP Server
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Tavily Mcp
ChatWiseThe second fastest AI chatbot™
DeepChatYour AI Partner on Desktop
WindsurfThe new purpose-built IDE to harness magic
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Playwright McpPlaywright MCP server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Amap Maps高德地图官方 MCP Server
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.