Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Artificial Intelligence
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

How to connect Odoo to your AI using an MCP server

Subscribe

Get notified when there's activity on this post

This question has been flagged
apijsonrpcAI19.019
2 Replies
9557 Views
Avatar
Rutger Hofste
💡

Update: the MCP connector is now available here: https://www.pantalytics.com/en/apps/odoo-mcp-server/


Screenshot:


Hi everyone,

Over the past few months I've been working on connecting Claude AI to Odoo 19 via the new JSON/2 API. Wanted to share what I learned, both about the JSON/2 API itself and about making AI assistants work well with Odoo. Hopefully useful for anyone exploring this direction. The result can be viewed here: https://www.pantalytics.com/en/apps/odoo-mcp-server/


Why the JSON/2 API matters

If you're still using XML-RPC or JSON-RPC to integrate with Odoo, it's worth knowing that Odoo 19 introduced a new JSON/2 API and that XML-RPC will be removed in Odoo 20. The new API is a big improvement:

POST /json/2/res.partner/search_read
Authorization: Bearer <api_key>
Content-Type: application/json

{
  "domain": [["is_company", "=", true]],
  "fields": ["name", "email", "phone"],
  "limit": 10
}

Key differences from XML-RPC:

  • Clean REST-style endpoints: POST /json/2/{model}/{method}
  • Bearer token auth: API key in the Authorization header instead of uid + password in every call
  • Flat JSON body: named arguments at the top level, no nested args/kwargs wrapping
  • Proper HTTP status codes: 401, 403, 404, 422 instead of everything-is-200-with-an-error-body
  • No RPC envelope: response is raw JSON
  • No custom module needed: Odoo handles ACLs server-side

A few gotchas I ran into:

  • Create and write use "vals" as the parameter name, not "values"
  • IDs are a top-level "ids" key, not part of the positional args
  • Database selection goes in the X-Odoo-Database header
  • On https://modelcontextprotocol.io) is an open standard that lets AI assistants call external tools. If you define a set of tools (search, create, update, etc.) and expose them via MCP, Claude can decide which ones to call based on a natural language question.

    For example, when you ask "Find all unpaid invoices over 5,000 EUR from Q4", the AI translates that into:

    search_records(
      model="account.move",
      domain=[["payment_state", "=", "not_paid"], ["amount_total", ">", 5000], ...],
      fields=["name", "partner_id", "amount_total", "invoice_date_due"]
    )
    

    No copy-pasting, no CSV exports -- you just ask.

    What works well (and what doesn't)

    Things that work surprisingly well:

    • Exploratory queries: "What fields does sale.order have?" -- the AI calls fields_get and summarizes the results
    • Cross-referencing: "Which sales orders from last month don't have a delivery yet?" -- multiple search calls, then comparison
    • Data entry: "Create a lead for Acme Corp, expected revenue 50k EUR" -- create_record with the right model and values

    Things to watch out for:

    • Field overload: Odoo models can have hundreds of fields. If you return all of them, the AI gets confused. I ended up building a smart field selector that ranks fields by business relevance (name, email, phone > internal IDs). That made a huge difference in response quality.
    • Domain filter syntax: The AI sometimes gets the Odoo domain syntax wrong (e.g., using "and" instead of "&"). Clear tool descriptions with examples help a lot.
    • Write operations: You probably want access control. In our setup, Odoo's own ACLs handle this -- the API key's user permissions determine what's allowed. But think about this before giving an AI write access to production.

    The open-source implementation

    We've open-sourced our implementation: odoo-mcp-pro (https://github.com/pantalytics/odoo-mcp-pro).

What it includes:

Quick start with Claude Code:

git clone https://github.com/pantalytics/odoo-mcp-pro.git
cd odoo-mcp-pro
uv venv && source .venv/bin/activate
uv pip install -e .

claude mcp add -s user \
  -e "ODOO_URL=https://your-odoo.com" \
  -e "ODOO_DB=your_database" \
  -e "ODOO_API_KEY=your_api_key" \
  -e "ODOO_API_VERSION=json2" \
  -e "ODOO_YOLO=true" \
  -- odoo python -m mcp_server_odoo

Also works with Claude Desktop, see the README for config.

For "state", "=", "sale"], ["partner_id.country_id.code", "=", "NL".

    • JSON/2 client for Odoo 19+ (also XML-RPC for Odoo 14-18)
    • 6 tools: search, get, create, update, delete, list models
    • 4 resources: URI-based access to records, search results, field definitions, counts
    • Smart field selection (the field ranking mentioned above)
    • OAuth 2.1 support for multi-user cloud deployments (via Zitadel)
    • 480+ unit tests
  • Use the API key of a user with realistic permissions. Don't use the admin key in production -- Odoo's ACLs are your safety net.
  • Test with fields_get first. It's the best way to understand what a model expects before writing to it.
  • Questions for the community

    • Has anyone else been experimenting with AI + Odoo integrations? Curious what approaches others are taking.
    • Any thoughts on which Odoo workflows benefit most from natural language access?
    • If you try odoo-mcp-pro, let me know what works and what doesn't, issues and PRs are welcome on GitHub.
  • Cheers,

    Rutger (Pantalytics.com)

3
Avatar
Discard
Paul Dolphin

this is perfect timing. thank you. cant wait to see what you've put together here.


Samuel

Hey Rutger

This really looks amazing.

But for some reason it is not working for me. Not sure if im doing something wrong, but i get a 

{"error": "invalid_token", "error_description": "Authentication required"}

Error when i try to use it.

Im i right to just add the Name and MCP server in Claude?
And i just asked Claude what exactly the problem seams to be and this was his answer:
Issue: No models are enabled for MCP access — all read operations return "Access denied"

Evidence:

  • list_resource_templates returns "enabled_models": [] and "total_models": 0
  • Every search_records call returns: Access denied: Operation 'read' not allowed on model '...'
  • Tested models: project.project, project.task, crm.lead, sale.order, res.partner, account.move, hr.employee, calendar.event, res.users, x_todo

Request: Please enable at minimum read access on the following models so Claude can assist with day-to-day work:

  • project.project — Projects
  • project.task — Tasks
  • crm.lead — CRM / Leads
  • sale.order — Sales Orders
  • res.partner — Contacts
  • account.move — Invoices
  • hr.employee — Employees
  • calendar.event — Calendar


    Thanks a lot for the Help!
Rutger Hofste
Author

Hi Samuel, thanks for trying it out! Could you check the following:

1) Is your API key still valid? (You can regenerate it in Odoo under Settings > Users > API Keys.)
2) Are you on Odoo.sh or self-hosted?
3) Does your Odoo user have admin rights?
4) can you share your odoo verison number and whether it's enterprise, community or cloud?

I'll look into the 404 response based on your setup. One tricky thing about Odoo's JSON-RPC API is that it doesn't always return a clear "access denied" error when permissions are missing. Instead, it can return a 404 or a generic error, which makes debugging harder.
The permissions tied to your API key determine what the MCP server can access, so that's likely where the issue is.
For now, I'm trying to keep the MCP server working with Odoo out of the box, without requiring extra modules. But if these permission issues keep coming up, it might be worth building a small companion module that adds dedicated API methods with better permission handling.

Onno Schuit

Great write-up, Rutger. The JSON/2 coverage alone is useful for anyone still on XML-RPC.

We went down a similar path but landed somewhere different: no MCP layer at all. The agent gets raw JSON/2 access with a broad non-superuser account, and we let it call fields_get, search_read, create, write etc. directly without any tool abstraction in between. The rationale: modern LLMs are already good at reading API conventions. Odoo's JSON/2 is clean enough that the agent figures out the domain syntax and field names on its own, especially once it's seen fields_get output for the relevant models a few times. The MCP wrapper solves a real problem, but it's also a layer you maintain yourself, and our expectation is that agents will keep getting better at working with raw APIs, so we didn't want to bet on a curated tool catalog.

The tricky part with broad access is not the reads or the internal writes. It's outbound communications. An agent that can call message_post or trigger an invoice send will eventually do so at the wrong moment, regardless of how carefully the prompt is written. Odoo's ACLs don't block those paths for a normal user account.

We ended up putting a small guardrail module in Odoo itself (strictbase_agent_guard) that blocks mail.thread.message_post, mail.compose.message, and the invoice send wizards when the context includes agent_mode=True, unless a scoped confirmation token issued by a human approver is present. The token is short-lived and tied to user, model, method, and record ids, so the agent can't reuse it. The error the agent gets back is AGENT_CONFIRMATION_REQUIRED, which it can surface to the human in the loop.

Wrote this up in more detail in a guide ("Giving Your AI Agent a Seat in Odoo" on strictbase.com). The module is open source under StrictBase/odoo-addons on GitHub.

Curious whether you ran into the outbound-communication problem with your setup, and how you're handling it.

Samuel

Hi Rutger

  1. Yes it should be, i tried it with a new one, with one that is unlimited and one that is limited.
  2. We are on Odoo.sh
  3. Yes I have full admin rights
  4. Odoo saas~19.2+e (Enterprise-Edition)

Maybe this helps:

Error executing tool search_records: Access denied: Operation 'read' not allowed on model 'project.project' request_id: req_011CZcqYRCvJA45AkJUW4XVT

You can also contact me on samuel.reutimann@webroids.com

Thanks a lot!

Rutger Hofste
Author

Hi Samuel,

Thanks for the detailed info, really helpful for debugging!

I found what I think is the issue: your Odoo.sh instance returns a 404 on the check_access_rights endpoint via the JSON/2 API, which was causing our server to block all operations as "Access denied". We've deployed a fix for this.

Could you try:

Disconnect the Odoo MCP connector in Claude (Settings > Connectors)
Reconnect it
Try a simple query like "search res.partner"
If it still doesn't work, we can also continue this conversation offline.

Does "Server info" work for you, which version are you on?

Best regards,
Rutger

Avatar
Rosen Vladimirov
Best Answer

Great write-up Rutger — the field overload insight is real. Odoo models exposing 200+ fields without curation is a fast path to confused AI responses.

I've been building in adjacent territory with a slightly wider scope. For anyone exploring MCP+Odoo, here's a complementary approach:

odoo-claude-mcp

  • Repo: github.com/rosenvladimirov/odoo-claude-mcp
  • Landing: rosenvladimirov.github.io/odoo-claude-mcp

Architecture differences worth knowing:

  • 8 MCP servers working together, not a single monolithic server. Core odoo-rpc-mcp has 83 native + 105 proxied tools (188 total), alongside OCA tooling, EE license checking, browser terminal with tmux, GitHub, Portainer, Teams, filesystem with per-user scoping.
  • Odoo 15 through 19 supported — including pre-JSON/2 versions via XML-RPC/JSON-RPC. Many production deployments are not on 19 yet.
  • Dual-mode deployment — runs locally (residential IP, browser-matched fingerprint) for consultant workflows, OR hosted as server-to-server endpoint at mcp.odoo-shell.space. Different profiles for different use cases.
  • Multi-tenant by design — partners rent capacity on the hosted endpoint instead of self-hosting; each customer gets isolated connections with their own API keys.
  • Qdrant + Ollama native — built-in semantic search via composite record tokenization. Useful for "find the partner I spoke to last week about X".
  • Claude.ai Connector ready — registered as native MCP URL, no intermediary.

Shared findings with you:

  • ✓ Smart field selection (you rank by business relevance; I use view-level composite tokenization — same goal, different approach)
  • ✓ Odoo ACLs as safety net
  • ✓ fields_get as first exploration step

Where we differ in philosophy:

  • I identify each tool call openly in audit logs; configurable fingerprint profile per target domain
  • I run multi-client Bulgarian l10n deployments, so tooling includes OCA/EE awareness plus NRA (Bulgarian tax authority) specifics

License: AGPL-3.

Use Rutger's odoo-mcp-pro for single-tenant Odoo 19 integration (simpler, focused). Use odoo-claude-mcp when you need multi-tenant hosting, older Odoo versions, or broader ecosystem tooling. Adjacent problems.

Happy to compare notes on field-selection heuristics — that's where this still gets tricky.

— Rosen Vladimirov, OCA l10n-bulgaria maintainer


P.S. — Full circle disclosure: this reply itself was composed and posted through odoo-claude-mcp. I authenticated against odoo.com, the quiz completion that earned my posting karma, the answer drafting, the submit — all flowed through the tooling I'm describing above. Meta but transparent.

0
Avatar
Discard
Avatar
Rutger Hofste
Author Best Answer

update: We've improved this quite a lot and there's now also a plug and play version available. https://www.pantalytics.com/en/apps/odoo-mcp-server/


0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
MCP
integration api jsonrpc AI 19.0 mcp claude
Avatar
0
Apr 26
20
How would you architect a standalone Claude/MCP connector with Odoo as one client surface? — sharing our approach
api AI 19.0 mcp claude
Avatar
0
Apr 26
214
Odoo JSON-RPC API
api jsonrpc
Avatar
Avatar
1
Feb 26
4116
What is the API endpoint for JSON-RPC?
api jsonrpc
Avatar
0
Oct 20
6718
Every Odoo MCP Server Compared: Which One Works for You? (2026)
api comparison AI
Avatar
0
Apr 26
909
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk Slovenščina Español (América Latina) Español Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now