- Panda Odoo Mcp Server
Panda Odoo Mcp Server
Installation
Direct Installation
# 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
Docker Installation
# 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
Configuration
The server can be configured through a JSON file. Several configuration templates are available:
config.example.json: Main template to copy and modifyconfig.dev.json: Development environment template (optional)config.prod.json: Production environment template (optional)
To get started:
# 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
Selecting the Connection Type
The Odoo MCP server supports several connection types, configurable via the connection_type field in config.json. Supported values:
stdio: Default, direct communication via stdin/stdoutstreamable_http: HTTP with streaming/chunked responses (real-time data flows)http: Classic HTTP POST (stateless, single request/response)
Example configuration:
{
"connection_type": "streamable_http", // or "http" or "stdio"
"http": {
"host": "0.0.0.0",
"port": 8080
}
}
- Use
streamable_httpfor real-time streaming over HTTP (endpoint:POST /mcp) - Use
httpfor classic REST requests (endpoint:POST /mcp) - Use
stdiofor direct communication (default)
Example of complete configuration:
{
"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"
}
]
}
}
Configuration
You can configure the server via environment variables in your .env file or directly in docker-compose.yml.
Note: Environment variables (from .env or the container environment) always take precedence over values in config.json.
Main variables:
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)
Example .env:
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
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:
-
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:
-
Classic HTTP POST (
http):- Endpoint:
POST /mcp - Handles a single request/response (stateless)
- Standard REST behavior
- Required headers:
Content-Type: application/json
- Endpoint:
-
Server-Sent Events (SSE):
- Endpoint:
GET /sse - Server-push event support
- Required headers:
Accept: text/event-stream
- Endpoint:
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
}
}
Server Config
{
"mcpServers": {
"streamable-remote": {
"command": "npx",
"args": [
"mcp-remote",
"http://your.ip.address.or.domain:8080/mcp",
"--transport",
"http-only",
"--allow-http",
"--debug"
],
"env": {}
}
}
}