odoo-preview-mcp
An MCP server that lets Claude, Codex or another AI assistant read and change your Odoo data as the signed-in person, with a preview and an approval before changes.
You ask Claude things like "show me open opportunities over 50,000 by stage", "create a quotation for Acme with 3 licences" or "match this bank line with the Northwind bill". Claude does the work in your real Odoo, inside that person's own Odoo permissions.
Safety guarantees
All company data lives in Odoo, so the server is built safety-first:
| Guarantee | How |
|---|---|
| Claude acts as the person, never through a shared admin key | Each person signs in with their own Odoo API key. Odoo's normal access rights and record rules apply to every call, and Odoo records every change under that person's name. Claude can do only what that person can do in Odoo, so give people normal user accounts, not admin accounts. |
| A human approves each change | Each change is previewed first: current value → new value, with the names behind ids. To apply it, Claude must send back a token signed for that exact preview. The token works once, expires after an hour by default (at most 24 hours), and stops working if the records changed after the preview. Change tools are also marked destructive, so MCP clients can ask before running them. Two exceptions: internal notes (nobody is e-mailed) have no preview or token and rely on that client prompt only, and MCP_REQUIRE_PREVIEW=false drops the token for creates, updates (removing lines too), buttons and dialogs (sending a quotation by e-mail too), file copies and removing followers. Keep that setting true. The delete tool, messages to followers, adding followers, bank matching, lock dates, bill fixes and custom fields always need the token. |
| Almost nothing can be deleted | Deleting happens only through a few narrow paths, each checked with Odoo right before it runs: (1) the delete tool, for three kinds of records only: draft invoices and bills that never had a number, cancelled quotations, and archived leads, checked with Odoo before the approval and again just before deleting; (2) removing lines from quotations, RFQs and draft invoices; (3) removing a custom field added through Claude, with its place on the form. Undoing a bank match is refused when a payment is linked to the bank line, because Odoo would delete that payment. Every other delete is refused. |
| Field names are checked against live Odoo | Every field name, choice value and record id is checked against the live Odoo database before anything is sent. Unknown names are refused with a "did you mean…?" hint, so a made-up field never reaches Odoo. |
| Read-only unless you switch it on | The default mode shows only tools that read. Change tools do not appear until you set MCP_ACCESS_MODE=read_write. |
| Workflows stay intact | Status fields (state) cannot be written directly. Claude can press only real Odoo buttons (Confirm, Validate, …). Cancel, reset, archive and e-mail buttons are off by default. |
| Secrets stay secret | Passwords, API keys, tokens and system settings are never readable. In company mode, the Odoo keys the server stores are encrypted. |
| Audit trail | The server logs every call: who, which tool, model, record ids, field names and the outcome. It does not log field values or keys, but an error message in the log (up to 300 characters) can quote what was asked. |
The full list of protections and the threat model are in docs/SECURITY.md.
How it compares
Two other open-source Odoo MCP servers are well known, and both have been public much longer than this one: erpipe-org/mcp-odoo and ivnvxd/mcp-server-odoo. Both are good choices. They make different trade-offs.
| odoo-preview-mcp | erpipe-org/mcp-odoo | ivnvxd/mcp-server-odoo | |
|---|---|---|---|
| Whose Odoo account Claude uses | Company mode: each person signs in with their own key on one shared server. Local mode: your own key. | The one login in the server's settings (per Odoo instance). Sign-in per person is part of their hosted product, ERPipe. | The one login in the server's settings. |
| Setup inside Odoo | None, only an API key | None | For production, the mcp_server module from the Odoo Apps store. Without it, a "YOLO mode" for testing. |
| Before a change | Preview, then a token signed for that exact change | Preview and validation, then an approval token, and writes must be switched on | Odoo's permissions, plus the per-model permissions set in the Odoo module |
| Deleting | Only never-numbered drafts, cancelled quotations and archived leads, plus lines on drafts and custom fields it added | Deletes go through the same approval flow as other writes | A delete tool, limited by the module's per-model delete permission |
| Odoo versions | Tested on Odoo 19. Earlier versions ran on Odoo 18 and 20 but have not been re-tested. | 16 to 19, tested against real Odoo 16–19 in Docker | 16 and later with the module, any version in YOLO mode |
What they do well. erpipe-org/mcp-odoo covers more Odoo versions, connects to several Odoo databases from one server, and has diagnostics, upgrade helpers and field-level allow and deny lists. ivnvxd/mcp-server-odoo lets the Odoo administrator choose, inside Odoo, which models the AI may read, change or delete, and it can limit a session to some companies in a multi-company database.
Where this project is different.
- One server for the whole company, with each person's own sign-in. You deploy once. Each person connects from Claude and enters their own Odoo login and API key. Nobody shares a key. Only adding custom fields needs Odoo admin rights.
- Changes are previewed and approved. By default Claude cannot apply a change without a preview first (internal notes aside), and the approval token works only for that exact change.
- Deleting is limited in code to a few narrow cases, not only switched off by a setting.
- Accounting work that goes past create and update: matching bank lines with bills and invoices (also in another currency and in part), Odoo's official reports (P&L, balance sheet, ledgers, ageing, tax report), moving the tax lock date, and correcting a posted vendor bill step by step.
- Files and fields: a private upload page where the person sends files from their computer into Odoo, then one approval to put them on their records; and custom fields placed on a form with a "show only when" rule, with a preview and approval.
If you need many Odoo versions or databases from one server, or control from inside Odoo, look at the other two.
Quick start (local, about 5 minutes)
This runs the server on your own computer for one person, with your own Odoo key.
You need: Python 3.11 or later, uv, and an Odoo database where the external API is allowed. On Odoo Online, the external API needs the Custom plan.
-
Create an Odoo API key. In Odoo: your profile picture → My Preferences → Security tab → Create API Key. If Odoo asks for a scope, choose RPC. Copy the key. (Details: docs/ODOO_SETUP.md.)
-
Test the connection.
ODOO_URL=https://mycompany.odoo.com ODOO_LOGIN=you@mycompany.com ODOO_API_KEY=your-key uvx odoo-preview-mcp check
It prints your Odoo user, the Odoo version and the active safety settings.
-
Add it to your AI app. Pick yours below. Then ask: "Who am I in Odoo?"
Use with Claude
For Claude Code:
claude mcp add odoo -e ODOO_URL=https://mycompany.odoo.com -e ODOO_LOGIN=you@mycompany.com -e ODOO_API_KEY=your-key -- uvx odoo-preview-mcp
For Claude Desktop, open Settings → Developer → Edit Config, add this, and restart Claude Desktop:
{
"mcpServers": {
"odoo": {
"command": "uvx",
"args": ["odoo-preview-mcp"],
"env": {
"ODOO_URL": "https://mycompany.odoo.com",
"ODOO_LOGIN": "you@mycompany.com",
"ODOO_API_KEY": "your-key"
}
}
}
}
Use with Codex
The Codex CLI, the Codex IDE extension and the ChatGPT desktop app share one config file, ~/.codex/config.toml
(OpenAI's MCP docs). Add:
[mcp_servers.odoo]
command = "uvx"
args = ["odoo-preview-mcp"]
startup_timeout_sec = 60 # the first start downloads the package
default_tools_approval_mode = "writes" # Codex asks before any tool that is not read-only
[mcp_servers.odoo.env]
ODOO_URL = "https://mycompany.odoo.com"
ODOO_LOGIN = "you@mycompany.com"
ODOO_API_KEY = "your-key"
Or add it from the terminal:
codex mcp add odoo --env ODOO_URL=https://mycompany.odoo.com --env ODOO_LOGIN=you@mycompany.com --env ODOO_API_KEY=your-key -- uvx odoo-preview-mcp
Run codex mcp list to check it is there, and type /mcp inside Codex to see it connected. With
default_tools_approval_mode = "writes", Codex asks you before each change tool, on top of this server's own
preview and approval.
The server starts read-only. To let Claude make changes (with a preview and an approval), add
MCP_ACCESS_MODE=read_write. If you use pipx instead of uv, run pipx install odoo-preview-mcp and use the
command odoo-preview-mcp in place of uvx odoo-preview-mcp.
For a whole company
Run the server once with HTTPS, and each person connects from Claude with their own Odoo login and API key:
- Prepare Odoo: docs/ODOO_SETUP.md.
- Deploy with Docker on any small server (docs/DEPLOY.md), or on Vercel with a Redis database (docs/DEPLOY_VERCEL.md).
- In Claude: Settings → Connectors → Add custom connector, with your server's URL followed by
/mcp. Each person clicks Connect and signs in on the server's page.
What Claude can do
| Tool | What it does | Mode |
|---|---|---|
odoo_whoami, odoo_help |
Who am I, what is allowed, and per area of Odoo what Claude can and cannot do | always |
odoo_list_models, odoo_describe_model |
Find the model for a concept ("invoice" → account.move) and its fields |
always |
odoo_search, odoo_read, odoo_count, odoo_find |
Find and read records, and turn a name into the right record | always |
odoo_aggregate |
Totals and breakdowns computed by Odoo (revenue by month, pipeline by stage) | always |
odoo_report |
Odoo's official accounting reports for a period, with a link to open them | always |
odoo_list_actions |
The buttons on a model's screens and whether Claude may press them | always |
odoo_read_file |
Read a file that is already in Odoo (a bill's PDF, a contract) | always |
odoo_bank_match_candidates |
The items Odoo's bank screen would offer for one bank line | always |
odoo_preview_create → odoo_create |
Create records (with order lines and so on) | read_write |
odoo_preview_update → odoo_update |
Change field values | read_write |
odoo_preview_action → odoo_run_action |
Press a workflow button (confirm an order, validate) | read_write |
odoo_preview_delete → odoo_delete |
Delete a never-numbered draft invoice or bill, a cancelled quotation or an archived lead | read_write |
odoo_add_note |
Log an internal note in the chatter (nobody is e-mailed). No preview or token: the client asks first | read_write |
odoo_preview_followers → odoo_change_followers |
Add or remove followers | read_write |
odoo_preview_bank_match → odoo_bank_match, odoo_preview_bank_unmatch → odoo_bank_unmatch |
Match a bank line with bills or invoices, in any currency, and undo a match | read_write |
odoo_preview_lock_date → odoo_lock_date |
Move the tax return lock date forward | read_write |
odoo_preview_fix_posted_bill → odoo_fix_posted_bill |
Correct a posted vendor bill step by step | read_write |
odoo_upload_link → odoo_uploaded_files |
A private one-hour page where the person uploads files (up to 4 MB each) into Odoo | read_write, company mode |
odoo_preview_custom_field → odoo_add_custom_field, odoo_preview_place_field → odoo_place_field, odoo_preview_remove_custom_field → odoo_remove_custom_field |
Add a custom field (named x_mcp_…), place it on a form, and remove both again |
read_write + MCP_ALLOW_CUSTOM_FIELDS |
odoo_preview_message → odoo_send_message |
Message a record's followers (this e-mails customers) | read_write + MCP_ALLOW_OUTBOUND_MESSAGES |
The server uses Odoo's generic model API, so it works with the models of any installed app (CRM, Sales, Invoicing, Inventory, Purchase, Project, HR, Helpdesk, Studio models), always inside the person's permissions. Protected areas, such as security settings, credentials and system configuration, stay blocked.
Configuration
All settings are environment variables. .env.example explains each one. The main ones:
| Variable | Default | Meaning |
|---|---|---|
ODOO_URL |
(required) | Your Odoo address, e.g. https://mycompany.odoo.com |
ODOO_LOGIN, ODOO_API_KEY |
(empty) | Your Odoo login and API key. Local mode only; in company mode each person signs in. |
ODOO_DB |
(empty) | Database name. Needed only with several databases or the legacy API. |
ODOO_PROTOCOL |
auto |
json2 (Odoo 19+), jsonrpc (older Odoo), or auto to detect |
MCP_ACCESS_MODE |
read_only |
read_write shows the change tools |
MCP_REQUIRE_PREVIEW |
true |
Keep true. false drops the approval token for creates, updates (removing lines too), buttons and dialogs (sending a quotation by e-mail too), file copies and removing followers |
MCP_ALLOW_ARCHIVE |
false |
Allow archiving and unarchiving |
MCP_ALLOW_CANCEL_ACTIONS |
false |
Allow cancel, reset to draft and mark lost buttons |
MCP_ALLOW_OUTBOUND_MESSAGES |
false |
Allow anything that e-mails or messages people |
MCP_ALLOW_CUSTOM_FIELDS |
false |
Allow adding custom fields and placing them on forms (needs Odoo admin rights) |
MCP_WRITABLE_MODELS |
(all business models) | Allow changes only on these models, e.g. crm.lead,res.partner,project.task |
MCP_BLOCKED_MODELS, MCP_READONLY_MODELS |
(none) | Extra limits; patterns such as hr.* work |
MCP_MAX_WRITE_RECORDS |
100 |
Most records one create or edit may touch (hard limit 100) |
MCP_MAX_ACTION_RECORDS |
20 |
Most records one button, message or delete may touch (hard limit 100) |
MCP_CONFIRM_TTL_SECONDS |
3600 |
How long an approved preview stays usable (hard limit 24 hours) |
MCP_DISPLAY_NAME |
Odoo |
Name shown on the sign-in and upload pages and in Claude, e.g. Acme Odoo |
MCP_ADMIN_CONTACT |
your administrator |
Who people should ask when something is switched off |
MCP_DEFAULT_TIMEZONE |
UTC |
Time zone used when a person's Odoo profile has none |
MCP_PUBLIC_URL |
(empty) | Company mode: the public HTTPS address of this server |
MCP_SECRET |
(empty) | Company mode: 32+ random characters; encrypts stored keys and signs tokens |
MCP_ALLOWED_LOGINS, MCP_ALLOWED_LOGIN_DOMAINS |
(empty) | Company mode: only these logins, or logins on these e-mail domains, may connect |
MCP_REDIS_URL |
(empty) | Company mode on serverless hosting: a Redis database for shared state |
Contributing
Bug reports, ideas and pull requests are welcome. Please read CONTRIBUTING.md first. In short:
- Open an issue before a large change, so we can agree on the approach.
- Keep the safety guarantees above. A change that weakens one will not be merged.
- Add tests.
pytestruns the offline suite in under a minute, with no Odoo needed. - Never put real customer data, API keys or company names in code, tests or issues.
Please report security problems privately, as SECURITY.md explains, not in a public issue.
Development
git clone https://github.com/Sahajta-AI/odoo-preview-mcp && cd odoo-preview-mcp
uv venv && uv pip install -e ".[dev]"
.venv/bin/pytest # offline tests, no Odoo needed
.venv/bin/pytest -m integration # against a throwaway Odoo, see tests/test_live_odoo.py
Tested on Odoo 19. Earlier versions ran on Odoo 18 and 20 but have not been re-tested. Built on the official MCP Python SDK.
License
Apache License 2.0. Copyright 2026 Sahajta AI Solution Private Limited. See LICENSE.
Metadata
Release files for odoo-preview-mcp 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| odoo_preview_mcp-0.1.1.tar.gz | 483.1 kB | With provenance | Details for odoo_preview_mcp-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| odoo_preview_mcp-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for odoo_preview_mcp-0.1.1-py3-none-any.whl |
Total release size: 720.5 kB
Release files / odoo_preview_mcp-0.1.1.tar.gz
| Download URL | odoo_preview_mcp-0.1.1.tar.gz |
|---|---|
| Size | 483.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
160c6a095ec2d471053eda982c21129152e760fc77c1b458244c9d0232ca0bfe
|
|
BLAKE2b-256 checksum How to use checksums |
f356b62d06939a5f26519cc2e4e1795e8d0e1c34045ee50a003ec713fe199a29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.
Transparency logRelease files / odoo_preview_mcp-0.1.1-py3-none-any.whl
| Download URL | odoo_preview_mcp-0.1.1-py3-none-any.whl |
|---|---|
| Size | 237.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e1beb3036987bc21e39d73328b94a9eda94e8408644c769a6d8b5e14e6046eed
|
|
BLAKE2b-256 checksum How to use checksums |
0fde0f2468f2f75fb472bebe00b572761e9305d1dfbd7289222830e0f7bc0c8b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.
Transparency logSecurity for odoo-preview-mcp 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for odoo_preview_mcp-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.