Skip to content

Odoo MCP Connection

Overview

The Odoo Model Context Protocol (MCP) server enables natural language interaction with Odoo ERP systems (versions 17, 18, 19) through WorkBuddy. This connection allows AI assistants to perform basic Odoo operations such as querying records, creating sales orders, managing contacts, and more via natural language commands.

Key Features: - Natural language access to Odoo data and operations - Support for Odoo 17/18 (XML-RPC) and Odoo 19+ (JSON‑2) - Integration with WorkBuddy's MCP framework - Secure credential management via environment variables - Configurable timeouts and retry logic

Prerequisites

  1. Odoo Instance: A running Odoo instance (on-premise or cloud) with API access enabled
  2. API User: An Odoo user with appropriate permissions and an API key
  3. Python 3.8+: Required for the Odoo MCP server package
  4. WorkBuddy: Desktop version with MCP support enabled

Installation

1. Install the Odoo MCP Package

pip install odoo-mcp

Verify the installation:

python -c "import odoo_mcp.server; print('Module loaded successfully')"

2. Configuration Template

Create a configuration template to document the required settings:

{
  "url": "http://localhost:8069",
  "db": "your_database_name",
  "username": "api_user@yourcompany.com",
  "apiKey": "your_api_key_from_odoo_preferences",
  "timeout": 60,
  "maxRetries": 3,
  "pollInterval": 60,
  "logLevel": "INFO",
  "webhookPort": 8070,
  "webhookSecret": ""
}

Save this as odoo_config.json in your workspace.

3. Register with WorkBuddy

Update your WorkBuddy MCP configuration (~/.workbuddy/mcp.json):

{
  "mcpServers": {
    "odoo": {
      "command": "python",
      "args": ["-m", "odoo_mcp.server"],
      "env": {
        "ODOO_URL": "http://localhost:8069",
        "ODOO_DB": "your_database_name",
        "ODOO_USERNAME": "api_user@yourcompany.com",
        "ODOO_API_KEY": "your_api_key_from_odoo_preferences",
        "ODOO_TIMEOUT": "60",
        "ODOO_MAX_RETRIES": "3",
        "ODOO_POLL_INTERVAL": "60",
        "ODOO_LOG_LEVEL": "INFO",
        "ODOO_WEBHOOK_PORT": "8070",
        "ODOO_WEBHOOK_SECRET": ""
      }
    }
  }
}

4. Set Environment Variables

Replace the placeholder values in the env section with your actual Odoo credentials:

Variable Description Example
ODOO_URL Odoo instance URL https://yourcompany.odoo.com
ODOO_DB Database name yourcompany_prod
ODOO_USERNAME API user email api_user@yourcompany.com
ODOO_API_KEY API key from Odoo preferences a1b2c3d4e5f6...
ODOO_TIMEOUT Request timeout in seconds 60
ODOO_MAX_RETRIES Maximum retry attempts 3
ODOO_POLL_INTERVAL Polling interval for async operations 60
ODOO_LOG_LEVEL Log verbosity INFO
ODOO_WEBHOOK_PORT Webhook listener port (optional) 8070
ODOO_WEBHOOK_SECRET Webhook secret (optional) your_secret

Usage

Basic Commands

Once configured, you can interact with Odoo using natural language through WorkBuddy:

  • Query records: "Show me the last 10 sales orders"
  • Create records: "Create a new contact for John Doe at ACME Corp"
  • Update records: "Mark sales order SO001 as confirmed"
  • Report data: "What's our total revenue this month?"

Example Workflows

1. Query Sales Orders

User: "List the last 5 sales orders with amounts over $1000"
Assistant: (Uses MCP to query Odoo and return formatted results)

2. Create a Contact

User: "Add a new customer contact: Jane Smith, jane@example.com, phone 555-0123"
Assistant: (Creates a new partner record in Odoo via MCP)

3. Check Inventory

User: "What's the current stock level for product iPhone 15?"
Assistant: (Queries Odoo inventory and returns available quantity)

Supported Odoo Models

The MCP server provides access to common Odoo models:

Model Description Key Operations
res.partner Contacts/Customers Create, read, update, search
sale.order Sales Orders Create, confirm, invoice, cancel
account.move Invoices Create, post, reconcile
product.product Products Read, update stock
stock.picking Transfers Confirm, process, validate
project.task Tasks Create, assign, update status
hr.employee Employees Read basic info

Troubleshooting

Common Issues

  1. Connection Refused
  2. Verify ODOO_URL points to a running Odoo instance
  3. Check firewall/network access
  4. Ensure Odoo XML-RPC/JSON‑2 interface is enabled

  5. Authentication Failed

  6. Confirm ODOO_DB, ODOO_USERNAME, and ODOO_API_KEY are correct
  7. Verify the user has API access permissions in Odoo
  8. Check if the API key was generated from User Preferences

  9. Module Import Error

    python -c "import odoo_mcp.server"
    

  10. Reinstall the package: pip install --upgrade odoo-mcp
  11. Check Python version compatibility

  12. WorkBuddy Doesn't Recognize MCP

  13. Restart WorkBuddy after updating mcp.json
  14. Check WorkBuddy logs for MCP initialization errors
  15. Verify mcp.json syntax is valid JSON

Logs and Debugging

Set ODOO_LOG_LEVEL to DEBUG for detailed logs:

"env": {
  "ODOO_LOG_LEVEL": "DEBUG"
}

Logs will appear in WorkBuddy's console output or log files.

Security Considerations

  1. API Key Management
  2. Store API keys in environment variables, not in version control
  3. Use separate API users for different applications
  4. Rotate API keys periodically

  5. Network Security

  6. Use HTTPS for production Odoo instances
  7. Restrict API access to trusted IP ranges if possible
  8. Consider VPN/private network for on-premise deployments

  9. Permission Scoping

  10. Grant minimum necessary permissions to the API user
  11. Regularly audit user permissions in Odoo

Maintenance

Version Updates

Check for package updates:

pip list --outdated | grep odoo-mcp

Update when available:

pip install --upgrade odoo-mcp

Configuration Migration

When migrating to a new environment: 1. Update environment variables in mcp.json 2. Test connection with the new credentials 3. Update any related documentation


Last Updated: 2026-05-19
Maintainer: WorkBuddy Automation
Status: Active ✅