Odoo MCP Server
Connects to an Odoo v18 database via XML-RPC and provides tools to extract sales orders with custom domain filters, retrieve sales order details and lines, and generate sales statistics grouped by salesperson, team, state, or customer.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Odoo MCP Server Show me sales statistics for last quarter grouped by salesperson"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Odoo MCP Server
A Model Context Protocol (MCP) server that connects to Odoo v18 databases via XML-RPC to extract sales information for LLM interactions.
Features
:electric_plug: XML-RPC Connection: Direct connection to Odoo v18 via XML-RPC API
:bar_chart: Sales Data Extraction: Extract sales orders with flexible domain filtering
:mag: Advanced Filtering: Support for custom Odoo domain filters
:chart_with_upwards_trend: Sales Analytics: Get sales statistics and summaries
:white_check_mark: Data Validation: Comprehensive input validation using Zod
:mag: MCP Inspector: Built-in testing support
Related MCP server: MCP Odoo Server
Tools Available
1. get_sales_orders
Extract sales orders from Odoo with optional filtering.
Parameters:
domain(optional): Odoo domain filter as JSON stringlimit(optional): Maximum records to return (default: 100)offset(optional): Records to skip (default: 0)fields(optional): Comma-separated list of fields
Default behavior: Returns confirmed sales orders only (state = 'sale')
2. get_sales_order_details
Get detailed information for a specific sales order.
Parameters:
order_id(required): Sales order IDinclude_lines(optional): Include order lines (default: true)
3. get_sales_stats
Get sales statistics and summaries.
Parameters:
date_from(optional): Start date (YYYY-MM-DD)date_to(optional): End date (YYYY-MM-DD)group_by(optional): Group by field (user_id, team_id, state, partner_id)
Setup
1. Clone and Install Dependencies
git clone [repository-url]
cd odoo-mcp
npm install2. Configure Environment
Copy the environment template and fill in your Odoo credentials:
cp .env.example .envEdit .env:
ODOO_URL=<https://your-odoo-instance.com>
ODOO_DATABASE=your_database_name
ODOO_USERNAME=your_username
ODOO_API_KEY=your_api_keyNote: API keys are more secure than passwords. Generate an API key in Odoo:
Go to Settings > Users & Companies > Users
Select your user
Go to API Keys tab
Generate a new API key
3. Build the Project
npm run buildUsage
Development Mode
Run the server in development mode with hot reload:
npm run devProduction Mode
Build and run the compiled server:
npm run build
npm startTesting with MCP Inspector
Use the MCP Inspector to test your server before integrating with Claude:
npm run inspectorThis will launch the MCP Inspector where you can:
Test tool calls
Inspect responses
Debug connection issues
Integration with Claude
Add this server to your Claude configuration:
{
"mcpServers": {
"odoo-sales": {
"command": "node",
"args": ["/path/to/odoo-mcp/dist/server.js"],
"env": {
"ODOO_URL": "<https://your-odoo-instance.com>",
"ODOO_DATABASE": "your_database_name",
"ODOO_USERNAME": "your_username",
"ODOO_API_KEY": "your_api_key"
}
}
}
}Example Usage
Basic Sales Orders Query
Get all confirmed sales orders from this monthCustom Domain Filter
Get sales orders for customer "John Smith" that are in draft stateThe LLM will automatically construct the appropriate domain filter:
[["partner_id", "ilike", "John Smith"], ["state", "=", "draft"]]Sales Statistics
Show me sales statistics for the last quarter grouped by salespersonProject Structure
odoo-mcp/
├── src/
│ ├── clients/
│ │ └── odoo-client.ts # XML-RPC client for Odoo
│ ├── tools/
│ │ └── sales-orders.ts # Sales order tools implementation
│ ├── types/
│ │ └── odoo.ts # TypeScript interfaces
│ └── server.ts # Main MCP server
├── dist/ # Compiled JavaScript
├── package.json
├── tsconfig.json
├── .env.example
└── README.mdRequirements
Node.js: 18+
Odoo: v18 (may work with older versions)
XML-RPC Access: Odoo instance must allow XML-RPC connections
Error Handling
The server includes comprehensive error handling for:
Invalid Odoo credentials
Network connection issues
Invalid domain filters
Missing required parameters
Zod validation errors
XML-RPC vs HTML response detection
Automatic URL correction suggestions
Detailed diagnostic information
Enhanced Diagnostics
When connection issues occur, the server now provides:
HTTP Endpoint Testing: Verifies if the endpoint is reachable
Content-Type Validation: Detects if server returns HTML instead of XML-RPC
URL Suggestions: Provides corrected URLs for common configuration mistakes
Specific Error Guidance: Explains what each error means and how to fix it
Example Error Output
Server returned HTML instead of XML-RPC response (found <TITLE> tag).
Endpoint returns Content-Type: text/html
This suggests:
1. URL might be pointing to Odoo web interface instead of XML-RPC endpoint
2. XML-RPC might be disabled on this Odoo instance
3. Authentication might be required at web server level
4. Wrong port or path
Try these URLs in your .env file:
1. ODOO_URL=https://your-domain.com:8069
2. ODOO_URL=https://your-domain.com/odoo
3. ODOO_URL=https://your-domain.com/webContributing
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
License
MIT License - see LICENSE file for details
Author
FReptar0
Available Tools
3 toolsget_sales_order_detailsB
Get detailed information for a specific sales order including order lines
Inputs: order_id (required), include_lines.
get_sales_ordersA
Extract sales orders from Odoo database with optional domain filtering. By default, returns confirmed sales orders only.
Inputs: limit, domain, fields, offset.
get_sales_statsC
Get sales statistics and summaries from Odoo database
Inputs: date_to, group_by, date_from.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
The three tools have mostly distinct purposes: list orders, retrieve one order's details, and compute sales stats. get_sales_orders and get_sales_order_details could be momentarily confused, but the descriptions clearly distinguish plural listing from single-order detail.
All tools follow the same predictable get_sales_* snake_case pattern. The verb and resource prefix are consistently applied across the set.
Three tools is reasonable for a tightly focused read-only sales-order surface, with each tool covering a distinct retrieval need. It is slightly thin if broader Odoo sales workflows were intended.
The set covers listing, detail retrieval, and aggregate statistics for sales orders, but has no create, update, delete, confirmation, or related-record lookup tools. These are notable gaps for a sales-order lifecycle, though read-only reporting workflows are supported.
Maintenance
Related MCP Connectors
Connect your Odoo to Claude and ChatGPT: ask about sales, stock, customers and invoices.
Connect AI to Odoo ERP 14-20: search, create, update and manage records in natural language.
Odoo MCP connector for ChatGPT and Claude: ask sales, invoices and stock in plain words. Read-only.
Odoo MCP Pack — ERP/CRM via Odoo's external JSON-RPC API.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Odoo ERP systems through XML-RPC communication. Provides access to Odoo models, records, methods, and data structures for comprehensive ERP integration.2MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Odoo databases via XML-RPC and JSON-RPC for performing CRUD operations and managing modules. It supports advanced features like domain-based searching, field metadata inspection, and administrative task execution.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to fully interact with Odoo ERP instances over XML-RPC, supporting read and write operations on any model without requiring Odoo module installation.5AGPL 3.0
- FlicenseNot gradedqualityDmaintenanceEnables LLM agents to interact with Odoo 17 ERP via external API, providing tools for inventory management, sales order processing, and customer management through natural language.-