MCP Odoo Shell
# MCP Odoo Shell
A Model Context Protocol (MCP) server that provides access to an Odoo shell environment.
> [!CAUTION]
> **PRE-ALPHA SOFTWARE - DO NOT USE IN PRODUCTION**
>
> This software is in early development and should **NEVER** be used with production Odoo databases. It provides direct shell access to your Odoo database with full read/write capabilities and could cause data loss, corruption, or security vulnerabilities.
>
> **Use only with:**
> - Test databases
> - Development environments
> - Disposable data
>
> **You have been warned!** 🚨
## Overview
This MCP server acts as a bridge between MCP clients and Odoo, allowing execution of Python code within an Odoo database context. It maintains a persistent Odoo shell subprocess and provides tools for code execution, model introspection, and session management.
## Installation
```bash
# Install dependencies
uv sync --dev
# Install the package
uv pip install -e .
```
## Configuration
Set these environment variables:
- `ODOO_BIN_PATH`: Path to odoo-bin executable (default: `/usr/bin/odoo-bin`)
- `ODOO_ADDONS_PATH`: Comma-separated addon directories (default: `/odoo/addons`)
- `ODOO_DATABASE`: Database name (default: `odoo`)
- `ODOO_CONFIG_FILE`: Optional Odoo configuration file path
## Usage
```bash
# Run the MCP server
uv run odoo-shell-mcp
# Or run directly
uv run python odoo_shell_mcp.py
```
## MCP Tools
The server exposes these tools:
- **`execute_odoo_code`**: Execute Python code in Odoo shell context
- **`reset_odoo_shell`**: Restart the shell process to clear state
- **`list_odoo_models`**: Query available Odoo models with optional filtering
- **`odoo_model_info`**: Get detailed information about specific models
## Development
```bash
# Run tests
uv run pytest
# Run tests with coverage
uv run pytest --cov=odoo_shell_mcp --cov-report=term-missing
# Lint and format
uv run ruff check .
uv run ruff format .
# Build package
uv build
```
## License
MITTDQS
Scored across 4 tools
Each tool has a clearly distinct purpose with no overlap: execute_odoo_code runs code, list_odoo_models enumerates models, odoo_model_info provides details on a specific model, and reset_odoo_shell clears session state. The descriptions reinforce these distinct roles, making misselection unlikely.
All tools follow a consistent snake_case naming pattern with clear verb_noun structure (e.g., execute_odoo_code, list_odoo_models). The 'odoo' prefix is uniformly applied across all tools, enhancing predictability and readability.
With 4 tools, the count is reasonable for an Odoo shell server, covering core operations like code execution, model listing, model inspection, and session reset. It feels slightly thin but well-scoped, as each tool serves a clear purpose without unnecessary duplication.
The toolset covers essential Odoo shell workflows: exploring models, inspecting details, executing code, and managing sessions. Minor gaps exist, such as no direct database query tools or model-specific CRUD operations, but agents can work around these using execute_odoo_code for custom operations.