Skip to Content

Supercharge Your Odoo 18 Workflow with the MCP Integration Project

A deep dive into a powerful, open-source integration server that leverages AI, Docker, and a rich toolset to streamline Odoo 18 development and data management.
Visualizing the complex architecture of modern ERP integrations.

In the ever-evolving world of ERP systems, seamless integration and efficient development are paramount. Today, we're diving into a powerful open-source project that promises to revolutionize how developers interact with Odoo 18: the Odoo 18 MCP Integration project. This robust integration server acts as a bridge between the Master Control Program (MCP) and your Odoo 18.0 ERP, offering a standardized API for CRUD operations, dynamic model discovery, AI-powered code generation, and much more.

What is the Odoo 18 MCP Integration Project?

At its core, this project is an integration server designed to connect MCP with an Odoo 18.0 instance. It provides a standardized interface to perform Create, Read, Update, and Delete (CRUD) operations on any Odoo model through a simple, yet powerful, API. But it goes far beyond basic CRUD. The project is packed with features like dynamic model discovery, advanced natural language search, AI-powered Odoo module generation, and comprehensive data management tools.

Key Features at a Glance

  • Dynamic Odoo Integration: Connects via XML-RPC and dynamically discovers models and fields, analyzes their importance using NLP, and understands relationships for smarter operations.
  • Full CRUD and Beyond: Supports create, read, update, and delete for any Odoo model, including batch operations and custom method execution.
  • AI-Powered Tools: Integrates with Gemini and other LLMs to parse natural language queries, generate entire Odoo modules from a simple prompt, and retrieve relevant documentation.
  • Advanced Data Management: Includes tools for exporting and importing data (including related records) to and from CSV files, maintaining data integrity.
  • Developer-Friendly Environment: Comes with comprehensive Docker support, a Makefile for easy commands, a Streamlit UI for interactive use, and extensive testing scripts.

Project Architecture

The project is logically structured to separate concerns, making it modular and maintainable. Here’s a simplified overview of its structure:

odoo18_mcp_project/
├── src/                     # Main source code
│   ├── agents/             # AI agents for code generation and data management
│   ├── mcp/                # MCP integration code (server, handlers)
│   ├── odoo/               # Odoo integration code (client, schemas, dynamic discovery)
│   ├── odoo_docs_rag/      # Odoo documentation retrieval (RAG)
│   └── streamlit_client/   # Streamlit UI for interactive use
├── tests/                   # Comprehensive test files
├── docker-compose.yml       # Base Docker configuration
├── Makefile                 # Helper commands for Docker and development
├── mcp_server.py            # Main MCP server implementation
└── standalone_mcp_server.py # Standalone server for testing without Claude Desktop

Getting Started: Setup and Installation

Setting up the project is straightforward. You can either set it up locally or use the provided Docker environment for a more isolated setup.

1. Clone and Configure

First, clone the repository and set up your environment variables.

# Clone the repository
git clone https://github.com/infovpcs/odoo18_mcp_project.git
cd odoo18_mcp_project

# Create and activate a virtual environment
python -m venv venv
source venv/bin/activate

# Install dependencies
pip install -e .

# Copy the example environment file
cp .env.example .env

Next, edit the .env file to add your Odoo and optional AI service credentials:

ODOO_URL=http://localhost:8069
ODOO_DB=your_odoo_db
ODOO_USERNAME=your_odoo_user
ODOO_PASSWORD=your_odoo_password

# Optional: For AI-powered features
GEMINI_API_KEY=your_gemini_api_key_here
BRAVE_API_KEY=your_brave_api_key_here

2. Run with Docker (Recommended)

The project includes a Makefile that simplifies Docker-based development. This is the recommended way to run the services.

# Build the Docker images
make build

# Start the development environment
make dev

# View logs from all services
make logs

# Stop all services
make down

Exploring the Power Tools: Usage Examples

This project is more than just an API; it's a suite of powerful tools. Let's explore some of them.

Standalone Server for Testing

You can test all the tools without needing Claude Desktop by running the standalone server, which exposes a standard HTTP API on port 8001.

# Run the standalone server
python standalone_mcp_server.py

Basic CRUD Operations

Interact with any Odoo model programmatically. Here's how you can create a new product via a simple API call:

import requests
import json

url = "http://localhost:8001/call_tool"
headers = {"Content-Type": "application/json"}
data = {
    "tool": "create_record",
    "params": {
        "model_name": "product.product",
        "values": {
            "name": "API-Created Product",
            "default_code": "API-001",
            "list_price": 199.99,
            "type": "consu"
        }
    }
}

response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())

Advanced Natural Language Search

One of the standout features is the ability to query Odoo using natural language. The server parses the query, identifies relevant models and fields, and constructs the appropriate domain filter.

# Use curl to send a natural language query
curl -X POST "http://localhost:8001/call_tool" \
  -H "Content-Type: application/json" \
  -d '{
    "tool": "advanced_search",
    "params": {
      "query": "List all unpaid bills for Gemini Furniture",
      "limit": 5
    }
  }'

AI-Powered Odoo Module Generator

The `run_odoo_code_agent` tool leverages LLMs like Gemini to generate complete, Odoo 18-compliant modules from a single prompt. It analyzes requirements, creates a plan, and generates the necessary Python and XML files.

# Generate a new module using the code agent
curl -X POST "http://localhost:8001/call_tool" \
  -H "Content-Type: application/json" \
  -d '{
    "tool": "run_odoo_code_agent",
    "params": {
      "query": "Create a customer feedback module for Odoo 18 with ratings and comments",
      "use_gemini": true,
      "save_to_files": true
    }
  }'

This command will generate the complete module structure, models, views, and security files in the ./generated_modules directory.

Interactive Streamlit Client

For a more visual and interactive experience, the project includes a Streamlit application that provides a UI for most of the available tools, including the code agent, data import/export, and documentation search.

# Run the Streamlit app
streamlit run src/streamlit_client/app.py

Navigate to ithttp://localhost:8501 in your browser to access the UI.

Conclusion

The Odoo 18 MCP Integration project is a comprehensive and powerful toolkit for any developer working with Odoo. By providing a standardized API, intelligent tools, and AI-driven capabilities, it significantly streamlines development, data management, and system interaction. Whether you're building complex integrations, performing data migrations, or rapidly scaffolding new modules, this project offers the tools to do it more efficiently. Check out the GitHub repository to explore its full potential and supercharge your Odoo 18 workflow. 

🎥 Watch the demo video:

👉 https://youtu.be/gZhcB2uG-Xs?si=xGUSZJ3lv37ZUM-S

Share this post
Unlocking Manufacturing Excellence: Applying "The Goal" by Goldratt in Odoo MRP
How Eliyahu Goldratt's Theory of Constraints can transform your Odoo manufacturing workflow and what to do about the gaps.