Labsco
pandeussilvae logo

Panda Odoo

8

from pandeussilvae

An MCP server for integrating with the Odoo ERP system.

🔥🔥🔥✓ VerifiedFreeAdvanced setup

Panda Odoo MCP Server

Odoo MCP Server Logo

Developed by

This module was developed by Paolo Nugnes and TechLab.

TechLab is a company specialized in custom software development and enterprise system integration. Visit our website www.techlab.it for more information about our services.

Overview

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

  • Communication Protocols:

    • stdio: Direct communication via stdin/stdout
    • streamable_http: HTTP communication with streaming response support
  • Resource Management:

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

    • Search and read records
    • Create and update records
    • Delete records
    • Call custom methods
  • Security:

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

Starting the Server

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 in odoo_mcp/config/config.json.

stdio Mode (default)

# 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

streamable_http Mode

# 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

HTTP Modes

The Odoo MCP server supports two HTTP modes:

  1. 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
  2. Classic HTTP POST (http):

    • Endpoint: POST /mcp
    • Handles a single request/response (stateless)
    • Standard REST behavior
    • Required headers:
      Content-Type: application/json
  3. Server-Sent Events (SSE):

    • Endpoint: GET /sse
    • Server-push event support
    • Required headers:
      Accept: text/event-stream

To configure the HTTP mode, set connection_type in config.json:

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

Example Calls

  1. HTTP Streaming Chunked:
curl -X POST http://localhost:8080/mcp \
  -H "Content-Type: application/json" \
  -H "Connection: keep-alive" \
  -d '{"jsonrpc": "2.0", "method": "initialize", "id": 1}'
  1. Classic HTTP POST:
curl -X POST http://localhost:8080/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "method": "initialize", "id": 1}'
  1. Server-Sent Events:
curl -N http://localhost:8080/sse \
  -H "Accept: text/event-stream"

Server Verification

stdio Mode

# 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

streamable_http Mode

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}'

http Mode (Classic HTTP POST)

curl -X POST http://localhost:8080/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "method": "initialize", "params": {}, "id": 1}'

Server-Sent Events (SSE)

curl -N http://localhost:8080/sse \
  -H "Accept: text/event-stream"

Documentation

Complete documentation is available in the docs/ directory:

  • mcp_protocol.md: MCP protocol documentation
  • odoo_server.md: Odoo server documentation
  • server_usage.md: Server usage guide

Update

Update from Source

# Update the repository
git pull origin main

# Reinstall the package
pip install --upgrade .

# Restart the server
systemctl restart odoo-mcp-server

Update with Docker

# Update images
docker-compose pull

# Restart containers
docker-compose up -d