Metadata-Version: 2.4
Name: odoo-mcp-server-conn
Version: 1.0.0
Summary: Advanced MCP (Model Context Protocol) server for Odoo ERP — full CRUD, BI analytics, workflow navigation, security audit and more.
Author-email: Eduardo Bolivar <eduardobolivar2407@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/eduardobolivar/odoo-mcp-server
Project-URL: Repository, https://github.com/eduardobolivar/odoo-mcp-server
Keywords: odoo,mcp,model-context-protocol,erp,ai,xmlrpc,claude
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial :: Accounting
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: mcp>=1.0.0
Provides-Extra: http
Requires-Dist: mcp[http]>=1.0.0; extra == "http"

# Odoo MCP Server — Agentic Edition

[![ES](https://img.shields.io/badge/Lang-Espa%C3%B1ol-yellow.svg)](README.es.md) [![EN](https://img.shields.io/badge/Lang-English-blue.svg)](README.md)

An enterprise-grade Model Context Protocol (MCP) server for interacting with Odoo ERP through AI assistants. Unlike a traditional database connector, this server is designed as an **agentic bridge**: it teaches the AI how to navigate Odoo, understand its business logic, and perform complex data analysis.

---

## 🚀 Why choose Agentic Edition?

- 🧠 **Guided Workflows (Prompts)**: Native instructions that teach your AI how to audit inventory, analyze sales, or review security permissions step-by-step, without the user having to write prompts from scratch.
- 📊 **Native Business Intelligence (BI)**: Optimized support for `read_group` and advanced analytical operations, allowing the AI to generate financial reports or KPIs instantly.
- 🔍 **Deep Introspection**: Tools that grant the AI x-ray vision. The AI can discover available action buttons (`get_action_buttons`), inspect view XML architectures (`get_view_architecture`), or evaluate security rules (`get_security_rules`), reducing hallucinations to a minimum.
- 🔐 **Built-in Security**: Uses Odoo's native and isolated XML-RPC transport layer.

---

## 📦 Quick Installation

Install the binary globally in your terminal using `pip` or the blazing fast `uv`:

```bash
# Recommended: Isolated and super fast environment
uv tool install odoo-mcp-server

# Standard
pip install odoo-mcp-server
```

---

## ⚙️ AI Client Configuration

To connect the server, you need at least the following environment variables:

- `ODOO_URL`: Your Odoo URL (e.g., `http://localhost:8069`).
- `ODOO_DB`: The database name.
- `ODOO_USERNAME`: The user's email or login.
- `ODOO_PASSWORD`: Password or **API Key** (Strongly recommended).

### Cursor IDE

1. Go to **Settings > Features > MCP**.
2. Add a new `command` type server.
3. Command: `odoo-mcp-server`.
4. Add your environment variables right there.

### VS Code (Roo Code / Cline)

Define this block in your `cline_mcp_settings.json`:

```json
{
  "mcpServers": {
    "odoo-server": {
      "command": "odoo-mcp-server",
      "env": {
        "ODOO_URL": "http://localhost:8069",
        "ODOO_DB": "my_database",
        "ODOO_USERNAME": "admin",
        "ODOO_PASSWORD": "my_api_key_or_password"
      }
    }
  }
}
```

### Claude Desktop

Find your `claude_desktop_config.json` file and configure it the same way as the JSON above:

- **Mac:** `~/Library/Application Support/Claude/claude_desktop_config.json`
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`

### Claude Code (CLI)

Use it in your terminal by exporting the environment variables previously in bash:

```bash
claude mcp add odoo-server -- odoo-mcp-server
```

---

## 🧰 The Toolbelt (18+ Tools)

### 1. Data Intelligence (BI & Analytics)

- `read_group`: Odoo's GROUP BY. Extracts sums, counts, and averages directly.
- `export_to_csv`: Immediate raw data dumps to flat CSV.
- `get_available_reports`: Lists PDF or HTML reports ready to be rendered for the model.

### 2. Prompts (Pre-trained Workflows)

- `analyze_sales`: Sales diagnostics and KPIs (Top customers, revenue trends).
- `diagnose_inventory`: Search for bottlenecks in warehouses and `stock.move`.
- `audit_permissions`: Intersection of security groups and Access Control Lists (ACL).
- `financial_overview`: Macro overview of cash flow (AR, AP, invoicing).

### 3. Core Operations (CRUD)

- `search_records`, `read_records`, `search_read_records`.
- `create_record`, `update_record`, `delete_record`.
- `count_records`.

### 4. Advanced ERP Navigation

- `get_model_fields`: Exact database structure in real-time.
- `get_related_records`: Automatically resolved One2Many, Many2One, and Many2Many relations.
- `get_workflow_states`: Model states, stages, and interface interactions.
- `explain_domain`: Odoo-to-Natural Language translator for complex domains.
- `execute_method`: Invokes any internal Odoo logic (e.g., `action_confirm`).

---

## 📡 Resources (Static URIs)

The AI can query these URLs directly as if it were navigating them:

- `odoo://models` → Master list of all objects in Odoo.
- `odoo://fields/{model}` → Data dictionary of a specific model.
- `odoo://record/{model}/{id}` → The complete record sheet.
- `odoo://search/{model}/{domain}` → Immediate searches like `odoo://search/res.partner/[["is_company","=",true]]`.

---

## 🛡️ Security

- Interactions are shielded by Odoo's own XML-RPC layer; if the user lacks permissions in the ERP, the MCP server cannot bypass them.
- We never perform forced _commits_ or SQL injections that bypass Odoo's counters and triggers.
- **License:** MIT.
