Odoo MCP · Developers

Claude Code and Odoo: Build Modules and Query Live Data

Short answer

Claude Code can work on Odoo in two ways. As a coding assistant it writes and tests modules in your repository, guided by a CLAUDE.md that states your Odoo version and conventions. Connected to a staging Odoo through an MCP server, it can also read the real models, fields and records, so the code it writes matches your database instead of guessing.

Key takeaways

  • A CLAUDE.md with your Odoo version, layout and test command does more for code quality than any prompt.
  • Connect Claude Code to staging over MCP with a read-only key; never to production.
  • Add the server with claude mcp add --transport http and keep the token in an environment variable.
  • On Odoo.sh, work locally and push to a staging branch.

What can Claude Code do with Odoo?

As a coding assistantConnected over MCP
What it touchesFiles in your module repositoryA running Odoo database
Typical jobsModels, views, security CSVs, migrations, tests, upgrades between versionsLook up a model’s fields, check a domain returns the right records, inspect sample data
What it needsA CLAUDE.md and a way to run Odoo testsAn MCP server for Odoo and a read-only key

Used together, it writes code and checks it against the database the code will run on.

What should CLAUDE.md say for an Odoo project?

Claude Code reads CLAUDE.md at the start of every session. For Odoo, include:

# Odoo project notes for Claude Code
- Odoo 19.0 Community; custom addons in ./addons, Odoo source in ../odoo (read-only).
- Install:  ./odoo-bin -c odoo.conf -d dev_db -i my_module --stop-after-init
- Update:   ./odoo-bin -c odoo.conf -d dev_db -u my_module --stop-after-init
- Test:     ./odoo-bin -c odoo.conf -d test_db -i my_module --test-enable --stop-after-init
- Every new model needs an access rule in security/ir.model.access.csv.
- Never edit Odoo core files. Never connect to the production database.

Repeated procedures, such as “add a field with its view and access rule”, can become a Claude Code skill in .claude/skills/, so the steps are the same every time.

How do you connect Claude Code to Odoo over MCP?

  1. Install the MCP module on a staging databaseInstall MCP Server for Odoo on a staging or development copy, not production.
  2. Create a read-only keyIn Odoo, create an MCP API key for a dedicated user and grant read access to the models you work on. New keys start with no model access.
  3. Store the token in an environment variableExport ODOO_MCP_TOKEN in your shell so it is not written into project files.
  4. Add the server to Claude CodeRun claude mcp add with the HTTP transport, your /mcp URL and the Authorization header.
  5. Check the connectionRun claude mcp list, or /mcp inside Claude Code, and confirm the Odoo tools are listed.

The command for MCP Server for Odoo, whose endpoint is /mcp:

export ODOO_MCP_TOKEN="your-staging-key"
claude mcp add --transport http odoo-staging https://staging.your-odoo.com/mcp \
  --header "Authorization: Bearer $ODOO_MCP_TOKEN"
claude mcp list

Add --scope project to share the server with your team through a .mcp.json file in the repository; reference the token as ${ODOO_MCP_TOKEN} there rather than pasting it in. If your server uses OAuth instead of a key, run /mcp inside Claude Code to sign in.

What do you ask Claude Code once it can see Odoo?

  • “List the fields on sale.order.line that relate to discounts, with their types.”
  • “Write a domain for confirmed sale orders without an invoice, and check it returns the three orders I expect.”
  • “Add a delivery_window selection field to sale.order, show it on the form after the commitment date, and write a test.”
  • “Which custom models in this database have no access rules?”

How does this work with Odoo.sh?

Claude Code runs on your machine, not inside Odoo.sh. Clone the Odoo.sh repository, let Claude Code change and test the module locally, then push to a development branch; Odoo.sh builds it and runs your tests. For the MCP connection, install the module on a staging branch and use that branch’s URL. Production stays out of reach.

How do you keep Claude Code safe around Odoo data?

  • Staging only. A staging copy has real structure; if it holds real personal data, limit the models the key can read.
  • Read-only key for a dedicated user. See read-only access for Claude.
  • Hide sensitive fields such as bank accounts and payroll: hiding fields from AI.
  • Review diffs and run the tests before you push; Claude Code asks before running commands unless you allow them.
  • Rotate the key when someone leaves the project.

Sources

Frequently asked questions

Can Claude Code connect to Odoo?

Yes, through MCP. Install an MCP server for Odoo, then add its URL to Claude Code with claude mcp add --transport http. Claude Code can then read the models, fields and records the key allows.

Is Claude Code good for Odoo development?

It is useful for the repetitive parts: models, views, security files, migrations and tests, provided it knows your Odoo version and conventions. Give it a CLAUDE.md with the version, module layout and test command, and review every change as you would a colleague’s.

Can I use Claude Code with Odoo.sh?

Yes, from your own machine. Work in a clone of your Odoo.sh repository, let Claude Code edit and test locally, then push to a development or staging branch so Odoo.sh builds it. Point any MCP connection at a staging database, not production.

Should Claude Code have write access to Odoo?

Not for development work. Reading models, fields and sample records is what helps it write correct code. Keep the key read-only, on staging, and create test data through your module’s own tests instead.

What should a CLAUDE.md for an Odoo project contain?

The Odoo version and edition, where the addons live, the commands to install, update and test a module, your coding conventions, and what Claude Code must never do, such as editing core Odoo files or connecting to production.

Give Claude Code your real Odoo schema

MCP Server for Odoo runs on Odoo 14 to 20, Community and Enterprise. €690 one-time, setup call included.

Get MCP Server for Odoo →