Skip to main content
Glama
odoo-readonly

odoo-readonly

by arisnew

MCPOdoo — Odoo Read-Only MCP (Docker)

MCP server untuk cek data Odoo production/staging via JSON-RPC (read-only).
Proyek standalone di luar repo addon. Satu instance MCP bisa melayani beberapa server Odoo (beda URL/DB/versi) lewat profile.

Persiapan

Clone repo, lalu pilih salah satu mode di bawah. File profiles.json dan .env bersifat lokal (ada di .gitignore) — jangan di-commit.

Opsi A — banyak server (disarankan)

cp profiles.example.json profiles.json
# edit url / db / user per profile (tanpa password)

./scripts/keychain-store.sh prod password
./scripts/keychain-store.sh staging password
docker compose build

Opsional di .env: MCPO_ODOO_DEFAULT_PROFILE=staging dan limit RPC.

Opsi B — satu server (legacy)

cp .env.example .env
# ODOO_URL, ODOO_DB, ODOO_USER — password di Keychain: ./scripts/keychain-store.sh default password
docker compose build

Uji image (opsional)

MCP memakai stdio — biasanya lewat Cursor:

docker compose run --rm -T mcp
# menunggu input JSON-RPC dari stdin; Ctrl+C untuk keluar

Related MCP server: Odoo MCP server

Cursor IDE

Tambahkan di Settings → MCP (atau merge ke ~/.cursor/mcp.json):

{
  "mcpServers": {
    "odoo-readonly": {
      "command": "/ABSOLUTE/PATH/TO/MCPOdoo/scripts/run-mcp.sh"
    }
  }
}

Ganti path dengan lokasi clone Anda. Contoh lengkap: cursor-mcp.example.json.

Script run-mcp.sh menjalankan:

docker compose run --rm -T mcp
(-T = tanpa TTY, cocok untuk protokol MCP stdio.)

Penting: Build image dulu (docker compose build). Setiap ubah kode Python, build ulang.

MCP tidak aktif / error di Cursor

Di Settings → MCP, server odoo-readonly harus hijau. Jika Error / tool discovery gagal:

Penyebab

Perbaikan

Docker Desktop mati

Buka Docker Desktop; tunggu “Running”.

docker tidak ada di PATH Cursor

run-mcp.sh sudah menambah /usr/local/bin & path Docker.app; restart Cursor setelah update script.

Image belum di-build

cd MCPOdoo && docker compose build

Password Keychain

./scripts/keychain-store.sh <profile> password (nama profile = key di profiles.json); izinkan Cursor akses Keychain jika diminta.

Log MCP

Cursor: Output panel → dropdown MCP / odoo-readonly — lihat stderr (MCPOdoo: ...).

Tes manual (harus tetap jalan, tidak exit 127):

/path/to/MCPOdoo/scripts/run-mcp.sh
# menunggu stdio; Ctrl+C
env -i HOME="$HOME" PATH="/usr/bin:/bin" /path/to/MCPOdoo/scripts/run-mcp.sh
# setelah fix PATH di script: tidak boleh "docker not found"

Nama server di Cursor: odoo-readonly (bukan “MCPOdoo”). Tool muncul sebagai namespace user-odoo-readonly.

Akses Odoo dari container

  • Production HTTPS publik: cukup set ODOO_URL=https://... di .env.

  • Odoo di host lokal (macOS): gunakan ODOO_URL=http://host.docker.internal:8069 (compose sudah menambah extra_hosts).

Keamanan

  • Whitelist method ORM di MCP; denylist model sensitif (ir.config_parameter, dll.).

  • Buat user Odoo khusus read-only + API key; jangan pakai admin.

  • Jangan commit .env, profiles.json, atau password/API key. Detail: SECURITY.md.

Menyimpan password di MacBook (lebih aman dari plain .env)

Cara

Kelebihan

macOS Keychain (disarankan)

Terenkripsi, bisa Touch ID; .env hanya URL/DB/user

1Password / Bitwarden CLI

op run --env-file=... atau inject env saat launch

.env chmod 600`

Minimum; tetap plain text di disk (Time Machine, backup)

Keychain (per profile):

./scripts/keychain-store.sh prod password
./scripts/keychain-store.sh staging password
# legacy single-server: ./scripts/keychain-store.sh default password

Account Keychain: prod.ODOO_PASSWORD, staging.ODOO_PASSWORD, atau ODOO_PASSWORD untuk profile default. Service: MCPOdoo.

Beberapa server Odoo (1 MCP)

Konsep

Keterangan

profiles.json

URL, DB, user per server — tanpa password

profile di setiap tool

Contoh: odoo_search_read(..., profile="staging")

odoo_list_profiles

Daftar profile + versi setelah odoo_session_info per server

Versi Odoo berbeda

JSON-RPC ORM (search_read, dll.) umumnya kompatibel 14–18+; cek server_version per profile

Contoh prompt Cursor:

  • “Panggil odoo_list_profiles, lalu odoo_session_info untuk prod dan staging.”

  • “odoo_search_read profile prod, model hr.attendance, domain …”

1Password (opsional, tanpa simpan di .env):

op item get "<your-item>" --fields password --reveal
# atau op run -- docker compose run ...

Cursor MCP cukup memanggil run-mcp.sh; rahasia tidak perlu ada di mcp.json.

Tool MCP

Tool

Fungsi

odoo_list_profiles

Daftar server yang dikonfigurasi

odoo_session_info

Cek koneksi & versi server (parameter profile)

odoo_search_read

List record

odoo_read

Baca by id

odoo_search / odoo_search_count

Id / count

odoo_name_search / odoo_fields_get / odoo_read_group

Eksplorasi model

odoo_call_readonly

Method whitelist lain

odoo_list_installed_modules

Modul terinstall

Tanpa Docker (dev)

python3.12 -m venv .venv && source .venv/bin/activate
pip install -e .
export $(grep -v '^#' .env | xargs)
odoo-readonly-mcp

Struktur

MCPOdoo/
  Dockerfile
  docker-compose.yml
  odoo_readonly_mcp/       # server MCP
  scripts/run-mcp.sh       # entry untuk Cursor
  profiles.example.json    # template multi-server (salin → profiles.json)
  .env.example
  cursor-mcp.example.json
  SECURITY.md
  LICENSE

Lisensi

MIT — lihat LICENSE.

Available Tools

11 tools
odoo_call_readonlyC

Generic read-only ORM call (whitelist only) on the selected profile.

Inputs: model (required), method (required), profile, args_json, +1 more. Returns: result

odoo_fields_getC

Field metadata for a model on the selected Odoo server.

Inputs: model (required), fields, profile, attributes. Returns: result

odoo_list_installed_modulesC

List installed modules on the selected Odoo instance.

Inputs: limit, profile. Returns: result

odoo_list_profilesA

List configured Odoo server profiles (URLs, DB names; no secrets).

Inputs: no named parameters. Returns: result

odoo_readC

Odoo read by ids (JSON list), e.g. [1, 2, 3].

Inputs: ids (required), model (required), fields, profile. Returns: result

odoo_read_groupC

Odoo read_group (aggregations).

Inputs: model (required), lazy, limit, domain, +5 more. Returns: result

odoo_search_countC

Count records matching domain.

Inputs: model (required), domain, profile. Returns: result

odoo_search_readC

Odoo search_read: list records matching domain.

  • profile: server profile id (empty = default). Use odoo_list_profiles first.

  • model: e.g. hr.attendance

  • domain: JSON list, e.g. [["employee_id","=",42]]

Inputs: model (required), limit, order, domain, +3 more. Returns: result

odoo_session_infoA

Connectivity check: user, database, Odoo server version for the given profile.

Inputs: profile. Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 11 tools

    Disambiguation4/5

    The search/read/name_search/search_read/read_group cluster mirrors standard Odoo ORM semantics, so an agent familiar with Odoo can distinguish them (ids-only vs. full records vs. labels vs. aggregations). The main soft spot is odoo_call_readonly, a generic catch-all that can reach the same data as search_read/read, leaving ambiguity about when to use the specific tools versus the generic one.

    Naming Consistency4/5

    All tools share the odoo_ prefix and snake_case, giving a strongly predictable family. Minor deviation in verb/noun ordering (list_profiles, search_count vs. fields_get, read_group, name_search), but these follow Odoo's own ORM method names so it stays readable and intentional.

    Tool Count5/5

    Eleven tools is well within the ideal 3-15 range and each maps to a meaningful operation on the readonly surface (profiles, session, search variants, read, fields, groups, modules, generic call). Nothing feels redundant enough to drop except arguably the generic call.

    Completeness5/5

    For a read-only server, the surface is comprehensive: profile discovery, connectivity check, domain search, counting, record retrieval, label search, field metadata, aggregation, module listing, plus a generic escape hatch for whitelisted readonly ORM calls. No write paths are needed by design, so there are no dead ends.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A read-only MCP server that enables AI assistants to query Odoo instances via XML-RPC, supporting search, read, count, and field inspection without requiring custom modules.
      1
      Mozilla Public 2.0
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables MCP clients to query, create, update, and delete records in a self-hosted Odoo instance, with tools automatically derived from live model introspection.
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to query live ERP/CRM records through Odoo's external JSON-RPC API, covering contact and company lookups, sales orders and quotations, CRM leads and opportunities, customer invoices, and generic search_read access to any Odoo model. Runs either as a hosted gateway endpoint or a local stdio server.
      84 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Free read-only MCP server module for Odoo 15-20: search and read your own Odoo data from Claude, Cursor or any MCP client with an Odoo API key. Five read-only tools; Odoo access rights apply.
      LGPL 3.0