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
    • Approvals
    • 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
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Productivity
  3. MCP Server Odoo v 16.0
  4. Sales Conditions FAQ

MCP Server Odoo

by Lema Core Technologies https://lemacore.com
Odoo

$ 169.89

v 16.0 Third Party
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies Discuss (mail)
Lines of code 7980
Technical Name lm_mcp_server
LicenseOPL-1
Websitehttps://lemacore.com
Versions 16.0 17.0 18.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies Discuss (mail)
Lines of code 7980
Technical Name lm_mcp_server
LicenseOPL-1
Websitehttps://lemacore.com
Versions 16.0 17.0 18.0
  • Description
  • Documentation
  • License
MCP Server for Odoo

Lema Core Technologies

MCP Server — Connect AI Agents to Live Odoo Data

Turn Odoo into an AI-ready tool server. Securely expose your ERP to Claude, ChatGPT, Gemini, Cursor, n8n, LangChain, and any MCP-capable client through a single endpoint — with OAuth 2.0, scoped tokens, audit logs, BI tools, portal pages, async jobs, and AI-driven module generation.

Odoo 18 OPL-1 34+ MCP Tools
Email Us
Community
Enterprise
Odoo.sh
On-Premise
Lema Core Technologies

Lema Core Technologies is a provider of business software solutions specializing in custom Odoo development. We help businesses unlock the full potential of their Odoo instances through reliable, well-tested modules.

Demo Preview

See MCP Server in Action

Demo preview

Admin Guide

How Do You Perform Maintenance in Odoo?

MCP Server ships with built-in admin controls — manage tokens, audit sessions, clear cache, set retention policies, and test Redis connectivity — all from within Odoo Settings.

MCP Server settings and configuration screen

Use Cases

What You Can Build with MCP + Odoo

Turn Odoo into an AI-ready tool server. Connect Claude, ChatGPT, Gemini, Cursor/Claude Code, n8n, LangChain, crewAI (and more) to live Odoo data — with governance and audit logs.

Prompt-to-Dashboard

Dashboards inside Odoo

Generate KPI tiles, tables, and interactive ECharts visuals — with filters and drill-down to Odoo records.

Example: "Create a sales executive dashboard for YTD revenue by month and top customers."

Prompt-to-Portal

Public pages from live Odoo data

Create shareable portal pages that render server-side and stay always up-to-date (KPIs, charts, tables).

Example: "Create a shipping schedule page at /mcp-page/shipping with today's outgoing pickings."

Reporting / BI-Ready

Pivot, time-series, funnel, cohort

Opinionated helpers for analytics queries: pivot, timeseries, top-N, cohort, funnel, and export in one call.

Example: "Top 10 customers by revenue this quarter, grouped by salesperson."

Prompt-to-Workflow

Automations that respect ACLs

Create/update records via scoped keys, run batch operations, and offload heavy work to async background jobs.

Example: "Create leads from this CSV and assign by territory (batch + background job)."

Prompt-to-Module

Generate installable Odoo modules

Build a validated module spec, generate a ZIP, and install (or download) — including models, security, menus, and views.

Example: "Create a theme park management module with a kanban view and access groups."

External Apps

Standalone dashboards & portals

Build shipping schedules, executive dashboards, or customer portals outside Odoo — backed by live ERP data through one MCP endpoint.

Example: "Build a sales portal that shows real-time order status by customer."

Screenshots

Visual Walkthrough

OAuth 2.0 Authorize Access

Standards-compliant OAuth 2.0 Authorization Code flow with PKCE S256. Users authorize MCP clients through a branded login screen — credentials never leave Odoo.

OAuth Authorize Access

Personal Access Tokens

Each user can mint their own scoped Personal Access Tokens for command-line tools, CI pipelines, and headless integrations. SHA-256 hashed at rest, shown only once.

Personal Access Tokens

Token Governance

Configure per-token scope (read-only, read-write, admin), model allowlist, field allowlist, IP allowlist/denylist, and audit payload capture — least-privilege access by default.

Token Governance

Session Audit Trail

Every MCP session is recorded with transport type, IP address, tool call count, duration, and (optionally) full request/response payloads with PII redaction.

Session Overview

Async Job Queue

Offload heavy work — bulk updates, mass exports, multi-step automations — to a background queue. Poll progress, inspect payloads, retry failures, and surface results back to the AI client without hitting HTTP timeout limits.

Async Job Queue

AI-Generated Portal Pages

Ask Claude to "create a shipping dashboard at /mcp-page/shipping" and get a public, mobile-responsive page rendered server-side from live Odoo data — KPI tiles, ECharts visuals, and interactive tables, no front-end work required.

Portal Pages Admin List
Portal Pages Live Example

Prompt-to-Module Generator

Describe the module you need in plain English. Claude produces a validated spec, the generator builds a fully-formed Odoo module (models, security, views, menus), and you can install it directly or download the ZIP for review.

Generated Modules

One Settings Panel for Everything MCP

Manage retention policies, rate limits, Redis caching, schema cache TTL, and the module-generator feature flag — all from a single screen inside Odoo Settings. No external admin UI required.

Generated Modules

AI Agent Conversations

Real conversations with Claude querying live Odoo data — search records, create sale orders, post chatter messages, generate reports, all through natural language.

AI Chat Sample 1
AI Chat Sample 2
AI Chat Sample 3
AI Chat Sample 4

Mobile Access

Ask Claude on Your Phone.
Get Live Odoo Data in Seconds.

No VPN. No Odoo login screen. No reports to run. Just open Claude on your phone, ask a question in plain English,
and get live ERP data back instantly — from anywhere, on any device.

Ask Claude on your phone

Click to open full size

📱

Any Device, Anywhere

Phone, tablet, or desktop. The Claude connection follows the user — not the device or the office network.

💬

Plain English Queries

"What are my open invoices?" — Claude queries Odoo and returns a clear, structured answer in seconds.

🔒

Fully Governed

Per-key scopes, Odoo ACLs, and audit logs — every mobile query is controlled, traceable, and least-privilege.

Features

What You Get

Connectivity & Authentication

🔐 OAuth 2.0 + PKCE

Standards-compliant Authorization Code flow with PKCE S256, dynamic client registration (RFC 7591), refresh token rotation, and auto-discovery via /.well-known endpoints.

🔑 Personal Access Tokens

Self-service token management. Each user mints PATs for headless integrations. SHA-256 hashed at rest, displayed only once at creation.

⚡ Dual Transport

Streamable HTTP transport (MCP spec 2025-03-26) plus legacy SSE — works with Claude Desktop, ChatGPT, Cursor, Gemini, n8n, LangChain, and any MCP-capable client.

Governance & Audit

🛡️ Per-Token Scope

Read-only, read+write, or admin. Restrict the blast radius of each token. Combine with model allowlist and field allowlist for precise least-privilege access.

🌐 IP Allow/Deny Lists

CIDR-based IP restrictions per token. Lock tokens to your office network, your VPN range, or a specific automation server.

🔎 Audit Trail + Redaction

Every tool call logged with duration, record count, and result. Optional payload capture with automatic PII redaction (passwords, tokens, SSN, credit cards).

Advanced Capabilities

📊 BI Reporting Tools

Seven analytics tools in one call: pivot tables, time-series with gap-filling, top-N ranking, cohort retention, funnel conversion, CSV and XLSX exports.

🌍 Portal Pages

Public shareable dashboards with KPI tiles, ECharts visualizations, and tables. Server-side rendered, always live, mobile-responsive, embeddable via signed URL.

⚙️ Async Job Queue

Submit bulk updates, exports of 100k+ records, or heavy method calls and poll for status. Background cron processes jobs respecting token scope and restrictions.

Infrastructure

Deployment & Performance

Designed from the ground up for production use with horizontal scalability and observability.

🚀 Horizontal scalability
  • Works with 1 worker, 10 workers, or 100+ workers
  • Redis-backed distributed rate limiting (no coordination needed)
  • Shared cache for model schemas across all workers
  • No session affinity or sticky sessions required
  • Automatic fallback if Redis unavailable
⚡ Performance benchmarks
  • Cached requests: ~2ms (96% faster)
  • Uncached requests: ~50-100ms (standard)
  • Throughput: 4x improvement with caching
  • Cache hit ratio: 80-90% typical
  • Latency percentiles: p50: 3ms, p95: 25ms, p99: 80ms

What You Get

Capabilities

Built for secure AI connectivity with governance, least privilege, and predictable tooling.

🔧 Core capabilities
  • MCP-style JSON-RPC endpoint for tool discovery and execution
  • CRUD tools for controlled read/write operations
  • Model discovery & description for agent planning
  • Reporting/BI helpers (pivot, timeseries, top-N, cohort, funnel, export)
  • Portal pages at /mcp-page/<slug> (KPIs, charts, tables)
  • Module Builder for validated specs + installable ZIP modules
  • Batch & async tools for efficient multi-call flows and long-running jobs
🛡️ Valuable safeguards
  • Per-key scopes and standard Odoo ACLs/record rules
  • Field allowlists and domain filters for least privilege
  • Distributed rate limits with Redis backing (or in-memory fallback)
  • Token rotation with zero-downtime grace periods
  • Schema caching with automatic invalidation
  • Audit logs with optional payload capture and retention policy

Connect multiple LLMs and agent frameworks: Claude, ChatGPT, Gemini, custom LLMs, LangChain, and crewAI.

System Architecture

End-to-End Integration

AI client → OAuth or Bearer token → /mcp endpoint → governance gate → tool dispatcher → live Odoo data

AI Client
Claude, ChatGPT, Cursor, Gemini, n8n, LangChain
Auth Layer
OAuth 2.0 PKCE / Bearer Token / PAT — SHA-256 hashed
MCP Server
Scope check, rate limit, schema cache, tool dispatch
Odoo ORM
Operations execute as authenticated user, respecting ACL and record rules

Transport Modes

Streamable HTTP
POST /mcp — MCP spec 2025-03-26. Stateless, sticky-session-free, scales horizontally.
Server-Sent Events
GET /mcp/sse + POST /mcp/messages — legacy MCP transport for older clients.
Portal HTTP
GET /mcp-page/<slug> — public dashboards backed by live Odoo data.

Technical Specifications

Built on Odoo 18 Standards

📦 Dependencies
  • base, web, mail
  • Optional: redis-py (for distributed rate limit)
  • Optional: xlsxwriter (for XLSX export)
🖥️ Deployment
  • Odoo Community & Enterprise
  • Odoo.sh (PaaS)
  • On-Premise multi-worker
⚡ Performance
  • Schema cache for fields_get / get_models / get_views (configurable TTL)
  • Redis-backed distributed rate limit with in-memory fallback
  • Auto-invalidation on schema change, LRU eviction at 1000 entries
🔒 Security
  • Bearer tokens SHA-256 hashed, 30-day access / 90-day refresh expiry
  • Per-token scope, model allowlist, field allowlist, IP allow/deny lists
  • HTTPS enforcement option, CORS preflight, RFC 7009 token revocation

Integration Guides

How to Connect

Connect your favorite AI client to live Odoo data in minutes. No code required.

Step-by-step

Connect with Claude Web

Use Claude.ai with MCP to query Odoo data, create records, run reports, and build dashboards — directly from your browser.

  1. Install MCP Server for Odoo from the Apps menu.
  2. Go to MCP Server → Settings and copy your MCP endpoint URL.
  3. In Claude.ai, open your Project settings and add a new MCP integration.
  4. Paste your Odoo MCP endpoint and authorize via OAuth 2.0.
  5. Start chatting — ask Claude to search records, create invoices, or build a dashboard.
Connect with Claude Web

Step-by-step

Connect with Grok

Grok supports MCP connections for tool use. Link it to your Odoo instance and query your business data with natural language from the Grok interface.

  1. Generate a Personal Access Token from your Odoo user profile.
  2. In Grok's tool settings, add a new MCP server with your Odoo endpoint URL.
  3. Enter your Bearer token for authentication.
  4. Grok will auto-discover all available Odoo tools via tools/list.
  5. Ask Grok to pull CRM data, run analytics, or generate a report.
Connect with Grok

Step-by-step

Connect with ChatGPT

ChatGPT supports MCP servers through its connector framework. Point it at your Odoo MCP endpoint and give ChatGPT full access to your live ERP data.

  1. Go to MCP Server → Tokens and create a token with the required scope.
  2. In ChatGPT settings, navigate to Connectors and add a new MCP connection.
  3. Enter your Odoo MCP URL and paste your Bearer token.
  4. ChatGPT will auto-discover all tools from the tools/list endpoint.
  5. Start a chat: "What are my top 5 customers by revenue this month?"
Connect with ChatGPT

Version History

What's New

LATEST v18.0.2.0.0 May 2026
Per-token scope (read/write/admin) IP allow/deny lists Field allowlist Audit payload capture Schema cache Redis rate limit Async job queue Portal pages BI reporting (7 tools) Module generator
v18.0.1.0.0 April 2026 Initial Release
OAuth 2.0 PKCE + PAT Streamable HTTP + SSE transport 15 core MCP tools MCP Resources (5 URIs)

Frequently Asked Questions

Got Questions?

Which AI clients can connect to this MCP Server?
Any client implementing the Model Context Protocol — including Claude Desktop, Claude Code, Cursor, ChatGPT, Gemini, n8n, LangChain, crewAI, and custom MCP-aware applications. Both Streamable HTTP (MCP 2025-03-26 spec) and legacy SSE transports are supported.
How is authentication handled? Are credentials stored?
Authentication is delegated entirely to Odoo's res.users — no separate user database. OAuth 2.0 Authorization Code flow with PKCE S256 issues 30-day Bearer tokens with 90-day refresh tokens. Tokens are SHA-256 hashed at rest; only the hash is stored. Passwords are never persisted by this module.
Can I limit what a token can read or write?
Yes. Every token has a configurable scope (read-only, read+write, admin), an optional model allowlist and denylist, a field allowlist (JSON per model), and IP allow/deny lists with CIDR support. All checks are enforced server-side before any ORM operation. Beyond these, Odoo's own ACL and record rules still apply — the token cannot bypass them.
What tools does the AI client get out of the box?
Over 30 MCP tools across five categories: CRUD (search, read, create, update, delete, call_method); workflow (message_post, default_get, onchange, get_views, print_report, create_attachment); analytics (count, name_search, read_group); BI reporting (pivot, time_series, top_n, cohort, funnel, export_csv, export_xlsx); operations (submit_job, job_status, job_list, job_cancel, create_portal_page, list_portal_pages, update_portal_page); module generation (validate_module_spec, generate_module, list_generated_modules, install_generated_module).
What are Portal Pages and how do they work?
Portal Pages are public shareable dashboards backed by live Odoo data. An AI agent can create a dashboard via odoo_create_portal_page with a JSON spec describing KPI tiles, ECharts visualizations, and tables. The result is a clean URL like /mcp-page/sales-dashboard with optional signed embed tokens for iframe embedding. Pages render server-side, are mobile-responsive, and run as the page creator with that user's permissions enforced.
What is the Async Job Queue for?
Heavy operations — bulk updates across thousands of records, CSV/XLSX exports of large datasets, batch method calls — exceed normal HTTP timeouts. The async queue lets the AI submit a job, receive a job_id immediately, and poll status until completion. A background cron processes jobs respecting the token's original scope and restrictions. Exports yield downloadable attachments.
How does the Module Generator work? Is it safe?
The AI submits a JSON spec describing a module — models, fields, views, security. The generator validates the spec (snake_case names, reserved-keyword checks, field-type allowlist, AST parse of every generated .py file) and produces an installable ZIP archive. Installation is feature-flagged off by default and requires admin scope plus a configured extraction path (refuses to write into community/ or enterprise/ folders). Atomic rollback removes extracted files if installation fails.
What about rate limiting and performance at scale?
A sliding-window rate limiter caps per-token requests by default. For multi-worker or multi-instance Odoo deployments, configure a Redis URL in MCP Server settings and the limiter switches to Redis sorted-set sliding window with sub-millisecond latency. A schema cache (LRU, configurable TTL) reduces fields_get, get_models, and get_views latency dramatically with automatic invalidation when ir.model or ir.model.fields change.
Is this available for Odoo Community and Enterprise?
Yes. The module is available for both Community and Enterprise editions, as well as Odoo.sh and on-premise deployments. No additional Enterprise-only modules are required as dependencies.
Do purchases include future version upgrades?
Each purchase covers the specific Odoo version purchased. Upgrades to newer major versions are available at a reduced upgrade price. Bug fixes and minor updates within the same version are provided free of charge.

Related Products

AI Summary

Indonesia Bank Statement Import

Indonesia Withholding Tax

Lema Core Technologies MCP Server for Odoo v18.0  ·  OPL-1 License  ·  © 2026 Lema Core Technologies
info@lemacore.com

MCP Server for Odoo — Technical Guide

Table of Contents

  • Overview
  • Requirements
    • System Requirements
    • Optional Python Packages
    • Odoo Module Dependencies
  • Installation
    • Install via Odoo Apps Store
    • Install from Source
    • Upgrade
  • Configuration
    • General Settings
    • Redis Rate Limiting (Optional)
    • Schema Cache
    • Module Generator (Feature Flag)
  • Endpoints
    • MCP Endpoints
    • OAuth 2.0 Endpoints
    • Portal Endpoints
  • Authentication
    • Personal Access Token (PAT)
    • OAuth 2.0 Authorization Code + PKCE
    • Token Governance
  • Connecting AI Clients
    • Claude CLI / Claude Code
    • Claude Desktop
    • Claude Web (OAuth 2.0)
    • VSCode Extension
    • Cursor
    • ChatGPT (Connector)
    • Grok
    • Continue.dev
    • Windsurf / Void
    • n8n
    • LangChain (Python)
    • Vercel AI SDK (TypeScript)
    • Stdio-Only Clients (Jan, Msty) via mcp-remote
  • Production Deployment
    • Nginx Reverse Proxy
    • Multi-Worker Configuration
    • Cloudflare / CDN Considerations
  • Scheduled Jobs
  • Maintenance
    • Revoking tokens
    • Clearing audit logs
    • Clearing the schema cache
  • Troubleshooting
    • Import error on install: models.Constraint
    • OAuth redirect fails (localhost or HTTP URL)
    • Rate limit exceeded (HTTP 429)
    • SSE connection drops after 60 seconds
    • MCP client reports "transport error"
  • Extension & Development
    • Adding Custom Tools
    • Module Structure

Overview

MCP Server for Odoo exposes your Odoo 18 instance as a Model Context Protocol (MCP) server. AI clients — Claude, ChatGPT, Gemini, Cursor, n8n, LangChain, crewAI — connect to live Odoo data through a single HTTP endpoint with OAuth 2.0 or Bearer token authentication.

  • Protocol: MCP 2025-03-26 (Streamable HTTP) + legacy SSE
  • Auth: OAuth 2.0 Authorization Code + PKCE S256, PAT Bearer tokens
  • Tools: 34+ MCP tools (CRUD, analytics, BI, portal pages, async jobs, module generator)
  • Odoo version: 18.0 (Community and Enterprise)
  • License: OPL-1

Requirements

System Requirements

  • Odoo 18.0 (Community or Enterprise)
  • Python 3.11+
  • PostgreSQL 15+
  • Odoo must be reachable over HTTPS in production (required for OAuth 2.0 redirects)

Optional Python Packages

These are installed separately if you want the optional features:

# For distributed Redis rate limiting
pip install redis

# For XLSX export (odoo_export_xlsx tool)
pip install xlsxwriter

Both packages fall back gracefully if not installed: redis → in-memory rate limiter, xlsxwriter → error response for XLSX only.

Odoo Module Dependencies

  • base
  • web
  • mail

No Enterprise-only modules required.

Installation

Install via Odoo Apps Store

  1. Log in to your Odoo instance as Administrator.
  2. Go to Apps → search for MCP Server.
  3. Click Install.
  4. The module installs with all dependencies automatically.

Install from Source

# Clone or copy the module into your addons path
cp -r lm_mcp_server /path/to/your/addons/

# Restart Odoo
./odoo-bin -c odoo.conf --stop-after-init

# Install the module
./odoo-bin -c odoo.conf -d your_db -i lm_mcp_server --stop-after-init

Upgrade

./odoo-bin -c odoo.conf -d your_db -u lm_mcp_server --stop-after-init

Configuration

Access the MCP Server settings at Settings → MCP Server (Technical section).

General Settings

Parameter Default Description
Session retention (days) 90 Auto-purge sessions older than N days
Log retention (days) 30 Auto-purge audit log entries older than N
Rate limit per minute 60 Max requests per token per sliding window
Rate limit window (seconds) 60 Sliding window duration

Redis Rate Limiting (Optional)

For multi-worker or multi-instance deployments, enable Redis so the rate limit is shared across all workers:

  1. Check Enable Redis rate limiting.
  2. Enter your Redis URL, e.g. redis://localhost:6379/0 or redis://:password@redis-host:6379/0.
  3. Click Test Redis Connection to verify.

If Redis is unreachable at runtime, the server falls back to in-memory rate limiting automatically — no downtime.

Schema Cache

The schema cache stores fields_get, get_models, and get_views results in memory (LRU, 1000 entries).

  1. Check Enable schema cache.
  2. Set Cache TTL (seconds) (default: 3600).
  3. Click Clear Schema Cache after installing new modules or changing field definitions.

The cache is automatically invalidated when ir.model or ir.model.fields records change.

Module Generator (Feature Flag)

The AI module generator is disabled by default. To enable:

  1. Check Enable module generator.
  2. Set Generated modules path — an absolute path to a writable addons folder (e.g. /opt/odoo/custom_addons). The generator refuses to write into community/ or enterprise/ directories.
  3. Restart Odoo after changing the addons path so the new folder is in scope.

Endpoints

MCP Endpoints

Endpoint Description
POST /mcp Streamable HTTP transport (MCP 2025-03-26)
POST /mcp/sse Streamable HTTP alias (backward compatible)
GET  /mcp/sse SSE transport — event stream
POST /mcp/messages SSE transport — message endpoint

OAuth 2.0 Endpoints

Portal Endpoints

Endpoint Description
GET /mcp-page/<slug> Public portal page (HTML)
GET /mcp-page/<slug>/data Portal page data (JSON)
GET /mcp-page/<slug>/embed Embeddable page (signed token required)

Authentication

Personal Access Token (PAT)

PATs are the simplest authentication method for CLI tools, scripts, and server-to-server integrations.

Generate a PAT:

  1. Go to MCP Server → Tokens.
  2. Click Generate PAT.
  3. Copy the token from the dialog — it is shown only once.
  4. Store it securely (password manager, CI/CD secrets).

Token properties:

  • SHA-256 hashed at rest; the plain token is never stored
  • Valid 30 days by default
  • No refresh token; generate a new one when it expires
  • Can be revoked at any time from the Tokens list

Using a PAT in requests:

POST /mcp HTTP/1.1
Host: your-odoo.com
Authorization: Bearer <your-PAT>
Content-Type: application/json

OAuth 2.0 Authorization Code + PKCE

OAuth 2.0 is used by GUI clients (Claude Web, Claude Desktop, Cursor) that display a browser login window. It does not require users to generate tokens manually.

Flow:

1. Client → GET /.well-known/oauth-authorization-server → discover endpoints
2. Client → POST /oauth/register → get client_id (dynamic registration)
3. User    → browser → GET /oauth/authorize?code_challenge=S256&...
4. Odoo    → user logs in → redirect with authorization_code
5. Client  → POST /oauth/token (code + PKCE verifier) → access_token + refresh_token
6. Client  → POST /mcp with Bearer access_token

Token lifetimes:

  • Access token: 30 days
  • Refresh token: 90 days (auto-renews the access token transparently)

Token Governance

Each token supports fine-grained restrictions, configurable in MCP Server → Tokens → [token]:

Connecting AI Clients

Claude CLI / Claude Code

claude mcp add odoo --transport http https://your-odoo.com/mcp \
  --header "Authorization: Bearer <your-PAT>"

Or via ~/.claude.json:

{
  "mcpServers": {
    "odoo": {
      "type": "http",
      "url": "https://your-odoo.com/mcp",
      "headers": { "Authorization": "Bearer <your-PAT>" }
    }
  }
}

Claude Desktop

Edit claude_desktop_config.json (~/Library/Application Support/Claude/ on macOS, %APPDATA%\Claude\ on Windows):

{
  "mcpServers": {
    "odoo": {
      "type": "http",
      "url": "https://your-odoo.com/mcp",
      "headers": { "Authorization": "Bearer <your-PAT>" }
    }
  }
}

Claude Web (OAuth 2.0)

  1. Open claude.ai → Settings → Integrations → Add MCP Server.
  2. Enter: https://your-odoo.com/mcp
  3. Click Connect — Claude Web opens a browser window for Odoo login.
  4. Authorize the connection. Claude Web handles token storage and renewal.

VSCode Extension

Add to settings.json:

{
  "claude.mcpServers": {
    "odoo": {
      "type": "http",
      "url": "https://your-odoo.com/mcp",
      "headers": { "Authorization": "Bearer <your-PAT>" }
    }
  }
}

Cursor

Go to Cursor Settings → MCP → Add Server:

{
  "mcpServers": {
    "odoo": {
      "type": "http",
      "url": "https://your-odoo.com/mcp",
      "headers": { "Authorization": "Bearer <your-PAT>" }
    }
  }
}

ChatGPT (Connector)

  1. Go to ChatGPT Settings → Connectors → Add MCP Server.
  2. Enter your Odoo MCP URL: https://your-odoo.com/mcp.
  3. Enter your Bearer token (PAT or OAuth access token).
  4. ChatGPT auto-discovers all tools via tools/list.

Grok

  1. Go to Grok Settings → Tools → Add MCP Server.
  2. Enter URL: https://your-odoo.com/mcp.
  3. Enter your Bearer token.
  4. Confirm connection — Grok lists all available Odoo tools.

Continue.dev

Edit ~/.continue/config.json:

{
  "experimental": {
    "modelContextProtocolServers": [
      {
        "transport": {
          "type": "sse",
          "url": "https://your-odoo.com/mcp/sse",
          "requestOptions": {
            "headers": { "Authorization": "Bearer <your-PAT>" }
          }
        }
      }
    ]
  }
}

Windsurf / Void

{
  "mcpServers": {
    "odoo": {
      "serverUrl": "https://your-odoo.com/mcp/sse",
      "headers": { "Authorization": "Bearer <your-PAT>" }
    }
  }
}

n8n

In n8n, add an MCP Client Tool node:

  • Transport: Streamable HTTP
  • URL: https://your-odoo.com/mcp
  • Authentication → Header Auth: Authorization: Bearer <your-PAT>

LangChain (Python)

from langchain_mcp_adapters.client import MultiServerMCPClient

async with MultiServerMCPClient({
    "odoo": {
        "url": "https://your-odoo.com/mcp",
        "transport": "streamable_http",
        "headers": {"Authorization": "Bearer <your-PAT>"}
    }
}) as client:
    tools = client.get_tools()

Vercel AI SDK (TypeScript)

import { experimental_createMCPClient as createMCPClient } from 'ai';

const mcpClient = await createMCPClient({
  transport: {
    type: 'http',
    url: 'https://your-odoo.com/mcp',
    headers: { Authorization: 'Bearer <your-PAT>' },
  },
});
const tools = await mcpClient.tools();

Stdio-Only Clients (Jan, Msty) via mcp-remote

Clients that only support stdio need the mcp-remote bridge:

npm install -g mcp-remote

Then configure:

{
  "mcpServers": {
    "odoo": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://your-odoo.com/mcp/sse",
        "--header",
        "Authorization: Bearer <your-PAT>"
      ]
    }
  }
}

Production Deployment

Nginx Reverse Proxy

MCP Server uses HTTP streaming (SSE / chunked transfer) and requires CORS headers so browser-based AI clients (Claude Web, ChatGPT, etc.) can connect. The config below is the production-tested reference.

# Upstream — adjust host/port to match your Odoo instance
upstream odoo_mcp {
    server 127.0.0.1:8069;
    keepalive 32;
}

# Restrict CORS to known AI client origins.
# Add more origins with additional map entries as needed.
map $http_origin $cors_origin {
    default                      "";
    "https://claude.ai"          $http_origin;
    "https://chatgpt.com"        $http_origin;
    "https://app.grok.com"       $http_origin;
}

server {
    listen 443 ssl http2;
    server_name your-odoo.com;

    ssl_certificate     /etc/ssl/your-odoo.com/fullchain.pem;
    ssl_certificate_key /etc/ssl/your-odoo.com/privkey.pem;

    # ── MCP endpoints (SSE + Streamable HTTP) ────────────────────────────
    location ~ ^/mcp {
        # OPTIONS preflight — answer directly from nginx
        if ($request_method = OPTIONS) {
            add_header Access-Control-Allow-Origin  $cors_origin always;
            add_header Access-Control-Allow-Methods "GET, POST, OPTIONS" always;
            add_header Access-Control-Allow-Headers "Content-Type, Authorization, Mcp-Session-Id, Last-Event-ID" always;
            add_header Access-Control-Max-Age       86400 always;
            return 204;
        }

        proxy_pass http://odoo_mcp;
        proxy_http_version 1.1;
        proxy_set_header Connection        "";
        proxy_set_header Host              $host;
        proxy_set_header X-Real-IP         $remote_addr;
        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        # SSE — must disable buffering for streaming to work
        proxy_buffering    off;
        proxy_cache        off;
        proxy_read_timeout 3600s;
        proxy_send_timeout 3600s;
        add_header X-Accel-Buffering no always;

        # CORS response headers
        add_header Access-Control-Allow-Origin  $cors_origin always;
        add_header Access-Control-Allow-Methods "GET, POST, OPTIONS" always;
        add_header Access-Control-Allow-Headers "Content-Type, Authorization, Mcp-Session-Id, Last-Event-ID" always;
    }

    # ── OAuth 2.0 + Well-Known discovery endpoints ────────────────────────
    location ~ ^/(oauth|\.well-known)/ {
        # OPTIONS preflight — required for POST /oauth/register from browser clients
        if ($request_method = OPTIONS) {
            add_header Access-Control-Allow-Origin  $cors_origin always;
            add_header Access-Control-Allow-Methods "GET, POST, OPTIONS" always;
            add_header Access-Control-Allow-Headers "Content-Type, Authorization" always;
            add_header Access-Control-Max-Age       86400 always;
            return 204;
        }

        proxy_pass http://odoo_mcp;
        proxy_http_version 1.1;
        proxy_set_header Connection        "";
        proxy_set_header Host              $host;
        proxy_set_header X-Real-IP         $remote_addr;
        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        # CORS — required so browser-based AI clients can read the response
        add_header Access-Control-Allow-Origin  $cors_origin always;
        add_header Access-Control-Allow-Methods "GET, POST, OPTIONS" always;
        add_header Access-Control-Allow-Headers "Content-Type, Authorization" always;
    }

    # ── Main Odoo application ─────────────────────────────────────────────
    location / {
        proxy_pass http://odoo_mcp;
        proxy_http_version 1.1;
        proxy_set_header Connection        "";
        proxy_set_header Host              $host;
        proxy_set_header X-Real-IP         $remote_addr;
        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_redirect off;
    }

    gzip on;
    gzip_vary on;
    gzip_types text/css text/javascript application/json application/javascript text/plain text/xml;

    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
}

Note

Why ``proxy_read_timeout 3600s``? SSE connections are long-lived. Claude Desktop and other MCP clients keep a persistent event stream open for the duration of a session. A short timeout (e.g. 300s) causes the client to disconnect and reconnect repeatedly.

Note

Why separate ``/mcp`` and ``/(oauth|.well-known)/`` locations? The /mcp location needs Mcp-Session-Id and Last-Event-ID in Access-Control-Allow-Headers. Keeping OAuth/discovery in its own block keeps the CORS header set minimal and avoids leaking internal headers.

Multi-Worker Configuration

MCP Server is stateless by design — no sticky sessions required.

Odoo config (``odoo.conf``):

[options]
workers = 4
limit_time_real = 120
limit_time_cpu = 60

# For distributed rate limiting and schema cache
# (add redis-py to requirements first)

Redis for distributed rate limiting:

# No odoo.conf change needed — configure via Settings → MCP Server
# Redis URL example:
# redis://localhost:6379/0
# redis://:password@redis-cluster:6379/0

Cloudflare / CDN Considerations

If Cloudflare (or another CDN) sits in front of Odoo:

  1. Disable response buffering on the /mcp and /mcp/sse paths. In Cloudflare, set a Cache Rule with Bypass Cache for /mcp*.
  2. Increase the read timeout to at least 300s on the path (Cloudflare Pro+: add a Page Rule with SSL = Full (Strict) and Origin Response Timeout = 300).
  3. For SSE specifically, ensure Cloudflare does not strip Transfer-Encoding: chunked headers — use HTTP/2 between Cloudflare and your origin.

Scheduled Jobs

Two cron jobs are installed automatically:

Job Default interval Action
MCP Server: Purge expired sessions Daily Deletes sessions older than retention setting
MCP Server: Process async job queue Every 5 minutes Runs pending mcp.job records

Configure cron intervals at Settings → Technical → Scheduled Actions.

Maintenance

Revoking tokens

Go to MCP Server → Tokens, open the token, and click Revoke. The token is rejected on the next request. Active sessions using that token are not terminated immediately but all subsequent requests fail.

Clearing audit logs

Session and log retention is enforced nightly by the purge cron. For an immediate purge, run from an Odoo shell:

env['mcp.session'].sudo()._purge_expired()

Clearing the schema cache

After installing or upgrading modules:

  1. Go to Settings → MCP Server.
  2. Click Clear Schema Cache.

Or from an Odoo shell:

from odoo.addons.lm_mcp_server.services import schema_cache
schema_cache.invalidate("")

Troubleshooting

Import error on install: models.Constraint

Cause: models.Constraint was introduced in Odoo 17 but may not be available in all patch versions. The module uses _sql_constraints (the universal fallback) from version 18.0.2.0.0 onward.

Fix: upgrade to module version 18.0.2.0.0 or later.

OAuth redirect fails (localhost or HTTP URL)

Odoo's OAuth redirect validation requires HTTPS in production. For local development, add to odoo.conf:

[options]
proxy_mode = True

And access Odoo through a reverse proxy that sets X-Forwarded-Proto: https, or use ngrok / localtunnel for a temporary HTTPS tunnel.

Rate limit exceeded (HTTP 429)

The default limit is 60 requests per 60 seconds per token. Increase it at Settings → MCP Server → Rate limit per minute, or configure Redis for shared state across workers.

SSE connection drops after 60 seconds

Nginx proxy_read_timeout is too short. Set it to 300s on the /mcp/sse location (see Nginx config above).

MCP client reports "transport error"

  1. Verify the endpoint URL: https://your-odoo.com/mcp (no trailing slash).
  2. Check the Authorization header is present and the token is not expired.
  3. For SSE clients, use /mcp/sse (not /mcp).
  4. Check Nginx is not buffering the response (proxy_buffering off).

Extension & Development

Adding Custom Tools

Extend the tool registry by inheriting mcp.tool.registry:

from odoo import api, models

class MyCustomTools(models.AbstractModel):
    _inherit = "mcp.tool.registry"

    @api.model
    def get_tools(self) -> list:
        base_tools = super().get_tools()
        return base_tools + [
            {
                "name": "odoo_my_custom_tool",
                "description": "My custom tool description",
                "inputSchema": {
                    "type": "object",
                    "properties": {
                        "param": {"type": "string"}
                    },
                    "required": ["param"],
                },
            }
        ]

Then handle execution by overriding tool_executor.execute_tool or adding a handler in your own module.

Module Structure

lm_mcp_server/
├── __manifest__.py
├── controllers/
│   ├── mcp_controller.py       # POST /mcp, GET/POST /mcp/sse
│   ├── oauth_controller.py     # OAuth 2.0 endpoints
│   └── portal_controller.py    # /mcp-page/<slug>
├── models/
│   ├── mcp_session.py          # mcp.session — audit log
│   ├── mcp_token.py            # mcp.token — PAT + OAuth tokens
│   ├── mcp_job.py              # mcp.job — async job queue
│   ├── mcp_portal_page.py      # mcp.portal.page — shareable dashboards
│   ├── mcp_generated_module.py # mcp.generated.module — AI module builder
│   ├── mcp_tool_registry.py    # mcp.tool.registry — tool definitions
│   └── res_config_settings.py  # Settings extension
└── services/
    ├── mcp_protocol.py         # JSON-RPC envelope, tools/list, tools/call
    ├── tool_executor.py        # Tool dispatch + scope enforcement
    ├── schema_cache.py         # LRU schema cache
    ├── rate_limiter.py         # In-memory rate limiter
    ├── redis_rate_limiter.py   # Redis sliding-window rate limiter
    ├── redaction.py            # PII redaction for payload capture
    ├── bi_tools.py             # BI reporting tools (7 tools)
    ├── job_tools.py            # Async job tools (4 tools)
    ├── portal_tools.py         # Portal page tools (3 tools)
    ├── module_tools.py         # Module generator tools (4 tools)
    └── module_generator.py     # ZIP builder + spec validator
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

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author or have a question related to your purchase, please use the support page.
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

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