MCP Server with OAuth 2.1 | Connect Claude & ChatGPT to Odoo | Runs as the User
by Armando Diaz https://github.com/$ 172.78
MCP Server for Odoo, with OAuth 2.1
Connect Claude, ChatGPT and any AI agent to Odoo over the Model Context Protocol.
Every call runs with the connected user's own permissions — never as administrator.
The question every administrator asks first
“If I connect an AI agent to my ERP, what stops it from reading the payroll, or deleting a year of invoices?”
Most connectors answer that with configuration. This one answers it by design.
| Runs as the connected user |
No sudo() on any data path. Access rights, record rules and
multi-company restrictions are enforced by the Odoo ORM itself. If a user
cannot see a record in the interface, the agent cannot see it either.
|
| No delete tool exists | Not a setting you can switch on by mistake — there is no such tool in the protocol surface at all. An agent has no way to destroy a record. |
| Read-only by default | Creating and updating must be enabled explicitly, per key. When it is off, the write tools are not even advertised to the agent. |
| Full audit log | Who ran which tool, on which model, with which filter, how many rows came back and how long it took. Kept 90 days, then purged automatically. |
| Hard row caps | Field selection is mandatory and result size is capped per policy, so a curious agent cannot pull your whole database into a conversation — or into your AI provider bill. |
Two ways to connect
OAuth 2.1 — for claude.ai and ChatGPT.com
Add your Odoo URL as a custom connector and the application registers itself through Dynamic Client Registration (RFC 7591), sends the user through a consent screen served by your own Odoo, and receives a scoped token. PKCE with S256 is mandatory; refresh tokens rotate on every use; there is no client secret to leak. Nobody copies and pastes a credential anywhere.
API key — for Claude Desktop, Claude Code and your own agents
Generate a key from the Odoo interface and the dialog hands you the exact command, ready to paste. The secret is shown once and only its hash is stored.
Every call, on the record
Who ran which tool, on which model, with which filter, how many rows came back and how long it took. Refusals are logged too, with the reason — which is how you prove to an auditor that the boundary holds.
Policies decide what an agent can reach
Pick the models, cap the rows, and decide whether writing is allowed at all. A policy can only narrow what the connected user could already do — never widen it.
The eight tools
odoo_list_models | What this connection can reach, already filtered by policy and by the user's own rights |
odoo_describe_model | Fields of a model: type, label, required, and what relations point at |
odoo_search_records | Search with a domain, return only the fields asked for |
odoo_read_records | Read specific records by id |
odoo_count_records | Size a query before pulling it |
odoo_aggregate_records | Group and total server-side instead of summing rows in the conversation |
odoo_create_record | Create — only when the policy allows writing |
odoo_update_record | Update by id — only when the policy allows writing |
What it does not do
Stated plainly, so nobody buys the wrong thing: there is no delete tool, no arbitrary
method execution, no RAG or vector search, no dashboard or chart builder, no batch job
engine, and no server-sent-events stream. It exposes MCP tools only, not
resources or prompts.
Requirements
- Odoo Community or Enterprise 17.0, 18.0 or 19.0, on-premise or Odoo.sh. Odoo Online does not allow third-party modules with Python code.
- No external Python dependencies. Standard library only, so there is nothing
to
pip installand nothing to break on upgrade. - For remote clients such as claude.ai, Odoo must be reachable over HTTPS and running
with
proxy_mode = Truebehind its reverse proxy.
Support
90 days of free support for bugs in the module. Excludes customisations, data recovery, server installation and issues with third-party AI providers.
Keywords: mcp, mcp server, model context protocol, claude, claude desktop, claude.ai, claude code, chatgpt, openai, anthropic, ai agent, ai connector, oauth 2.1, dynamic client registration, api key, audit log, record rules, acl, read-only, odoo community, on-premise, odoo.sh.
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 1858 |
| Technical Name |
mcp_server_oauth |
| License | OPL-1 |
| Website | https://github.com/ |
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module