Panda Odoo Mcp Server

by pandeussilvae

298 downloads
Not rated
GitHub

About

The Odoo MCP Server is a standardized interface for interacting with Odoo instances through the MCP (Model Context Protocol). It provides support for:

Details

Author
pandeussilvae
Downloads
298
Categories
Productivity, Other, Project Management, Database, Automation

- Supports stdio, streamable HTTP, classic HTTP, and SSE transports.
- Configuration via JSON file or environment variables.
- Rate limiting (requests per minute, max wait seconds).
- Connection pooling and session timeout.
- Caching support (optional dependency).
- Docker Compose deployment.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Panda Odoo Mcp Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install by cloning the repository and running pip install . (optionally with caching or dev extras). Copy the example configuration file to odoo_mcp/config/config.json, edit it with your Odoo URL, database, credentials, and desired connection type. Start the server with python -m odoo_mcp.server (stdio mode) or python -m odoo_mcp.server streamable_http (streamable_http mode). Docker Compose is also supported.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "panda odoo mcp server": {
            "streamable-remote": {
                "command": "npx",
                "args": [
                    "mcp-remote",
                    "http://your.ip.address.or.domain:8080/mcp",
                    "--transport",
                    "http-only",
                    "--allow-http",
                    "--debug"
                ],
                "env": []
            }
        }
    }
}

McpServers

{
    "streamable-remote": {
        "command": "npx",
        "args": [
            "mcp-remote",
            "http://your.ip.address.or.domain:8080/mcp",
            "--transport",
            "http-only",
            "--allow-http",
            "--debug"
        ],
        "env": []
    }
}

This module was developed byPaolo NugnesandTechLab.

TechLab is a company specialized in custom software development and enterprise system integration. Visit our websitewww.techlab.itfor more information about our services.

The Odoo MCP Server is a standardized interface for interacting with Odoo instances through the MCP (Model Context Protocol). It provides support for:

- stdio: Direct communication via stdin/stdout
- streamable_http: HTTP communication with streaming response support

- Odoo records (single and list)
- Binary fields
- Real-time updates

- Search and read records
- Create and update records
- Delete records
- Call custom methods

- Authentication and session management
- Rate limiting
- CORS for streamable_http connections

- CPU: 2+ cores
- RAM: 4GB minimum (8GB recommended)
- Disk Space: 1GB minimum

- Python 3.9+
- Odoo 15.0+

- Required modules: base, web, bus
- Database configured with admin user

- Port 8069 (Odoo)
- Port 8080 (streamable_http, optional)
- Port 5432 (PostgreSQL, if local)

- SSL certificate for HTTPS (production)
- Configured firewall
- VPN access (optional)

# Clone the repository git clone https://github.com/pandeussilvae/mcp-odoo-panda.git cd mcp-odoo-panda # Install dependencies pip install . # To install with caching support pip install .[caching] # To install with development tools pip install .[dev] # Copy the example configuration file cp odoo_mcp/config/config.example.json odoo_mcp/config/config.json # Edit config.json with your settings # nano odoo_mcp/config/config.json
# Clone the repository git clone https://github.com/pandeussilvae/mcp-odoo-panda.git cd mcp-odoo-panda # Start with Docker Compose docker-compose up -d

The server can be configured through a JSON file. Several configuration templates are available:

- config.example.json: Main template to copy and modify
- config.dev.json: Development environment template (optional)
- config.prod.json: Production environment template (optional)

# Copy the example configuration file cp odoo_mcp/config/config.example.json odoo_mcp/config/config.json # Edit config.json with your settings # nano odoo_mcp/config/config.json

The Odoo MCP server supports several connection types, configurable via theconnection_typefield inconfig.json. Supported values:

- stdio: Default, direct communication via stdin/stdout
- streamable_http: HTTP with streaming/chunked responses (real-time data flows)
- http: Classic HTTP POST (stateless, single request/response)

{ "connection_type": "streamable_http", // or "http" or "stdio" "http": { "host": "0.0.0.0", "port": 8080 } }

- Usestreamable_httpfor real-time streaming over HTTP (endpoint:POST /mcp)
- Usehttpfor classic REST requests (endpoint:POST /mcp)
- Usestdiofor direct communication (default)

{ "mcpServers": { "mcp-odoo-panda": { "command": "/usr/bin/python3", "args": [ "--directory", "/path/to/mcp-odoo-panda", "mcp/server.py", "--config", "/path/to/mcp-odoo-panda/odoo_mcp/config/config.json" ] } }, "odoo_url": "http://localhost:8069", "database": "my_database", "username": "admin", "api_key": "admin", "protocol": "xmlrpc", "connection_type": "streamable_http", "requests_per_minute": 120, "rate_limit_max_wait_seconds": 5, "pool_size": 5, "timeout": 30, "session_timeout_minutes": 60, "http": { "host": "0.0.0.0", "port": 8080, "streamable": true }, "logging": { "level": "INFO", "format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s", "handlers": [ { "type": "StreamHandler", "level": "INFO" }, { "type": "FileHandler", "filename": "server.log", "level": "DEBUG" } ] } }

You can configure the server via environment variables in your.envfile or directly indocker-compose.yml.

Note:Environment variables (from.envor the container environment) always take precedence over values inconfig.json.

- ODOO_URL,ODOO_DB,ODOO_USER,ODOO_PASSWORD(Odoo connection)
- PROTOCOL,CONNECTION_TYPE,LOGGING_LEVEL(MCP server)
- REQUESTS_PER_MINUTE,SSE_QUEUE_MAXSIZE,ALLOWED_ORIGINS(advanced)

ODOO_URL=http://host.docker.internal:8069 ODOO_DB=odoo ODOO_USER=admin ODOO_PASSWORD=admin PROTOCOL=xmlrpc CONNECTION_TYPE=streamable_http LOGGING_LEVEL=INFO

The server can be started in two modes: stdio (default) and streamable_http. The configuration file is optional and, if not specified, the server will automatically look for the file inodoo_mcp/config/config.json.

# Start the server in stdio mode without specifying the configuration file python -m odoo_mcp.server # Start the server in stdio mode with a specific configuration file python -m odoo_mcp.server /path/to/config.json
# Start the server in streamable_http mode without specifying the configuration file python -m odoo_mcp.server streamable_http # Start the server in streamable_http mode with a specific configuration file python -m odoo_mcp.server streamable_http /path/to/config.json

The Odoo MCP server supports two HTTP modes:
-

HTTP Streaming Chunked(streamable_http):

- Endpoint:POST /mcp
- Keeps the connection open and streams data
- Ideal for real-time data flows
- Required headers:

Content-Type: application/json Connection: keep-alive

- Endpoint:POST /mcp
- Handles a single request/response (stateless)
- Standard REST behavior
- Required headers:

Content-Type: application/json

- Endpoint:GET /sse
- Server-push event support
- Required headers:

Accept: text/event-stream

To configure the HTTP mode, setconnection_typeinconfig.json:

{ "connection_type": "streamable_http", // or "http" "http": { "host": "0.0.0.0", "port": 8080 } }
curl -X POST http://localhost:8080/mcp \ -H "Content-Type: application/json" \ -H "Connection: keep-alive" \ -d '{"jsonrpc": "2.0", "method": "initialize", "id": 1}'
curl -X POST http://localhost:8080/mcp \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "initialize", "id": 1}'
curl -N http://localhost:8080/sse \ -H "Accept: text/event-stream"
# Test a request without specifying the configuration file echo '{"method": "get_resource", "params": {"uri": "odoo://res.partner/1"}}' | python -m odoo_mcp.server # Test a request with a specific configuration file echo '{"method": "get_resource", "params": {"uri": "odoo://res.partner/1"}}' | python -m odoo_mcp.server /path/to/config.json
curl -X POST http://localhost:8080/mcp \ -H "Content-Type: application/json" \ -H "Connection: keep-alive" \ -d '{"jsonrpc": "2.0", "method": "initialize", "params": {}, "id": 1}'
curl -X POST http://localhost:8080/mcp \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "initialize", "params": {}, "id": 1}'
curl -N http://localhost:8080/sse \ -H "Accept: text/event-stream"
import asyncio from mcp import Client async def main(): client = Client(connection_type="stdio") await client.initialize() # Example: Read a record resource = await client.get_resource("odoo://res.partner/1") print(resource.data) if __name__ == "__main__": asyncio.run(main())
import asyncio from mcp import Client async def main(): client = Client(connection_type="streamable_http") await client.initialize() # Example: Read a record resource = await client.get_resource("odoo://res.partner/1") print(resource.data) if __name__ == "__main__": asyncio.run(main())

Connecting Claude Desktop to the Odoo MCP server (stdio)

To connect Claude Desktop to the Odoo MCP server using the stdio protocol:
- Make sure the Odoo MCP server is installed and working.
- Open Claude Desktop settings (Claude menu → Settings → Developer → Edit Config).
- Add the following configuration to themcpServerssection of yourclaude_desktop_config.jsonfile:

{ "mcpServers": { "odoo-mcp": { "command": "python", "args": [ "-m", "odoo_mcp.server", "C:/absolute/path/to/your/config.json" ] } } }

ReplaceC:/absolute/path/to/your/config.jsonwith the actual path to your configuration file.
- Save and restart Claude Desktop. You should see the MCP tools available.

Note:Claude Desktop only communicates via stdio. Do not usestreamable_httpfor connecting with Claude Desktop.

Complete documentation is available in thedocs/directory:

- mcp_protocol.md: MCP protocol documentation
- odoo_server.md: Odoo server documentation
- server_usage.md: Server usage guide
- Fork the repository
- Create your 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

This project is released under the MIT License. See theLICENSEfile for details.

# Update the repository git pull origin main # Reinstall the package pip install --upgrade . # Restart the server systemctl restart odoo-mcp-server
# Update images docker-compose pull # Restart containers docker-compose up -d
# Uninstall the package pip uninstall odoo-mcp-server # Remove configuration files rm -rf ~/.odoo-mcp-server
# Stop and remove containers docker-compose down # Remove images docker-compose rm -f
{ "protocol": "xmlrpc", "connection_type": "stdio", "odoo_url": "http://localhost:8069", "database": "dev_db", "username": "admin", "api_key": "admin", "logging": { "level": "DEBUG", "handlers": [ { "type": "FileHandler", "filename": "logs/dev.log", "level": "DEBUG" } ] } }
{ "protocol": "jsonrpc", "connection_type": "streamable_http", "odoo_url": "https://odoo.example.com", "database": "prod_db", "username": "admin", "api_key": "your-secure-api-key", "http": { "host": "0.0.0.0", "port": 8080, "streamable": true }, "logging": { "level": "INFO", "handlers": [ { "type": "FileHandler", "filename": "logs/prod.log", "level": "INFO" } ] } }
# Backup configuration cp odoo_mcp/config/config.json odoo_mcp/config/config.json.backup # Restore configuration cp odoo_mcp/config/config.json.backup odoo_mcp/config/config.json
from odoo_mcp.error_handling.exceptions import ( AuthError, NetworkError, ProtocolError ) try: await client.get_resource("odoo://res.partner/1") except AuthError as e: logger.error(f"Authentication error: {e}") # Error handling except NetworkError as e: logger.error(f"Network error: {e}") # Error handling except ProtocolError as e: logger.error(f"Protocol error: {e}") # Error handling
async with Client() as client: await client.initialize() # Operations
# Cache configuration cache_config = { 'enabled': True, 'ttl': 300, 'max_size': 1000 }
# Create session session = await client.create_session() # Validate session if await client.validate_session(session_id): # Operations

- Verify that Odoo is running on port 8069
- Check that the firewall allows access to port 8069
- Verify that the Odoo URL in the configuration file is correct
- Check that the database is accessible

- Verify that username and api_key in the configuration file are correct
- Check that the user has the necessary permissions in the Odoo database
- Verify that the specified database exists
- Check that the base, web, and bus modules are installed

- Verify that the specified protocol (xmlrpc/jsonrpc) is supported
- Check that the Odoo version is compatible (15.0+)
- Verify that the connection type (stdio/streamable_http) is correct
- Check the logs for specific error details

- Increase therequests_per_minutevalue in the configuration file
- Implement a retry mechanism with backoff
- Optimize requests to reduce the number of calls

- Verify that the configured cache type is supported
- Check that there is sufficient space for the cache
- Temporarily disable the cache if necessary

Important note:In the current version, the Odoo MCP server can write logs to multiple destinations depending on configuration:

- If theloggingsection inconfig.jsonincludes aStreamHandler, logs are written to theconsole(stderr).
- If aFileHandleris present, logs are also written to afileat the path specified byfilename.
- If there is nologging, logs are written only to stderr (console).

"logging": { "level": "INFO", "format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s", "handlers": [ { "type": "StreamHandler", "level": "INFO" }, { "type": "FileHandler", "filename": "server.log", "level": "DEBUG" } ] }

- In this example, logs go both to the console and to the fileserver.login the directory where you start the server.
- You can change the log file path by editing thefilenamefield (e.g.,"filename": "logs/dev.log"or an absolute path).
- Check thedocumentation
- Open an
issue
- Contact
support@techlab.it

You can run the Odoo MCP Server in a Docker container using the providedDockerfileanddocker-compose.yml.

- Build the image from the Dockerfile.
- Start the MCP server on port 8080 (default).
- Persist logs in the./logsdirectory.

You can configure the server via environment variables in your.envfile or directly indocker-compose.yml.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.