| name | odoo-mcp-cli |
| description | Use this skill to manage Odoo profiles and run data operations directly from the terminal using the odoo-mcp CLI. Triggers on: 'add profile', 'list profiles', 'test connection', 'search records cli', 'export records', 'import records cli', 'run mcp server', 'odoo-mcp command', 'delete records cli', 'unlink records'. |
| last_validated | "2026-05-09T00:00:00.000Z" |
Odoo MCP CLI Commands Reference
Complete reference for every CLI command provided by odoo-mcp.
Use this skill when interacting with Odoo directly from the terminal or
writing automation scripts — all commands output JSON to stdout and are
pipeable with tools like jq.
Prerequisites
odoo-mcp-multi installed (pip install odoo-mcp-multi)
- At least one Odoo profile configured (
odoo-mcp add-profile)
Steps
- Add a profile:
odoo-mcp add-profile (interactive) or supply flags directly.
- Test the connection:
odoo-mcp test -p <profile>.
- Run any data operation using the commands below. Use
--profile / -p to target a specific environment.
- Pipe output through
jq for further processing.
Global Options
All data commands accept:
| Flag | Short | Description |
|---|
--profile | -p | Target profile name (uses default if omitted) |
--help | | Show command help and usage |
Profile Management
add-profile — Register a New Instance
Interactive wizard to add Odoo connection credentials.
odoo-mcp add-profile
odoo-mcp add-profile --name prod --url https://odoo.example.com --database mydb --user admin --password secret
odoo-mcp add-profile --name prod19 --url https://odoo19.example.com --database mydb --api-key YOUR_API_KEY --protocol json2s
| Flag | Description |
|---|
--name | Profile name |
--url | Odoo instance URL |
--database | Database name |
--user | Login username (legacy auth, Odoo < 19) |
--password | Login password (legacy auth, Odoo < 19) |
--api-key | API key for Odoo 19+ Bearer auth (/json/2) |
--protocol | RPC protocol: auto, json2s, jsonrpcs, xmlrpcs (default: auto) |
--default | Set as the default profile |
--test/--no-test | Test connection before saving (default: --test) |
list-profiles — Show Configured Profiles
odoo-mcp list-profiles
Output: JSON array with name, URL, database, and default status for each profile.
edit-profile — Modify an Existing Profile
odoo-mcp edit-profile prod --url https://new-url.example.com
odoo-mcp edit-profile old-name --new-name better-name
odoo-mcp edit-profile prod19 --api-key
Only the specified fields are updated; others remain unchanged.
remove-profile — Delete a Profile
odoo-mcp remove-profile staging
odoo-mcp remove-profile staging --force
set-default — Set the Default Profile
odoo-mcp set-default prod
test — Test Connection
odoo-mcp test -p prod
Verifies that the stored credentials can connect to the Odoo instance.
run — Start the MCP Server
odoo-mcp run
odoo-mcp run -p prod
Odoo Data Operations
search-read — Query Records
odoo-mcp search-read -m res.partner \
--domain "[('is_company', '=', True)]" \
--fields "name,email,phone" \
--limit 10 \
--order "name asc" \
-p prod
| Flag | Short | Default | Description |
|---|
--model | -m | (required) | Model name |
--domain | -d | [] | Odoo domain filter |
--fields | -f | all | Comma-separated field names |
--limit | -l | 100 | Max records |
--offset | | 0 | Records to skip (pagination) |
--order | | "" | Sort order |
--format | -F | json | Output format: json, compact, table, html, csv |
Output is a pagination envelope with records, total, has_more, and next_offset.
write — Update Records
odoo-mcp write -m res.partner \
--ids "1,2,3" \
--values '{"phone": "+52 555 1234"}' \
-p prod
| Flag | Short | Description |
|---|
--model | -m | Model name |
--ids | -i | Record IDs (comma-separated or JSON array) |
--values | -v | JSON object with field values |
unlink — Delete Records
odoo-mcp unlink -m res.partner \
--ids "10,11,12" \
-p prod
| Flag | Short | Description |
|---|
--model | -m | Model name |
--ids | -i | Record IDs (comma-separated or JSON array) |
create — Create a Record
odoo-mcp create -m res.partner \
--values '{"name": "Alice", "email": "alice@example.com"}' \
-p prod
| Flag | Short | Description |
|---|
--model | -m | Model name |
--values | -v | JSON object with field values |
export-records — Native Export
Uses Odoo's export_data — returns a clean array of dicts with External IDs.
odoo-mcp export-records -m res.partner \
--fields "id,name,country_id/id" \
--domain "[('active', '=', True)]" \
-p prod
| Flag | Short | Default | Description |
|---|
--model | -m | (required) | Model name |
--fields | -f | id,name | Comma-separated fields |
--domain | -d | [] | Search domain |
--limit | -l | 500 | Max records to export |
--offset | | 0 | Records to skip (pagination) |
Output is a pagination envelope with records, total, has_more, and next_offset.
Tip: Use field/id syntax to get External IDs of relational fields.
import-records — Native Import (Bulk)
Uses Odoo's load — updates records with matching External IDs; creates new ones otherwise.
odoo-mcp import-records -m res.partner \
--fields "id,name,phone" \
--rows '[{"id": "base.res_partner_1", "name": "Updated", "phone": "12345"}]' \
-p prod
| Flag | Short | Description |
|---|
--model | -m | Model name |
--fields | -f | Comma-separated field names matching the data |
--rows | -r | JSON array of dicts |
execute-kw — Execute Any Method
odoo-mcp execute-kw -m sale.order \
--method action_confirm \
--args "[[42]]" \
-p prod
odoo-mcp execute-kw -m mail.mail \
--method send \
--args "[[123]]" \
--kwargs '{"force_send": true}' \
-p prod
| Flag | Short | Default | Description |
|---|
--model | -m | (required) | Model name |
--method | | (required) | Method to call |
--args | -a | [] | Positional args (JSON array) |
--kwargs | -k | {} | Keyword args (JSON object) |
get-version — Server Version
odoo-mcp get-version -p prod
list-models — Discover Models
odoo-mcp list-models --search partner -p prod
| Flag | Short | Description |
|---|
--search | -s | Filter models by name or technical name |
list-fields — Inspect Model Schema
odoo-mcp list-fields -m account.move -p prod
| Flag | Short | Description |
|---|
--model | -m | Model name to inspect |
Agent-Optimized Usage
The --format / -F flag changes how output is written to stdout:
- JSON format (default) retains the full pagination envelope (
records,
total, has_more, next_offset) as a single JSON object — ideal for
piping into jq.
- Non-JSON formats (
table, csv, html) print the formatted data
directly to stdout without JSON wrapping, making them suitable for
human-readable display or redirection to a file.
- Pagination metadata for non-JSON formats appears as a
# comment
header line at the top of the output (e.g.,
# total=1500 limit=100 offset=0 has_more=true next_offset=100).
The --format flag is available on these commands:
search-read
list-fields
list-models
export-records
odoo-mcp search-read -m res.partner -f name,email --format table -l 10
odoo-mcp search-read -m res.partner -f name,email,phone --format csv > partners.csv
Usage Examples
Example 1: Pipe with jq
User: "Get only the names of all companies"
Action:
odoo-mcp search-read -m res.partner -d "[('is_company','=',True)]" -f "name" | jq '.records[].name'
Example 2: Export → Transform → Import across environments
User: "Copy all active products from staging to prod"
Action:
odoo-mcp export-records -m product.template -f "id,name,list_price" -p staging > products.json
odoo-mcp import-records -m product.template -f "id,name,list_price" -r "$(cat products.json)" -p prod
Example 3: Script automation
User: "Confirm all draft sale orders in prod"
Action:
#!/bin/bash
ORDERS=$(odoo-mcp search-read -m sale.order -d "[('state','=','draft')]" -f "id" -p prod | jq '[.records[].id]')
odoo-mcp execute-kw -m sale.order --method action_confirm --args "[$ORDERS]" -p prod
Example 4: Delete records
User: "Delete all archived partners"
Action:
IDS=$(odoo-mcp search-read -m res.partner -d "[('active','=',False)]" -f "id" -p prod | jq '[.records[].id]')
odoo-mcp unlink -m res.partner -i "$IDS" -p prod