Skip to main content
Glama
MCP Odoo Shell

MCP Odoo Shell

by seletz

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.

Related MCP server: Panda Odoo MCP Server

Installation

# 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

# 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

# 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

MIT

Available Tools

4 tools
execute_odoo_codeA
Execute Python code in an Odoo shell environment with full access to Odoo models and environment.

This tool provides direct access to the Odoo ORM and all loaded modules through
the shell environment. The ``env`` variable is available for accessing models,
and all standard Odoo shell features are accessible.

:param code: Python code to execute in the Odoo context
:type code: str
:return: The output from executing the code
:rtype: str

.. note::
   The shell maintains persistent state between calls, so variables
   defined in one execution will be available in subsequent calls.
   
.. warning::
   Code executed through this tool has full access to the Odoo database
   and can modify data. Use with appropriate caution.

Inputs: code (required).

list_odoo_modelsA
List available Odoo models, optionally filtered by pattern.

Queries the Odoo registry to retrieve all available model names.
If a pattern is provided, only models containing that pattern
in their name will be returned.

:param pattern: Optional pattern to filter model names (case-sensitive)
:type pattern: str
:return: List of model names, one per line
:rtype: str

.. note::
   Results are limited to the first 50 matches to prevent overwhelming output.

Inputs: pattern.

odoo_model_infoA
Get information about a specific Odoo model.

Retrieves detailed information about the specified model including
its description, database table name, and field definitions.

:param model_name: Name of the Odoo model (e.g., 'res.partner', 'sale.order')
:type model_name: str
:return: Formatted information about the model and its fields
:rtype: str

.. example::
   >>> odoo_model_info('res.partner')
   Model: res.partner
   Description: Partner
   Table: res_partner
   
   Fields:
     name: Char
     email: Char
     phone: Char
     ...

Inputs: model_name (required).

reset_odoo_shellA
Reset the Odoo shell session (restart the shell process).

Terminates the current shell process and clears the global shell manager,
which will cause a new shell to be started on the next code execution.
This is useful for clearing session state or recovering from errors.

:return: Success message or error description
:rtype: str

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 4 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count4/5

    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.

    Completeness4/5

    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.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that enables AI assistants to interact with Odoo ERP systems, providing comprehensive tools for searching, creating, updating, and managing Odoo records through a standardized interface.
      23
      GPL 3.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables seamless interaction with Odoo instances through the Model Context Protocol, supporting CRUD operations, custom method execution, and real-time updates. It offers versatile communication via stdio and HTTP protocols, including support for streaming and Server-Sent Events.
      8
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      A version-agnostic MCP server for Odoo that enables AI agents to interact with any Odoo app's data, schema, and source code, supporting tasks like data CRUD, schema mapping, code analysis, and feature implementation.
      14
      8
      MIT