Skip to main content

MCP server for Odoo SH — exposes ORM metadata, views, modules and logs to Claude Code via XML-RPC

Project description

odoo-sh-mcp

MCP server for Odoo SH that gives Claude Code full access to your Odoo instance via XML-RPC: inspect the ORM, read and write business records, manage modules, and tail server logs.

What it does

Claude Code (your machine)
       ↓ MCP protocol (stdio)
odoo-sh-mcp (Python, local)
       ↓ XML-RPC              ↓ SSH / SFTP
Odoo SH (remote instance) ←──────────────

Two transport layers:

  • XML-RPC — ORM introspection, records, modules, logs (no SSH needed)
  • SSH / SFTP — upload files directly to ~/src/user/, run odoo-update, restart services, tail logs

Tools

Tier 1 — ORM introspection

Tool Description
get_model_fields All fields for a model: type, label, required, relation, compute
get_model_info Model metadata: description, modules, inherited models
search_models Find models by partial name or description
search_records Search and read records from any model
create_record Create a new record in any model
update_record Update fields of an existing record by ID
delete_record Delete a record by ID

Tier 2 — View inspection

Tool Description
get_views Full XML arch of all views (or a specific type) for a model
get_view_by_xmlid Resolve an xmlid and return its full arch
find_field_in_view Find which views contain a field and at which line

Tier 3 — Local scaffold (no Odoo connection)

Tool Description
scaffold_module Create a minimal module skeleton on disk
create_model_file Generate a Python model file inside an existing module
create_view_inheritance Generate an XML view inheritance file

Tier 4 — Module management

Tool Description
list_modules List modules with state and version
install_module Install a module via XML-RPC
upgrade_module Upgrade an installed module via XML-RPC

Tier 5 — Logs

Tool Description
get_server_logs Fetch recent server logs from ir.logging

Tier 6 — SSH / Odoo.sh direct access

Tool Description
ssh_exec Execute any shell command on the Odoo.sh server
ssh_upload_file Upload a local file to ~/src/user/<module>/ via SFTP
ssh_update_module Run odoo-update <module> on the server
ssh_restart Restart Odoo.sh services via odoosh-restart
ssh_read_log Tail ~/logs/odoo.log from the server

Installation

# With uv (recommended)
uvx odoo-sh-mcp

# Or with pip
pip install odoo-sh-mcp

Configuration

Single instance

claude mcp add odoo-mycompany uvx odoo-sh-mcp \
  -e ODOO_URL=https://mycompany.odoo.com \
  -e ODOO_DB=mycompany \
  -e ODOO_API_KEY=your_key_here \
  -e ODOO_USERNAME=you@mycompany.com

Multi-instance

Ejecuta el comando una vez por cada instancia:

claude mcp add odoo-company-a uvx odoo-sh-mcp \
  -e ODOO_URL=https://company-a.odoo.com \
  -e ODOO_DB=company-a \
  -e ODOO_API_KEY=xxx \
  -e ODOO_USERNAME=you@company-a.com

claude mcp add odoo-company-b uvx odoo-sh-mcp \
  -e ODOO_URL=https://company-b.odoo.com \
  -e ODOO_DB=company-b \
  -e ODOO_API_KEY=yyy \
  -e ODOO_USERNAME=you@company-b.com

O edita directamente .claude/mcp.json:

{
  "mcpServers": {
    "odoo-company-a": {
      "command": "uvx",
      "args": ["odoo-sh-mcp"],
      "env": {
        "ODOO_URL": "https://company-a.odoo.com",
        "ODOO_DB": "company-a",
        "ODOO_API_KEY": "xxx",
        "ODOO_USERNAME": "you@company-a.com"
      }
    },
    "odoo-company-b": {
      "command": "uvx",
      "args": ["odoo-sh-mcp"],
      "env": {
        "ODOO_URL": "https://company-b.odoo.com",
        "ODOO_DB": "company-b",
        "ODOO_API_KEY": "yyy",
        "ODOO_USERNAME": "you@company-b.com"
      }
    }
  }
}

Environment variables

Variable Required Description
ODOO_URL Yes Instance URL, e.g. https://mycompany.odoo.com
ODOO_DB Yes Database name
ODOO_API_KEY Yes* API key (Settings > Technical > API Keys)
ODOO_USERNAME Yes* email address for API key auth
ODOO_PASSWORD No Password if not using API key
ODOO_SH_SSH_HOST SSH only Odoo.sh branch hostname, e.g. mycompany-main-staging-XXXXX.dev.odoo.com
ODOO_SH_SSH_USER SSH only Odoo.sh build ID shown in the SSH command
ODOO_SH_SSH_KEY SSH only Path to your private SSH key (default ~/.ssh/id_ed25519)

*API keys available in Odoo 14+. For older versions use ODOO_USERNAME + ODOO_PASSWORD.

SSH setup (Tier 6 tools)

SSH tools let Claude upload files and run commands directly on the Odoo.sh server, bypassing git commits for fast iteration.

1. Add your public key to Odoo.sh

Go to https://www.odoo.sh → click your avatar (top right) → Change My ProfileSSH Keys → paste the output of:

cat ~/.ssh/id_ed25519.pub

Odoo.sh only accepts ssh-rsa and ssh-ed25519 keys.

2. Load your key into the macOS SSH agent

ssh-add --apple-use-keychain ~/.ssh/id_ed25519

3. Find your branch SSH host

In the Odoo.sh dashboard, click your branch → Connect → copy the SSH command. It looks like:

ssh 31140548@mycompany-main-staging-31140548.dev.odoo.com

4. Add to your .env or MCP config

ODOO_SH_SSH_HOST=mycompany-main-staging-31140548.dev.odoo.com
ODOO_SH_SSH_USER=31140548
ODOO_SH_SSH_KEY=~/.ssh/id_ed25519

Or via claude mcp add:

claude mcp add odoo-mycompany uvx odoo-sh-mcp \
  -e ODOO_URL=https://mycompany.odoo.com \
  -e ODOO_DB=mycompany \
  -e ODOO_API_KEY=your_key_here \
  -e ODOO_USERNAME=you@mycompany.com \
  -e ODOO_SH_SSH_HOST=mycompany-main-staging-31140548.dev.odoo.com \
  -e ODOO_SH_SSH_USER=31140548 \
  -e ODOO_SH_SSH_KEY=~/.ssh/id_ed25519

Development

git clone https://github.com/nicoruiz/odoo-sh-mcp
cd odoo-sh-mcp
python3 -m venv .venv && source .venv/bin/activate
pip install -e "." pytest pytest-asyncio
pytest tests/ -v

License

MPL-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

odoo_sh_mcp-0.4.0.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

odoo_sh_mcp-0.4.0-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file odoo_sh_mcp-0.4.0.tar.gz.

File metadata

  • Download URL: odoo_sh_mcp-0.4.0.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for odoo_sh_mcp-0.4.0.tar.gz
Algorithm Hash digest
SHA256 dcd00b0a0a1fcf1ecc83ead40774276779f3b735eec42dbb5bae6622cf37af6e
MD5 b434ff16d9ea39979096c0c962766afc
BLAKE2b-256 9e28c39299a60129608abc9bd6e0785e7ca45e12f04d6f63ba15e8d3991785d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for odoo_sh_mcp-0.4.0.tar.gz:

Publisher: release.yml on IamNewInThis/odoo-sh-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file odoo_sh_mcp-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: odoo_sh_mcp-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for odoo_sh_mcp-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 38abc66a613ea632fe24e3c5a9003a2f9df5f801d48e680f5f0a7a9588d83d5c
MD5 3684340f02b02e9228afcfa7803f79bf
BLAKE2b-256 9f52c348e7f3fb8f24fb5ed3cfa2114ebbb94a0011c1922b285e12a4813abc84

See more details on using hashes here.

Provenance

The following attestation bundles were made for odoo_sh_mcp-0.4.0-py3-none-any.whl:

Publisher: release.yml on IamNewInThis/odoo-sh-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page