mcp_server_odoo

sitrakaherivalisoagithub/mcp_server_odoo

3.1

If you are the rightful owner of mcp_server_odoo and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

This project provides a Model Context Protocol (MCP) server that bridges an Odoo ERP instance, enabling natural language interaction with the ERP system.

Tools
16
Resources
0
Prompts
0

Odoo MCP Server

Description

This project provides a Model Context Protocol (MCP) server that acts as a bridge to an Odoo ERP instance. It exposes various Odoo functionalities as tools that can be called by an MCP-compatible agent, allowing for natural language interaction with the ERP system.

The server is built with Python using the mcp SDK and connects to Odoo via its XML-RPC API. It features a modular architecture where tools for different Odoo applications (like Sales, CRM, Stock) are organized into separate, self-contained modules.

Features

  • Modular Architecture: Tools are organized by Odoo application, making the server easy to extend.
  • Odoo Integration: Connects to any Odoo instance to perform real-time operations.
  • Comprehensive Toolset: Exposes a wide range of functionalities from key Odoo modules:
    • Partners/Contacts: Find and create contacts and companies.
    • Sales: Find, create, and confirm quotations.
    • Purchases: Find, create, and confirm purchase orders.
    • Stock: Manage stock movements, check availability, and handle transfers.
    • CRM: Find, create, and update CRM opportunities.
    • Accounting/Invoicing: List invoices, get invoice details, and list customer payments.

Setup and Installation

1. Dependencies

This project uses uv for package management. The required dependencies are listed in pyproject.toml. The primary dependency is the mcp Python SDK.

2. Odoo Configuration

You need to configure the connection to your Odoo instance. Create a .env file in the odoo_server directory with the following content:

# odoo_server/.env

ODOO_URL=https://your-odoo-instance.com/
ODOO_DB=your_database_name
ODOO_USERNAME=your_odoo_username
ODOO_PASSWORD=your_odoo_password

Replace the placeholder values with your actual Odoo credentials.

Usage

To start the MCP server, run the main application file from the project's root directory:

python odoo_server/main.py

The server will start on 127.0.0.1:3001 by default. You can configure the host and port using command-line options:

python odoo_server/main.py --host 0.0.0.0 --port 8000

Available Tools

The server exposes the following tools, categorized by module:

Partner Tools (partner_tools.py)

  • find_partners: Finds contacts or companies with filters for name, city, or country code.
  • create_contact: Creates a new contact or company.

Sales Tools (sales_tools.py)

  • find_quotations: Finds sales quotations with filters for customer, date, or state.
  • create_quotation: Creates a new sales quotation with a customer and product lines.
  • confirm_quotation: Confirms a quotation, turning it into a sales order.

Purchase Tools (purchase_tools.py)

  • find_purchase_orders: Finds purchase orders with filters for vendor, state, or date.
  • create_purchase_order: Creates a new purchase order with a vendor and product lines.
  • confirm_purchase_order: Confirms a purchase order.

Stock Tools (stock_tools.py)

  • find_stock_movements: Finds stock movements with filters for product, type, state, or date.
  • create_internal_transfer: Creates an internal stock transfer between two locations.
  • check_product_availability: Checks the quantity of a product available in stock.
  • receive_product: Validates a product receipt (picking).
  • list_inventory_adjustments: Lists recent inventory adjustments.

CRM Tools (crm_tools.py)

  • find_opportunities: Finds CRM opportunities with filters for name, customer, or stage.
  • create_opportunity: Creates a new CRM opportunity.
  • update_opportunity_stage: Updates the stage of an existing opportunity.

Account Tools (account_tools.py)

  • list_invoices: Lists invoices with optional filters for state, customer, and date range.
  • get_invoice_details: Retrieves the details of a specific invoice.
  • list_customer_payments: Lists the payments recorded for a specific customer.

License

MIT License

Copyright (c) 2025 Sitraka Herival's

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall 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.