# mrkhaled007/odoo-mcp-server architecture

> Architecture diagram of the GitHub repository mrkhaled007/odoo-mcp-server, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mrkhaled007/odoo-mcp-server
- Repository: https://github.com/mrkhaled007/odoo-mcp-server

## Overview

This is a read-only MCP bridge from AI clients to live Odoo data. A client invokes a registered partner, sales, or inventory tool; each tool applies its filters, field whitelist, and result cap before querying through the shared authenticated XML-RPC client. The README describes additional security controls and an `odoo://schema` resource as in progress; the sampled source shows field whitelists and caps, but not those planned modules or the resource. The graph reflects only evidenced runtime links.

Main entry points: [`src/odoo_mcp/server.py`](https://github.com/mrkhaled007/odoo-mcp-server/blob/main/src/odoo_mcp/server.py) (FastMCP server), [`src/odoo_mcp/odoo_client.py`](https://github.com/mrkhaled007/odoo-mcp-server/blob/main/src/odoo_mcp/odoo_client.py) (Odoo XML-RPC client), [`src/odoo_mcp/tools/partners.py`](https://github.com/mrkhaled007/odoo-mcp-server/blob/main/src/odoo_mcp/tools/partners.py) (Partner search), [`src/odoo_mcp/tools/sales.py`](https://github.com/mrkhaled007/odoo-mcp-server/blob/main/src/odoo_mcp/tools/sales.py) (Sales orders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["MCP entry"]
  node_server["FastMCP server<br/>[server.py]"]
  node_settings["Validated settings<br/>[config.py]"]
end

subgraph group_domain["Business tools"]
  node_partners["Partner search<br/>[partners.py]"]
  node_sales["Sales orders<br/>[sales.py]"]
  node_inventory["Stock check<br/>[inventory.py]"]
end

subgraph group_connection["Odoo connection"]
  node_odoo_client["Odoo XML-RPC client<br/>[odoo_client.py]"]
end

node_ai_client(("MCP client"))
node_odoo[("Odoo instance")]

node_ai_client -->|"invokes tools"| node_server
node_server -->|"loads settings"| node_settings
node_server -->|"creates and authenticates"| node_odoo_client
node_server -->|"registers"| node_partners
node_server -->|"registers"| node_sales
node_server -->|"registers"| node_inventory
node_partners -->|"queries records"| node_odoo_client
node_sales -->|"queries records"| node_odoo_client
node_inventory -->|"queries stock"| node_odoo_client
node_odoo_client -->|"authenticates and queries"| node_odoo

click node_server "https://github.com/mrkhaled007/odoo-mcp-server/blob/main/src/odoo_mcp/server.py"
click node_settings "https://github.com/mrkhaled007/odoo-mcp-server/blob/main/src/odoo_mcp/config.py"
click node_partners "https://github.com/mrkhaled007/odoo-mcp-server/blob/main/src/odoo_mcp/tools/partners.py"
click node_sales "https://github.com/mrkhaled007/odoo-mcp-server/blob/main/src/odoo_mcp/tools/sales.py"
click node_inventory "https://github.com/mrkhaled007/odoo-mcp-server/blob/main/src/odoo_mcp/tools/inventory.py"
click node_odoo_client "https://github.com/mrkhaled007/odoo-mcp-server/blob/main/src/odoo_mcp/odoo_client.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_server,node_settings,node_ai_client toneBlue
class node_partners,node_sales,node_inventory,node_odoo toneAmber
class node_odoo_client toneMint
```

## Components

### MCP entry

- [FastMCP server](https://github.com/mrkhaled007/odoo-mcp-server/blob/main/src/odoo_mcp/server.py): `src/odoo_mcp/server.py`
- [Validated settings](https://github.com/mrkhaled007/odoo-mcp-server/blob/main/src/odoo_mcp/config.py): `src/odoo_mcp/config.py`

### Business tools

- [Partner search](https://github.com/mrkhaled007/odoo-mcp-server/blob/main/src/odoo_mcp/tools/partners.py): `src/odoo_mcp/tools/partners.py`
- [Sales orders](https://github.com/mrkhaled007/odoo-mcp-server/blob/main/src/odoo_mcp/tools/sales.py): `src/odoo_mcp/tools/sales.py`
- [Stock check](https://github.com/mrkhaled007/odoo-mcp-server/blob/main/src/odoo_mcp/tools/inventory.py): `src/odoo_mcp/tools/inventory.py`

### Odoo connection

- [Odoo XML-RPC client](https://github.com/mrkhaled007/odoo-mcp-server/blob/main/src/odoo_mcp/odoo_client.py): `src/odoo_mcp/odoo_client.py`

### Other components

- **MCP client**
- **Odoo instance**

## Connections

- MCP client → FastMCP server: invokes tools (evidence: `README.md`)
- FastMCP server → Validated settings: loads settings (evidence: `src/odoo_mcp/server.py`)
- FastMCP server → Odoo XML-RPC client: creates and authenticates (evidence: `src/odoo_mcp/server.py`)
- FastMCP server → Partner search: registers (evidence: `src/odoo_mcp/server.py`)
- FastMCP server → Sales orders: registers (evidence: `src/odoo_mcp/server.py`)
- FastMCP server → Stock check: registers (evidence: `src/odoo_mcp/server.py`)
- Partner search → Odoo XML-RPC client: queries records (evidence: `src/odoo_mcp/tools/partners.py`)
- Sales orders → Odoo XML-RPC client: queries records (evidence: `src/odoo_mcp/tools/sales.py`)
- Stock check → Odoo XML-RPC client: queries stock (evidence: `src/odoo_mcp/tools/inventory.py`)
- Odoo XML-RPC client → Odoo instance: authenticates and queries (evidence: `src/odoo_mcp/odoo_client.py`)
