odoo-mcp-server

godtbilh/odoo-mcp-server

3.3

If you are the rightful owner of odoo-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A Model Context Protocol (MCP) server that facilitates interaction with Odoo instances via XML-RPC.

Tools
  1. odoo_test_connection

    Test connection to Odoo

  2. odoo_search

    Search for records in any Odoo model

  3. odoo_read

    Read specific records by ID

  4. odoo_create

    Create new records

  5. odoo_write

    Update existing records

Odoo MCP Server

A Model Context Protocol (MCP) server that provides tools for interacting with Odoo instances via XML-RPC.

๐Ÿšจ Current Status: Authentication Issue

The MCP server is properly configured, but there's an authentication issue with your Odoo instance.

What's Working โœ…

  • โœ… Connection to Odoo server (https://euromenager.odoo.com/)
  • โœ… MCP server implementation with proper tools
  • โœ… Environment configuration
  • โœ… Dependencies installed

What's Not Working โŒ

  • โŒ Authentication with API key fails
  • โŒ All tested usernames ('admin', 'Administrator', 'user', 'demo') fail

๐Ÿ”ง How to Fix the Authentication Issue

Option 1: Check Your API Key (Recommended)

  1. Log into your Odoo instance: https://euromenager.odoo.com/
  2. Go to Settings โ†’ Users & Companies โ†’ Users
  3. Find your user account and click on it
  4. Check the Login field - this should be your username
  5. Generate a new API key:
    • Scroll down to the "API Keys" section
    • Delete the old API key
    • Create a new one
    • Copy the new API key

Option 2: Update Your Credentials

Update your .env file with the correct information:

ODOO_URL=https://euromenager.odoo.com/
ODOO_API_KEY=your_new_api_key_here
ODOO_DB=euromenager
ODOO_USERNAME=your_actual_username_here

Option 3: Check User Permissions

Make sure your user has:

  • XML-RPC access enabled
  • API access permissions
  • Proper user rights (not just portal user)

๐Ÿ“ Project Structure

odoo_agent_mcp/
โ”œโ”€โ”€ .env                    # Environment variables (your Odoo credentials)
โ”œโ”€โ”€ .venv/                  # Python virtual environment
โ”œโ”€โ”€ odoo_mcp_server/
โ”‚   โ”œโ”€โ”€ main.py            # MCP server implementation
โ”‚   โ””โ”€โ”€ requirements.txt   # Python dependencies
โ”œโ”€โ”€ test_connection.py     # Simple connection test
โ”œโ”€โ”€ debug_auth.py          # Detailed authentication debugging
โ”œโ”€โ”€ mcp_config.json        # MCP client configuration
โ””โ”€โ”€ README.md              # This file

๐Ÿงช Testing Your Connection

1. Activate Virtual Environment

.venv\Scripts\Activate.ps1

2. Test Connection

python test_connection.py

3. Debug Authentication (if needed)

python debug_auth.py

๐Ÿ”Œ Using the MCP Server

Once authentication is working, you can use the MCP server with MCP clients.

Available Tools

  1. odoo_test_connection - Test connection to Odoo
  2. odoo_search - Search for records in any Odoo model
  3. odoo_read - Read specific records by ID
  4. odoo_create - Create new records
  5. odoo_write - Update existing records

Available Resources

  1. odoo://connection - Connection status
  2. odoo://models - List of available Odoo models

Example Usage (once working)

# Search for customers
odoo_search(model="res.partner", domain=[["is_company", "=", True]], fields=["name", "email"], limit=5)

# Read specific customer
odoo_read(model="res.partner", ids=[1], fields=["name", "email", "phone"])

# Create new customer
odoo_create(model="res.partner", values={"name": "Test Company", "email": "test@example.com"})

๐Ÿ”ง MCP Client Configuration

To use this server with MCP clients like Cline, add this to your MCP configuration:

{
  "mcpServers": {
    "odoo": {
      "command": "python",
      "args": ["odoo_mcp_server/main.py"],
      "env": {
        "PYTHONPATH": "."
      }
    }
  }
}

๐Ÿ› Troubleshooting

Common Issues

  1. "Authentication failed"

    • Check your API key is correct and not expired
    • Verify your username matches the API key owner
    • Ensure your user has XML-RPC permissions
  2. "python odoo_mcp_server/main.py blocks the system"

    • This is normal! MCP servers run as long-running processes
    • They wait for input from MCP clients
    • Use the test scripts instead for testing
  3. "Module not found" errors

    • Make sure virtual environment is activated
    • Run: pip install -r odoo_mcp_server/requirements.txt

Getting Help

  1. Check Odoo logs in your instance
  2. Verify API key permissions in Odoo user settings
  3. Test with a fresh API key
  4. Contact your Odoo administrator if you don't have proper access

๐Ÿ“‹ Next Steps

  1. Fix authentication using the steps above
  2. Test connection with python test_connection.py
  3. Configure MCP client to use this server
  4. Start using Odoo tools via MCP!

Note: This is an Odoo SaaS/trial instance, which may have additional restrictions on API access. Make sure your subscription includes API access rights.