MCP Server for Odoo
Complete setup and configuration guide. Connect Claude, ChatGPT, Cursor, and any MCP-compatible AI client to your Odoo instance with fine-grained access control, OAuth 2.1, and full audit logging.
1. What Is MCP Server for Odoo?
MCP Server for Odoo turns your Odoo instance into a secure data source that any AI assistant — Claude, ChatGPT, Gemini, or a custom agent — can query and act on through a standard protocol called the Model Context Protocol (MCP).
Instead of giving an AI tool direct database access or writing custom integrations, you install one module. From that point, your AI assistants can:
- Search and read any Odoo record they are permitted to access
- Create, update, and delete records on your behalf
- Generate analytics, pivot tables, time-series charts, and funnels from live data
- Build and publish public data pages with live Odoo data
- Generate and install new Odoo modules through conversation
- Trigger AI analysis on individual records and receive results in the chatter
Everything happens through a single secure endpoint (/mcp) with full audit logging of every request.
- It does not send your data anywhere automatically. Data only leaves Odoo when an AI client fetches it and sends it to its own AI provider as part of a conversation.
- It does not embed an AI model. It connects to whichever AI tools you already use.
- It does not bypass Odoo's own security. Requests run as the associated Odoo user, so Odoo's native ACLs and record rules apply on top of MCP-level restrictions.
2. Module Overview
The MCP Server PRO package consists of the following modules. Each is installed separately and serves a distinct purpose.
2.1 MCP Server PRO mcp_server_odoo
The core module. Required for everything else.
- The
/mcpJSON-RPC endpoint - API key management with SHA-256 hashing
- Per-key model, field, and domain-level access control
- 30+ MCP tools covering read, write, analytics, batch operations, and async jobs
- Full audit logging, rate limiting, and Redis integration
- Settings page under MCP → Settings
2.2 OAuth 2.1 mcp_server_odoo_oauth
Adds OAuth 2.1 with PKCE so AI clients like Claude.ai and ChatGPT can connect through a proper browser-based login flow rather than a manually configured API key.
- OAuth authorization, token, and revocation endpoints
- Dynamic Client Registration for automatic AI client onboarding
- Shared client creation wizard for team deployments
- Token rotation with 1-hour access tokens and 30-day rotating refresh tokens
- Discovery endpoints (
.well-known/oauth-protected-resource,.well-known/oauth-authorization-server) - PKCE enforcement — no implicit grants
2.3 Portal Pages mcp_server_odoo_portal
Lets AI assistants create public-facing web pages that display live Odoo data — no coding required.
- Public pages at
/mcp-page/{your-slug} - Nine section types: KPI Cards, Charts, Tables, Progress Bars, Comparisons, Timelines, Metric Grids, Heatmaps, and Rich Text
- Per-page custom theme (brand colour, logo, font)
- URL filter parameters for dynamic filtering
- MCP tools:
create_portal_page,update_portal_page,list_portal_pages,delete_portal_page
2.4 KSRO AI Engine ksro_ai_engine Add-on
Embeds AI directly inside Odoo server actions. Configure a "Generative AI" action on any Odoo model — when triggered, it reads the record, sends it to your chosen AI provider, and writes the response back to the chatter, a field, or as a new activity.
- Support for OpenAI, Anthropic Claude, Google Gemini, and Mistral
- System prompt + per-record Jinja2 prompt templates
- Real-time browser notifications when AI completes
- Full audit log per AI call and prompt preview wizard
2.5 KSRO Web Notify ksro_web_notify Add-on
Real-time browser notifications via Odoo Bus. Used by KSRO AI Engine to push "Agent finished" toasts to the user's browser without a page reload.
3. Requirements
| Requirement | Detail |
|---|---|
| Odoo version | 18.0 (Community or Enterprise) |
| Odoo deployment | Odoo.sh, self-hosted, or on-premise |
| Python | 3.10 or higher (standard with Odoo 18) |
| GitHub access | Required — modules contain Python code and must be installed via GitHub |
| External Python packages | openai, anthropic, google-genai, mistralai (only if using KSRO AI Engine) |
| Redis | Optional — required only for distributed rate limiting across multiple Odoo workers |
| HTTPS | Required for OAuth 2.1 in production |
4. Installation
4.1 Odoo.sh (Recommended)
Odoo.sh links your Odoo instance to a GitHub repository. Custom modules are installed by adding them to that repository and deploying.
Step 1 — Get the module files from KSRO Labs after purchasing. Clone or download:
mcp_server_odoomcp_server_odoo_oauthmcp_server_odoo_portal
Step 2 — Copy the module folders into the root of your Odoo.sh GitHub repository:
your-odoo-repo/ ├── mcp_server_odoo/ ├── mcp_server_odoo_oauth/ ├── mcp_server_odoo_portal/ └── (your other custom modules)
Step 3 — Commit and push:
git add mcp_server_odoo mcp_server_odoo_oauth mcp_server_odoo_portal git commit -m "Add MCP Server PRO modules" git push origin main
Odoo.sh will automatically detect the new modules and rebuild the instance.
Step 4 — Install in Odoo:
- Go to Apps in Odoo
- Click Update Apps List (requires Developer Mode)
- Search for "MCP Server"
- Install MCP Server PRO first
- Then install MCP Server OAuth 2.1
- Then install Portal Pages (if purchased)
4.2 Self-Hosted / On-Premise
Step 1 — Copy the module folders to your Odoo custom addons directory:
cp -r mcp_server_odoo /opt/odoo/custom-addons/ cp -r mcp_server_odoo_oauth /opt/odoo/custom-addons/ cp -r mcp_server_odoo_portal /opt/odoo/custom-addons/
Confirm the addons path is registered in your odoo.conf:
[options] addons_path = /opt/odoo/addons,/opt/odoo/custom-addons
Step 2 — Restart Odoo:
sudo systemctl restart odoo
Step 3 — Install in Odoo using the same steps as Section 4.1 Step 4.
4.3 Installing KSRO AI Engine (Add-on)
Install the required Python dependencies:
pip install openai anthropic google-genai mistralai markdown-it-py
Then add the module folders to your repository/addons path and install in Odoo in this order:
ksro_web_notify— install firstksro_ai_engine— install second (depends on ksro_web_notify)
5. Initial Configuration
5.1 Enable Developer Mode
Several configuration steps require Developer Mode to be active.
Go to Settings → General Settings → scroll to the bottom → Activate the developer mode
Or navigate directly to:
https://your-odoo.com/web?debug=1
5.2 Verify the MCP Endpoint
Once the module is installed, your MCP endpoint is live at:
https://your-odoo.com/mcp
You can verify it is active by opening this URL in a browser. You will see an empty response or a CORS header — this is correct. The endpoint only responds to POST requests with a valid JSON-RPC payload. The endpoint URL is also shown in Odoo → Settings → MCP Server → MCP Endpoint URL.
5.3 Basic Settings
Go to Settings → MCP Server (scroll to the MCP Server section).
| Setting | Recommended Value | Notes |
|---|---|---|
| Enable MCP Server | On | Global on/off switch |
| Log MCP Payloads | Off by default | Enable only if you need full request/response in audit logs |
| Max Payload Size (KB) | 512 | Increase if you plan to send large prompts |
| Global Rate Limit | 0 (unlimited) or 100 | Requests per minute across all keys |
| Hide Internal Errors | On | Prevents stack traces leaking to AI clients |
| Audit Retention (days) | 90 | Set to 0 to keep indefinitely |
6. API Keys — The Foundation of Access Control
API keys are the credentials that allow AI tools to authenticate with your MCP server. Each key represents a distinct access identity with its own permission scope.
6.1 Creating an API Key
- Go to MCP → API Keys
- Click New
- Fill in: Name (e.g., "Sales Team — Claude Desktop"), User (the Odoo user this key acts as), Active (keep checked)
- Click Save
- The system generates a Bearer token and shows it once. Copy it immediately — it cannot be retrieved again.
6.2 Token Versioning
Each key can have multiple active token versions simultaneously. This allows seamless rotation:
- Generate a new token version
- Update your AI client configuration with the new token
- Revoke the old token version
6.3 Token Rotation
Token rotation runs automatically on a schedule. When a token is rotated, the current token continues working for a grace period, a new token is generated, and the old token is revoked after the grace period. You can also rotate tokens manually from the API Key form view.
6.4 How to Use the API Key
Provide the key as a Bearer token in the Authorization header:
Authorization: Bearer YOUR_TOKEN_HERE
In Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"odoo": {
"url": "https://your-odoo.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_TOKEN_HERE"
}
}
}
}7. Key Model Access — Permissions Per Key
7.1 Adding Model Access to a Key
- Go to MCP → Key Model Access
- Click New
- Select the API Key
- Select the Model (e.g.,
sale.order,crm.lead,res.partner) - Check which operations to allow: Read, Create, Write, Delete
- Optionally configure Domain Filter and Allowed Fields
- Click Save
Repeat for each model the key should access.
7.2 Domain Filter — Restricting Which Records Are Visible
For any model in a key's scope, you can restrict which records are visible using an Odoo domain expression.
# Only see opportunities in a specific team [["team_id.name", "=", "Europe Sales"]] # Only see active customers [["customer_rank", ">", 0], ["active", "=", true]]
The domain is enforced at the database level — the AI cannot request records outside it regardless of how the query is phrased.
7.3 Allowed Fields — Restricting Which Fields Are Returned
You can define an allowlist of field names. Fields not on the list are stripped from every response, including responses to explicit requests. Leave the list empty to permit all fields the associated Odoo user can read.
7.4 Example Permission Scenarios
| Model | Read | Create | Write | Delete | Domain |
|---|---|---|---|---|---|
crm.lead | ✓ | [["team_id", "=", 5]] | |||
res.partner | ✓ | ||||
sale.order | ✓ |
8. Connecting AI Tools
8.1 Claude Desktop
- Install Claude Desktop from anthropic.com
- Open the configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
- Add your MCP server:
{ "mcpServers": { "odoo": { "url": "https://your-odoo.com/mcp", "headers": { "Authorization": "Bearer YOUR_API_KEY_TOKEN" } } } } - Save the file and restart Claude Desktop
- You should see "odoo" appear in the tools panel
8.2 Claude.ai (Browser — OAuth)
Claude.ai supports connecting to MCP servers through the browser interface using OAuth. This requires the OAuth module to be installed. See Section 9 — OAuth Setup.
8.3 ChatGPT (Custom Connector)
- Go to ChatGPT → Settings → Connectors → Add custom connector
- Enter your MCP endpoint URL:
https://your-odoo.com/mcp - In Advanced Settings, enter your Client ID and Client Secret from a Shared OAuth Client (see Section 9.3)
- Authorise the connection — you will be redirected to your Odoo login page
8.4 Custom Agents and Automation Tools
Any tool that supports the MCP 1.0 protocol can connect. Provide:
Endpoint URL: https://your-odoo.com/mcp
Authentication: Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
Method: POST
# Initialise with:
{"jsonrpc":"2.0","method":"initialize","params":{},"id":1}9. OAuth 2.1 Setup (Claude.ai & ChatGPT)
OAuth allows users to log in with their own Odoo credentials rather than sharing API keys. It is the recommended approach for Claude.ai and ChatGPT connectors.
9.1 How OAuth Works
- You (or the AI client) register an OAuth application with your Odoo instance
- When a user connects, they are redirected to your Odoo login page
- They log in with their Odoo credentials and approve access
- The AI client receives a Bearer token valid for 1 hour
- After 1 hour, the client automatically refreshes using a refresh token (valid 30 days)
- After 30 days, the user logs in again
Each user who connects gets their own token with their own Odoo permissions — no shared credentials.
9.2 Auto-Discovery
Clients that support OAuth 2.1 auto-discovery (including Claude.ai and ChatGPT) do not need manual configuration. They discover everything from your endpoint:
- Your endpoint returns a
WWW-Authenticateheader pointing to the discovery URL - The client fetches
https://your-odoo.com/.well-known/oauth-protected-resource - From there it discovers the authorization and token endpoints automatically
- The user is prompted to log in — no further admin configuration needed
9.3 Creating a Shared Client (For Teams)
- Go to MCP → OAuth Clients
- Click the gear icon (⚙️) → Create Shared Client
- Enter a name (e.g., "Team ChatGPT Connector")
- Review the pre-filled redirect URIs (covers Claude.ai, ChatGPT, and localhost)
- Click Generate Credentials
- Copy the Client ID and Client Secret immediately — the secret is shown only once
- Share these two values with team members to paste into their AI client Advanced Settings
9.4 Approving OAuth Clients
When a new OAuth client registers automatically (Dynamic Client Registration):
- Go to MCP → OAuth Clients
- Find the new client and toggle Approved
- Optionally toggle Whitelisted for trusted clients to skip manual approval on future registrations
Common redirect URIs to include for known AI clients:
https://claude.ai/api/mcp/auth_callback https://chatgpt.com/connector_platform_oauth_redirect
10. Portal Pages
Portal pages let you create public-facing web pages that display live Odoo data — without writing any HTML or code. AI assistants can create and update these pages through conversation.
10.1 Section Types
| Section Type | What It Shows |
|---|---|
| KPI Row | Big bold numbers — revenue, ticket count, active customers |
| Chart | Bar, line, and grouped charts with live Odoo read_group data |
| Table | Live record lists with configurable fields and filters |
| Progress Bar | A metric against a target — pipeline coverage, budget utilisation |
| Comparison | Current vs. previous period with delta and percentage change |
| Timeline | A live feed of the most recent records |
| Metric Grid | Multiple KPIs in a grid, optionally with trend indicators |
| Heatmap | 7-day × 24-hour activity heatmap |
| Text / HTML | Rich content, callouts, headings, branded sections |
10.2 Creating a Page via Conversation
Tell your AI assistant:
The page is immediately live at:
https://your-odoo.com/mcp-page/sales-dashboard
10.3 URL Filters
# Filter by date range https://your-odoo.com/mcp-page/sales-dashboard?date_from=2026-01-01&date_to=2026-03-31 # Filter by field value https://your-odoo.com/mcp-page/sales-dashboard?team_id=5
10.4 Custom Theming
{
"primary": "#1a1a2e",
"logo_url": "https://your-company.com/logo.png",
"font": "Inter"
}11. Module Builder
The Module Builder lets you describe an Odoo module in plain language and have the AI generate a fully installable, ready-to-use Odoo module.
11.1 The Workflow
Step 1 — Generate the specification
The AI calls generate_module_spec and creates a structured specification.
Step 2 — Build the module
The AI calls build_module_zip. The system validates the specification and generates Python model files, list/form/search view XML, security groups,ir.model.access.csv, app menu and window actions, and a README — packaged into a ZIP file.
Step 3 — Install
The AI calls install_module_zip to upload and activate the module directly in your Odoo instance. The new app is live in the same session.
11.2 Supported Field Types
Char, Integer, Float, Boolean, Date, Datetime, Text, Html, Binary, Selection, Many2one, One2many, Many2many
11.3 What Every Generated Module Includes
activefield (Boolean) — enables archiving recordscompany_idfield (Many2one → res.company) — multi-company support- Standard Odoo module structure compatible with Odoo 18
- All views, security, menus, and actions — ready to use with zero extra configuration
12. KSRO AI Engine — Triggering AI From Odoo Records
ksro_ai_engine and ksro_web_notify.12.1 Setting Up an AI Provider
- Go to KSRO AI → Providers
- Click the provider you want (OpenAI, Anthropic, Google, or Mistral)
- Paste your API key and click Save
- Click Test Connection
| Provider | Pre-configured Models |
|---|---|
| OpenAI | GPT-4o, GPT-4o mini |
| Anthropic | Claude Opus 4, Claude Sonnet 4.5, Claude Haiku 4.5 |
| Gemini 2.0 Flash, Gemini 2.5 Pro | |
| Mistral | Mistral Large |
12.2 Creating an AI Server Action
- Go to Settings → Technical → Actions → Server Actions → New
- Set the Model (e.g.,
crm.lead) and Action Type to Generative AI (KSRO) - Choose your AI Model
- Write a System Prompt (permanent AI persona)
- Write a Prompt Template using Jinja2 variables:
Opportunity: {{ record.name }} Customer: {{ record.partner_id.name }} Expected revenue: {{ record.expected_revenue }} Stage: {{ record.stage_id.name }} - Set Output Destination: Post to Chatter, Write to Field, or Create Activity
12.3 What the User Experiences
- User opens a record and clicks the button
- Browser notification fires: "Agent is working on it…"
- AI runs in a background thread (20–40 seconds)
- Another notification: "Agent finished."
- User opens the chatter — the AI analysis is posted as a permanent private note
No page reload. No waiting with a spinner.
13. Audit Logs & Monitoring
13.1 What Is Logged
Every request to the /mcp endpoint is recorded in mcp.audit.log. Each entry contains:
| Field | Description |
|---|---|
| API Key | Which key was used |
| User | The Odoo user associated with that key |
| IP Address | Source IP of the request |
| Method | JSON-RPC method (initialize, tools/call, etc.) |
| Tool Name | Which MCP tool was called |
| Model | Target Odoo model |
| Record ID | Specific record accessed or modified |
| Status | success or error |
| Duration (ms) | Response time |
| Error Message | Full error text on failure |
| Request Payload | Full JSON request (optional — enable in Settings) |
| Response Payload | Full JSON response (optional — enable in Settings) |
13.2 Accessing Audit Logs
Go to MCP → Audit Logs. Use the search bar and filters to find requests by key, failed status, write operations, model, or IP address.
13.3 Log Retention
Default retention: 90 days. To keep logs indefinitely, set Settings → MCP Server → Audit Retention → 0. To export logs, use Odoo's standard export functionality from the Audit Logs list view.
14. Security Best Practices
14.1 Principle of Least Privilege
Never give a key more access than it absolutely needs.
- A key used only for reading sales reports should have Read-only access to CRM and Sales models only
- A key used for a specific automation should have Write access only to the specific model it writes to
- No key should have Delete access unless deletion is an explicit, tested, required operation
14.2 One Key Per AI Client / Use Case
Create a separate key for each AI tool and each distinct use case. This gives you a clean audit trail per client and the ability to revoke one key without affecting others.
14.3 Models to Never Grant Write Access To
res.users— user managementir.config_parameter— system parametersaccount.move(posted invoices) — accounting integrityir.module.module— module installation- Any model containing salary, payroll, or medical data
14.4 Use OAuth for User-Facing Connections
For connections where a specific Odoo user is sitting at a keyboard (Claude.ai browser, ChatGPT), use OAuth rather than a shared API key. Use API keys for automated agents and programmatic access where a human user is not involved.
14.5 Enable Rate Limiting
Set a global rate limit in Settings to prevent runaway agents from hammering your Odoo instance. 60 requests per minute is a reasonable starting point for most deployments.
14.6 Rotate Tokens Regularly
Set a token rotation schedule appropriate for your security policy. Monthly rotation is a reasonable default. For high-security environments, weekly or shorter.
15. Multi-User & Team Setup
15.1 Recommended Structure for Teams
Step 1 — Create a dedicated Odoo user per department (optional but recommended):
[email protected]— Odoo user in the Sales group[email protected]— Odoo user in the Finance group[email protected]— Odoo user in the HR group
Step 2 — Create one API key per department, assigned to its corresponding departmental user and scoped to only the models that department needs.
Step 3 — Distribute the tokens. Do not share the same token across departments.
Step 4 — Use OAuth for individual user connections (Claude.ai, ChatGPT) so each person authenticates individually.
15.2 Shared OAuth Client for Teams
- Go to MCP → OAuth Clients → gear icon → Create Shared Client
- Name it (e.g., "Company ChatGPT Connector")
- Click Generate Credentials
- Copy the Client ID and Client Secret
- Distribute to team members via a secure channel (password manager, IT department, etc.)
16. Performance & Rate Limiting
16.1 Single-Worker Deployments
For most Odoo instances running one worker process, the default in-memory rate limiting is sufficient. Set your global rate limit in Settings and it will be enforced correctly.
16.2 Multi-Worker Deployments (Redis)
If your Odoo instance runs multiple worker processes, in-memory rate limiting applies per-worker rather than globally. To enforce rate limits correctly across all workers:
- Install and start Redis on your server
- Go to Settings → MCP Server → Enable Redis for Rate Limiting & Caching
- Set the Redis URL (default:
redis://localhost:6379/0)
16.3 Expected Performance
| Configuration | Throughput |
|---|---|
| No Redis, 1 worker | ~50 requests/second |
| With Redis, multi-worker | 200+ requests/second |
| Schema cache (Redis) | 25x faster model description (3ms vs 80ms) |
17. Troubleshooting
17.1 "Authorization failed" / Connection Refused
Cause: Bearer token is missing, incorrect, or has been revoked.
Fix:
- Go to MCP → API Keys and verify the key is Active
- Check that the token has not been rotated — if it has, generate a new token version
- Verify the full token was copied correctly
- Check the Audit Log for failed requests — the entry will show the exact rejection reason
17.2 "Model not found" or "Access denied"
Cause: The API key does not have access to that model in Key Model Access.
Fix: Go to MCP → Key Model Access and add an entry for the missing model with the appropriate permissions.
17.3 AI Can See Fewer Records Than Expected
Cause: A domain filter is restricting visible records, or the associated Odoo user does not have access via standard Odoo ACLs.
Fix: Check the domain filter on the key's model access entry, and check the Odoo user's group memberships and record rules.
17.4 "Create Shared Client" Not Appearing
Cause: An older version of the OAuth module is installed.
Fix: Go to Apps → MCP Server OAuth 2.1 → Upgrade.
17.5 Module Not Appearing in Apps After Adding to GitHub
Cause: Odoo has not refreshed its module list.
Fix: Enable Developer Mode, go to Apps → Update Apps List, then search for the module again.
17.6 OAuth Login Redirects to Error
Cause: The redirect URI in the OAuth client registration does not match the URI the AI client is using.
Fix: Go to MCP → OAuth Clients, open the client, and add the URI the AI client is using. Common URIs:
https://claude.ai/api/mcp/auth_callback https://chatgpt.com/connector_platform_oauth_redirect
17.7 AI Tool Connects But Returns No Tools
Cause: The API key has no model access configured.
Fix: Add at least one model entry under MCP → Key Model Access for this key.
17.8 KSRO AI Engine — Notification Does Not Appear
Cause: ksro_web_notify may not be installed, or the Odoo Bus is not running.
Fix: Confirm ksro_web_notify is installed and active. On Odoo.sh this is handled automatically. For self-hosted, confirm your deployment configuration starts the longpolling process.
18. Frequently Asked Questions
Does the module work with Odoo Community edition?
Yes. The MCP Server module works with both Odoo Community and Enterprise. Some analytics functions may depend on Enterprise-only models, but the core MCP infrastructure works on Community.
Can I connect multiple AI tools at the same time?
Yes. There is no connection limit. Create a separate API key for each tool and each will have its own permissions and audit trail.
Does my Odoo data get sent to OpenAI or Anthropic?
The MCP Server module itself does not send any data anywhere. However, when an AI client fetches data from your Odoo instance and uses it in a conversation, that data is sent to the AI provider's servers as part of the conversation. You control which data each key can access.
Is data stored outside my Odoo instance?
No. Nothing is stored outside Odoo. No telemetry, no analytics pipeline, no external database. Audit logs are stored in your own Odoo database.
Can I restrict one user from seeing another department's data?
Yes. Use a combination of API key scoping and domain filters. A Sales key with no HR models in its scope cannot access HR data regardless of what the AI asks for.
Can I give the AI read-only access?
Yes. When configuring Key Model Access, enable only the Read permission. A read-only key can search and retrieve records but all write attempts are rejected at the server before reaching the database.
Are records created by the AI permanent?
Yes. Records created through the MCP module use Odoo's standard ORM and are stored identically to records created manually. They persist through module upgrades and server restarts.
Can I use the module with a self-hosted language model?
Yes. The MCP protocol is model-agnostic. Any MCP-compatible client — including self-hosted LLM clients — can connect to your Odoo MCP endpoint.
Does the module support multi-company Odoo instances?
Yes. API key permissions and domain filters apply per-key. You can configure separate keys for each company with domains restricting access to the appropriate company's records.
The module builder generated a module — can I customise it afterwards?
Yes. The generated module is a standard Odoo module. Once installed, a developer can modify the Python files and XML views directly. The generated code follows all standard Odoo 18 conventions.
Need help with your setup?
We offer free setup support for all MCP Server customers. Contact us and we'll have you running in hours.