Skip to main content
Glama
odoo-mcp-server

odoo-mcp-server

README.md
# odoo-mcp-server

An MCP (Model Context Protocol) server that connects AI assistants like Claude to your Odoo ERP system. Focused on **invoicing, payments, partners, and accounting** via Odoo's XML-RPC API.

Works with Odoo Online (SaaS) and self-hosted Odoo instances (v14+).

## Features

| Tool | Description |
|---|---|
| `search_invoices` | Search invoices by status, customer, date range, payment state |
| `get_invoice` | Get full invoice details including line items |
| `create_invoice` | Create a new draft invoice |
| `post_invoice` | Confirm/post a draft invoice |
| `search_payments` | Search payments by partner, date, state |
| `register_payment` | Register a payment for one or more invoices |
| `search_partners` | Search customers/vendors by name, email, VAT number |
| `create_partner` | Create a new customer or vendor |
| `get_account_balances` | View chart of accounts with balances |
| `search_journal_entries` | Search journal entries/moves |
| `search_products` | Search products (for invoice line items) |
| `odoo_info` | Show connection info and Odoo version |

## Installation

### Claude Code / Claude Desktop

Add this to your MCP configuration:

```json
{
  "mcpServers": {
    "odoo-accounting": {
      "command": "npx",
      "args": ["-y", "odoo-mcp-server"],
      "env": {
        "ODOO_URL": "https://your-company.odoo.com",
        "ODOO_DB": "your-company",
        "ODOO_USERNAME": "your-email@company.com",
        "ODOO_API_KEY": "your-api-key"
      }
    }
  }
}
```

## Configuration

The server requires four environment variables:

| Variable | Description | Example |
|---|---|---|
| `ODOO_URL` | Your Odoo instance URL | `https://mycompany.odoo.com` |
| `ODOO_DB` | Database name (usually the subdomain) | `mycompany` |
| `ODOO_USERNAME` | Your Odoo login email | `user@company.com` |
| `ODOO_API_KEY` | Odoo API key (recommended) or password | `abc123...` |

## How to get an Odoo API Key

1. Log in to your Odoo instance
2. Go to **Settings > Users & Companies > Users**
3. Click on your user
4. Go to the **Account Security** tab
5. Click **New API Key**
6. Give it a name (e.g., "Claude MCP") and copy the key

> **Note:** External API access on Odoo Online requires the **Custom plan**. It is not available on One App Free or Standard plans.

## Usage Examples

Once configured, you can ask Claude things like:

- "Show me all unpaid invoices from this month"
- "What is the total revenue for customer X in 2025?"
- "Create an invoice for Partner Y with 10 hours of consulting at 150 EUR/hour"
- "Register a payment for invoice INV/2025/001"
- "What are the current account balances?"
- "Search for all products related to consulting"

## Development

```bash
git clone https://github.com/ChristopheB-MB/odoo-mcp-server.git
cd odoo-mcp-server
npm install
npm run build
```

Test with MCP Inspector:

```bash
npx @modelcontextprotocol/inspector node ./build/index.js
```

## License

MIT