mcp-server-odoo


Namemcp-server-odoo JSON
Version 0.3.0 PyPI version JSON
download
home_pageNone
SummaryA Model Context Protocol server for Odoo ERP systems
upload_time2025-09-14 19:54:41
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMPL-2.0
keywords ai anthropic claude erp llm mcp model-context-protocol odoo
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # MCP Server for Odoo

[![CI](https://github.com/ivnvxd/mcp-server-odoo/actions/workflows/ci.yml/badge.svg)](https://github.com/ivnvxd/mcp-server-odoo/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/ivnvxd/mcp-server-odoo/branch/main/graph/badge.svg)](https://codecov.io/gh/ivnvxd/mcp-server-odoo)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![License: MPL 2.0](https://img.shields.io/badge/License-MPL_2.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)

An MCP server that enables AI assistants like Claude to interact with Odoo ERP systems. Access business data, search records, create new entries, update existing data, and manage your Odoo instance through natural language.

**Works with any Odoo instance!** Use [YOLO mode](#yolo-mode-developmenttesting-only-) for quick testing and demos with any standard Odoo installation. For enterprise security, access controls, and production use, install the [Odoo MCP module](https://apps.odoo.com/apps/modules/18.0/mcp_server).

## Features

- 🔍 **Search and retrieve** any Odoo record (customers, products, invoices, etc.)
- ✨ **Create new records** with field validation and permission checks
- ✏️ **Update existing data** with smart field handling
- 🗑️ **Delete records** respecting model-level permissions
- 📊 **Browse multiple records** and get formatted summaries
- 🔢 **Count records** matching specific criteria
- 📋 **Inspect model fields** to understand data structure
- 🔐 **Secure access** with API key or username/password authentication
- 🎯 **Smart pagination** for large datasets
- 💬 **LLM-optimized output** with hierarchical text formatting
- 🚀 **YOLO Mode** for quick access with any Odoo instance (no module required)

## Installation

### Prerequisites

- Python 3.10 or higher
- Access to an Odoo instance (version 17.0+)
- For production use: The [Odoo MCP module](https://apps.odoo.com/apps/modules/18.0/mcp_server) installed on your Odoo server
- For testing/demos: Any standard Odoo instance (use YOLO mode)

### Install UV First

The MCP server runs on your **local computer** (where Claude Desktop is installed), not on your Odoo server. You need to install UV on your local machine:

<details>
<summary>macOS/Linux</summary>

```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
```
</details>

<details>
<summary>Windows</summary>

```powershell
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
```
</details>

After installation, restart your terminal to ensure UV is in your PATH.

### Installing via MCP Settings (Recommended)

Add this configuration to your MCP settings:

```json
{
  "mcpServers": {
    "odoo": {
      "command": "uvx",
      "args": ["mcp-server-odoo"],
      "env": {
        "ODOO_URL": "https://your-odoo-instance.com",
        "ODOO_API_KEY": "your-api-key-here"
      }
    }
  }
}
```

<details>
<summary>Claude Desktop</summary>

Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "odoo": {
      "command": "uvx",
      "args": ["mcp-server-odoo"],
      "env": {
        "ODOO_URL": "https://your-odoo-instance.com",
        "ODOO_API_KEY": "your-api-key-here",
        "ODOO_DB": "your-database-name"
      }
    }
  }
}
```
</details>

<details>
<summary>Cursor</summary>

Add to `~/.cursor/mcp_settings.json`:

```json
{
  "mcpServers": {
    "odoo": {
      "command": "uvx",
      "args": ["mcp-server-odoo"],
      "env": {
        "ODOO_URL": "https://your-odoo-instance.com",
        "ODOO_API_KEY": "your-api-key-here",
        "ODOO_DB": "your-database-name"
      }
    }
  }
}
```
</details>

<details>
<summary>VS Code (with GitHub Copilot)</summary>

Add to your VS Code settings (`~/.vscode/mcp_settings.json` or workspace settings):

```json
{
  "github.copilot.chat.mcpServers": {
    "odoo": {
      "command": "uvx",
      "args": ["mcp-server-odoo"],
      "env": {
        "ODOO_URL": "https://your-odoo-instance.com",
        "ODOO_API_KEY": "your-api-key-here",
        "ODOO_DB": "your-database-name"
      }
    }
  }
}
```
</details>

<details>
<summary>Zed</summary>

Add to `~/.config/zed/settings.json`:

```json
{
  "context_servers": {
    "odoo": {
      "command": "uvx",
      "args": ["mcp-server-odoo"],
      "env": {
        "ODOO_URL": "https://your-odoo-instance.com",
        "ODOO_API_KEY": "your-api-key-here",
        "ODOO_DB": "your-database-name"
      }
    }
  }
}
```
</details>

### Alternative Installation Methods

<details>
<summary>Using pip</summary>

```bash
# Install globally
pip install mcp-server-odoo

# Or use pipx for isolated environment
pipx install mcp-server-odoo
```

Then use `mcp-server-odoo` as the command in your MCP configuration.
</details>

<details>
<summary>From source</summary>

```bash
git clone https://github.com/ivnvxd/mcp-server-odoo.git
cd mcp-server-odoo
pip install -e .
```

Then use the full path to the package in your MCP configuration.
</details>

## Configuration

### Environment Variables

The server requires the following environment variables:

| Variable | Required | Description | Example |
|----------|----------|-------------|---------|
| `ODOO_URL` | Yes | Your Odoo instance URL | `https://mycompany.odoo.com` |
| `ODOO_API_KEY` | Yes* | API key for authentication | `0ef5b399e9ee9c11b053dfb6eeba8de473c29fcd` |
| `ODOO_USER` | Yes* | Username (if not using API key) | `admin` |
| `ODOO_PASSWORD` | Yes* | Password (if not using API key) | `admin` |
| `ODOO_DB` | No | Database name (auto-detected if not set) | `mycompany` |
| `ODOO_YOLO` | No | YOLO mode - bypasses MCP security (⚠️ DEV ONLY) | `off`, `read`, `true` |

*Either `ODOO_API_KEY` or both `ODOO_USER` and `ODOO_PASSWORD` are required.

**Notes:**
- If database listing is restricted on your server, you must specify `ODOO_DB`
- API key authentication is recommended for better security

### Transport Options

The server supports multiple transport protocols for different use cases:

#### 1. **stdio** (Default)
Standard input/output transport - used by desktop AI applications like Claude Desktop.

```bash
# Default transport - no additional configuration needed
uvx mcp-server-odoo
```

#### 2. **streamable-http**
Standard HTTP transport for REST API-style access and remote connectivity.

```bash
# Run with HTTP transport
uvx mcp-server-odoo --transport streamable-http --host 0.0.0.0 --port 8000

# Or use environment variables
export ODOO_MCP_TRANSPORT=streamable-http
export ODOO_MCP_HOST=0.0.0.0
export ODOO_MCP_PORT=8000
uvx mcp-server-odoo
```

The HTTP endpoint will be available at: `http://localhost:8000/mcp/`

> **Note**: SSE (Server-Sent Events) transport has been deprecated in MCP protocol version 2025-03-26. Use streamable-http transport instead for HTTP-based communication. Requires MCP library v1.9.4 or higher for proper session management.

#### Transport Configuration

| Variable/Flag | Description | Default |
|--------------|-------------|---------|
| `ODOO_MCP_TRANSPORT` / `--transport` | Transport type: stdio, streamable-http | `stdio` |
| `ODOO_MCP_HOST` / `--host` | Host to bind for HTTP transports | `localhost` |
| `ODOO_MCP_PORT` / `--port` | Port to bind for HTTP transports | `8000` |

<details>
<summary>Running streamable-http transport for remote access</summary>

```json
{
  "mcpServers": {
    "odoo-remote": {
      "command": "uvx",
      "args": ["mcp-server-odoo", "--transport", "streamable-http", "--port", "8080"],
      "env": {
        "ODOO_URL": "https://your-odoo-instance.com",
        "ODOO_API_KEY": "your-api-key-here",
        "ODOO_DB": "your-database-name"
      }
    }
  }
}
```
</details>

### Setting up Odoo

1. **Install the MCP module**:
   - Download the [mcp_server](https://apps.odoo.com/apps/modules/18.0/mcp_server) module
   - Install it in your Odoo instance
   - Navigate to Settings > MCP Server

2. **Enable models for MCP access**:
   - Go to Settings > MCP Server > Enabled Models
   - Add models you want to access (e.g., res.partner, product.product)
   - Configure permissions (read, write, create, delete) per model

3. **Generate an API key**:
   - Go to Settings > Users & Companies > Users
   - Select your user
   - Under the "API Keys" tab, create a new key
   - Copy the key for your MCP configuration

### YOLO Mode (Development/Testing Only) ⚠️

YOLO mode allows the MCP server to connect directly to any standard Odoo instance **without requiring the MCP module**. This mode bypasses all MCP security controls and is intended **ONLY for development, testing, and demos**.

**🚨 WARNING: Never use YOLO mode in production environments!**

#### YOLO Mode Levels

1. **Read-Only Mode** (`ODOO_YOLO=read`):
   - Allows all read operations (search, read, count)
   - Blocks all write operations (create, update, delete)
   - Safe for demos and testing
   - Shows "READ-ONLY" indicators in responses

2. **Full Access Mode** (`ODOO_YOLO=true`):
   - Allows ALL operations without restrictions
   - Full CRUD access to all models
   - **EXTREMELY DANGEROUS** - use only in isolated environments
   - Shows "FULL ACCESS" warnings in responses

#### YOLO Mode Configuration

<details>
<summary>Read-Only YOLO Mode (safer for demos)</summary>

```json
{
  "mcpServers": {
    "odoo-demo": {
      "command": "uvx",
      "args": ["mcp-server-odoo"],
      "env": {
        "ODOO_URL": "http://localhost:8069",
        "ODOO_USER": "admin",
        "ODOO_PASSWORD": "admin",
        "ODOO_DB": "demo",
        "ODOO_YOLO": "read"
      }
    }
  }
}
```
</details>

<details>
<summary>Full Access YOLO Mode (⚠️ use with extreme caution)</summary>

```json
{
  "mcpServers": {
    "odoo-test": {
      "command": "uvx",
      "args": ["mcp-server-odoo"],
      "env": {
        "ODOO_URL": "http://localhost:8069",
        "ODOO_USER": "admin",
        "ODOO_PASSWORD": "admin",
        "ODOO_DB": "test",
        "ODOO_YOLO": "true"
      }
    }
  }
}
```
</details>

#### When to Use YOLO Mode

✅ **Appropriate Uses:**
- Local development with test data
- Quick demos with non-sensitive data
- Testing MCP clients before installing the MCP module
- Prototyping in isolated environments

❌ **Never Use For:**
- Production environments
- Instances with real customer data
- Shared development servers
- Any environment with sensitive information

#### YOLO Mode Security Notes

- Connects directly to Odoo's standard XML-RPC endpoints
- Bypasses all MCP access controls and model restrictions
- No rate limiting is applied
- All operations are logged but not restricted
- Model listing shows 200+ models instead of just enabled ones

## Usage Examples

Once configured, you can ask Claude:

**Search & Retrieve:**
- "Show me all customers from Spain"
- "Find products with stock below 10 units"
- "List today's sales orders over $1000"
- "Search for unpaid invoices from last month"
- "Count how many active employees we have"
- "Show me the contact information for Microsoft"

**Create & Manage:**
- "Create a new customer contact for Acme Corporation"
- "Add a new product called 'Premium Widget' with price $99.99"
- "Create a calendar event for tomorrow at 2 PM"
- "Update the phone number for customer John Doe to +1-555-0123"
- "Change the status of order SO/2024/001 to confirmed"
- "Delete the test contact we created earlier"

## Available Tools

### `search_records`
Search for records in any Odoo model with filters.

```json
{
  "model": "res.partner",
  "domain": [["is_company", "=", true], ["country_id.code", "=", "ES"]],
  "fields": ["name", "email", "phone"],
  "limit": 10
}
```

**Field Selection Options:**
- Omit `fields` or set to `null`: Returns smart selection of common fields
- Specify field list: Returns only those specific fields
- Use `["__all__"]`: Returns all fields (use with caution)

### `get_record`
Retrieve a specific record by ID.

```json
{
  "model": "res.partner",
  "record_id": 42,
  "fields": ["name", "email", "street", "city"]
}
```

**Field Selection Options:**
- Omit `fields` or set to `null`: Returns smart selection of common fields with metadata
- Specify field list: Returns only those specific fields
- Use `["__all__"]`: Returns all fields without metadata

### `list_models`
List all models enabled for MCP access.

```json
{}
```

### `create_record`
Create a new record in Odoo.

```json
{
  "model": "res.partner",
  "values": {
    "name": "New Customer",
    "email": "customer@example.com",
    "is_company": true
  }
}
```

### `update_record`
Update an existing record.

```json
{
  "model": "res.partner",
  "record_id": 42,
  "values": {
    "phone": "+1234567890",
    "website": "https://example.com"
  }
}
```

### `delete_record`
Delete a record from Odoo.

```json
{
  "model": "res.partner",
  "record_id": 42
}
```

## Resources

The server also provides direct access to Odoo data through resource URIs:

- `odoo://res.partner/record/1` - Get partner with ID 1
- `odoo://product.product/search?domain=[["qty_available",">",0]]` - Search products in stock
- `odoo://sale.order/browse?ids=1,2,3` - Browse multiple sales orders
- `odoo://res.partner/count?domain=[["customer_rank",">",0]]` - Count customers
- `odoo://product.product/fields` - List available fields for products

## Security

- Always use HTTPS in production environments
- Keep your API keys secure and rotate them regularly
- Configure model access carefully - only enable necessary models
- The MCP module respects Odoo's built-in access rights and record rules
- Each API key is linked to a specific user with their permissions

## Troubleshooting

<details>
<summary>Connection Issues</summary>

If you're getting connection errors:
1. Verify your Odoo URL is correct and accessible
2. Check that the MCP module is installed: visit `https://your-odoo.com/mcp/health`
3. Ensure your firewall allows connections to Odoo
</details>

<details>
<summary>Authentication Errors</summary>

If authentication fails:
1. Verify your API key is active in Odoo
2. Check that the user has appropriate permissions
3. Try regenerating the API key
4. For username/password auth, ensure 2FA is not enabled
</details>

<details>
<summary>Model Access Errors</summary>

If you can't access certain models:
1. Go to Settings > MCP Server > Enabled Models in Odoo
2. Ensure the model is in the list and has appropriate permissions
3. Check that your user has access to that model in Odoo's security settings
</details>

<details>
<summary>"spawn uvx ENOENT" Error</summary>

This error means UV is not installed or not in your PATH:

**Solution 1: Install UV** (see Installation section above)

**Solution 2: macOS PATH Issue**
Claude Desktop on macOS doesn't inherit your shell's PATH. Try:
1. Quit Claude Desktop completely (Cmd+Q)
2. Open Terminal
3. Launch Claude from Terminal:
   ```bash
   open -a "Claude"
   ```

**Solution 3: Use Full Path**
Find UV location and use full path:
```bash
which uvx
# Example output: /Users/yourname/.local/bin/uvx
```

Then update your config:
```json
{
  "command": "/Users/yourname/.local/bin/uvx",
  "args": ["mcp-server-odoo"]
}
```
</details>

<details>
<summary>Database Configuration Issues</summary>

If you see "Access Denied" when listing databases:
- This is normal - some Odoo instances restrict database listing for security
- Make sure to specify `ODOO_DB` in your configuration
- The server will use your specified database without validation

Example configuration:
```json
{
  "env": {
    "ODOO_URL": "https://your-odoo.com",
    "ODOO_API_KEY": "your-key",
    "ODOO_DB": "your-database-name"
  }
}
```
Note: `ODOO_DB` is required if database listing is restricted on your server.
</details>

<details>
<summary>"SSL: CERTIFICATE_VERIFY_FAILED" Error</summary>

This error occurs when Python cannot verify SSL certificates, often on macOS or corporate networks.

**Solution**: Add SSL certificate path to your environment configuration:

```json
{
  "env": {
    "ODOO_URL": "https://your-odoo.com",
    "ODOO_API_KEY": "your-key",
    "SSL_CERT_FILE": "/etc/ssl/cert.pem"
  }
}
```

This tells Python where to find the system's SSL certificate bundle for HTTPS connections. The path `/etc/ssl/cert.pem` is the standard location on most systems.
</details>

<details>
<summary>Debug Mode</summary>

Enable debug logging for more information:

```json
{
  "env": {
    "ODOO_URL": "https://your-odoo.com",
    "ODOO_API_KEY": "your-key",
    "ODOO_MCP_LOG_LEVEL": "DEBUG"
  }
}
```
</details>

## Development

<details>
<summary>Running from source</summary>

```bash
# Clone the repository
git clone https://github.com/ivnvxd/mcp-server-odoo.git
cd mcp-server-odoo

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest --cov

# Run the server
python -m mcp_server_odoo
```
</details>

<details>
<summary>Testing with MCP Inspector</summary>

```bash
# Using uvx
npx @modelcontextprotocol/inspector uvx mcp-server-odoo

# Using local installation
npx @modelcontextprotocol/inspector python -m mcp_server_odoo
```
</details>

## Testing

### Transport Tests

You can test both stdio and streamable-http transports to ensure they're working correctly:

```bash
# Run comprehensive transport tests
python tests/run_transport_tests.py
```

This will test:
- **stdio transport**: Basic initialization and communication
- **streamable-http transport**: HTTP endpoint, session management, and tool calls

### Unit Tests

For complete testing including unit and integration tests:

```bash
# Run all tests
uv run pytest --cov

# Run specific test categories
uv run pytest tests/test_tools.py -v
uv run pytest tests/test_server_foundation.py -v
```

## License

This project is licensed under the Mozilla Public License 2.0 (MPL-2.0) - see the [LICENSE](LICENSE) file for details.

## Contributing

Contributions are very welcome! Please see the [CONTRIBUTING](CONTRIBUTING.md) guide for details.

## Support

Thank you for using this project! If you find it helpful and would like to support my work, kindly consider buying me a coffee. Your support is greatly appreciated!

<a href="https://www.buymeacoffee.com/ivnvxd" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>

And do not forget to give the project a star if you like it! :star:
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mcp-server-odoo",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "Andrey Ivanov <ivnv.xd@gmail.com>",
    "keywords": "ai, anthropic, claude, erp, llm, mcp, model-context-protocol, odoo",
    "author": null,
    "author_email": "Andrey Ivanov <ivnv.xd@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/b4/06/8de4c46cd7599c5352c202bf9503d144bc44790ab10b0857b28074985869/mcp_server_odoo-0.3.0.tar.gz",
    "platform": null,
    "description": "# MCP Server for Odoo\n\n[![CI](https://github.com/ivnvxd/mcp-server-odoo/actions/workflows/ci.yml/badge.svg)](https://github.com/ivnvxd/mcp-server-odoo/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/ivnvxd/mcp-server-odoo/branch/main/graph/badge.svg)](https://codecov.io/gh/ivnvxd/mcp-server-odoo)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)\n[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)\n[![License: MPL 2.0](https://img.shields.io/badge/License-MPL_2.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)\n\nAn MCP server that enables AI assistants like Claude to interact with Odoo ERP systems. Access business data, search records, create new entries, update existing data, and manage your Odoo instance through natural language.\n\n**Works with any Odoo instance!** Use [YOLO mode](#yolo-mode-developmenttesting-only-) for quick testing and demos with any standard Odoo installation. For enterprise security, access controls, and production use, install the [Odoo MCP module](https://apps.odoo.com/apps/modules/18.0/mcp_server).\n\n## Features\n\n- \ud83d\udd0d **Search and retrieve** any Odoo record (customers, products, invoices, etc.)\n- \u2728 **Create new records** with field validation and permission checks\n- \u270f\ufe0f **Update existing data** with smart field handling\n- \ud83d\uddd1\ufe0f **Delete records** respecting model-level permissions\n- \ud83d\udcca **Browse multiple records** and get formatted summaries\n- \ud83d\udd22 **Count records** matching specific criteria\n- \ud83d\udccb **Inspect model fields** to understand data structure\n- \ud83d\udd10 **Secure access** with API key or username/password authentication\n- \ud83c\udfaf **Smart pagination** for large datasets\n- \ud83d\udcac **LLM-optimized output** with hierarchical text formatting\n- \ud83d\ude80 **YOLO Mode** for quick access with any Odoo instance (no module required)\n\n## Installation\n\n### Prerequisites\n\n- Python 3.10 or higher\n- Access to an Odoo instance (version 17.0+)\n- For production use: The [Odoo MCP module](https://apps.odoo.com/apps/modules/18.0/mcp_server) installed on your Odoo server\n- For testing/demos: Any standard Odoo instance (use YOLO mode)\n\n### Install UV First\n\nThe MCP server runs on your **local computer** (where Claude Desktop is installed), not on your Odoo server. You need to install UV on your local machine:\n\n<details>\n<summary>macOS/Linux</summary>\n\n```bash\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n```\n</details>\n\n<details>\n<summary>Windows</summary>\n\n```powershell\npowershell -c \"irm https://astral.sh/uv/install.ps1 | iex\"\n```\n</details>\n\nAfter installation, restart your terminal to ensure UV is in your PATH.\n\n### Installing via MCP Settings (Recommended)\n\nAdd this configuration to your MCP settings:\n\n```json\n{\n  \"mcpServers\": {\n    \"odoo\": {\n      \"command\": \"uvx\",\n      \"args\": [\"mcp-server-odoo\"],\n      \"env\": {\n        \"ODOO_URL\": \"https://your-odoo-instance.com\",\n        \"ODOO_API_KEY\": \"your-api-key-here\"\n      }\n    }\n  }\n}\n```\n\n<details>\n<summary>Claude Desktop</summary>\n\nAdd to `~/Library/Application Support/Claude/claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"odoo\": {\n      \"command\": \"uvx\",\n      \"args\": [\"mcp-server-odoo\"],\n      \"env\": {\n        \"ODOO_URL\": \"https://your-odoo-instance.com\",\n        \"ODOO_API_KEY\": \"your-api-key-here\",\n        \"ODOO_DB\": \"your-database-name\"\n      }\n    }\n  }\n}\n```\n</details>\n\n<details>\n<summary>Cursor</summary>\n\nAdd to `~/.cursor/mcp_settings.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"odoo\": {\n      \"command\": \"uvx\",\n      \"args\": [\"mcp-server-odoo\"],\n      \"env\": {\n        \"ODOO_URL\": \"https://your-odoo-instance.com\",\n        \"ODOO_API_KEY\": \"your-api-key-here\",\n        \"ODOO_DB\": \"your-database-name\"\n      }\n    }\n  }\n}\n```\n</details>\n\n<details>\n<summary>VS Code (with GitHub Copilot)</summary>\n\nAdd to your VS Code settings (`~/.vscode/mcp_settings.json` or workspace settings):\n\n```json\n{\n  \"github.copilot.chat.mcpServers\": {\n    \"odoo\": {\n      \"command\": \"uvx\",\n      \"args\": [\"mcp-server-odoo\"],\n      \"env\": {\n        \"ODOO_URL\": \"https://your-odoo-instance.com\",\n        \"ODOO_API_KEY\": \"your-api-key-here\",\n        \"ODOO_DB\": \"your-database-name\"\n      }\n    }\n  }\n}\n```\n</details>\n\n<details>\n<summary>Zed</summary>\n\nAdd to `~/.config/zed/settings.json`:\n\n```json\n{\n  \"context_servers\": {\n    \"odoo\": {\n      \"command\": \"uvx\",\n      \"args\": [\"mcp-server-odoo\"],\n      \"env\": {\n        \"ODOO_URL\": \"https://your-odoo-instance.com\",\n        \"ODOO_API_KEY\": \"your-api-key-here\",\n        \"ODOO_DB\": \"your-database-name\"\n      }\n    }\n  }\n}\n```\n</details>\n\n### Alternative Installation Methods\n\n<details>\n<summary>Using pip</summary>\n\n```bash\n# Install globally\npip install mcp-server-odoo\n\n# Or use pipx for isolated environment\npipx install mcp-server-odoo\n```\n\nThen use `mcp-server-odoo` as the command in your MCP configuration.\n</details>\n\n<details>\n<summary>From source</summary>\n\n```bash\ngit clone https://github.com/ivnvxd/mcp-server-odoo.git\ncd mcp-server-odoo\npip install -e .\n```\n\nThen use the full path to the package in your MCP configuration.\n</details>\n\n## Configuration\n\n### Environment Variables\n\nThe server requires the following environment variables:\n\n| Variable | Required | Description | Example |\n|----------|----------|-------------|---------|\n| `ODOO_URL` | Yes | Your Odoo instance URL | `https://mycompany.odoo.com` |\n| `ODOO_API_KEY` | Yes* | API key for authentication | `0ef5b399e9ee9c11b053dfb6eeba8de473c29fcd` |\n| `ODOO_USER` | Yes* | Username (if not using API key) | `admin` |\n| `ODOO_PASSWORD` | Yes* | Password (if not using API key) | `admin` |\n| `ODOO_DB` | No | Database name (auto-detected if not set) | `mycompany` |\n| `ODOO_YOLO` | No | YOLO mode - bypasses MCP security (\u26a0\ufe0f DEV ONLY) | `off`, `read`, `true` |\n\n*Either `ODOO_API_KEY` or both `ODOO_USER` and `ODOO_PASSWORD` are required.\n\n**Notes:**\n- If database listing is restricted on your server, you must specify `ODOO_DB`\n- API key authentication is recommended for better security\n\n### Transport Options\n\nThe server supports multiple transport protocols for different use cases:\n\n#### 1. **stdio** (Default)\nStandard input/output transport - used by desktop AI applications like Claude Desktop.\n\n```bash\n# Default transport - no additional configuration needed\nuvx mcp-server-odoo\n```\n\n#### 2. **streamable-http**\nStandard HTTP transport for REST API-style access and remote connectivity.\n\n```bash\n# Run with HTTP transport\nuvx mcp-server-odoo --transport streamable-http --host 0.0.0.0 --port 8000\n\n# Or use environment variables\nexport ODOO_MCP_TRANSPORT=streamable-http\nexport ODOO_MCP_HOST=0.0.0.0\nexport ODOO_MCP_PORT=8000\nuvx mcp-server-odoo\n```\n\nThe HTTP endpoint will be available at: `http://localhost:8000/mcp/`\n\n> **Note**: SSE (Server-Sent Events) transport has been deprecated in MCP protocol version 2025-03-26. Use streamable-http transport instead for HTTP-based communication. Requires MCP library v1.9.4 or higher for proper session management.\n\n#### Transport Configuration\n\n| Variable/Flag | Description | Default |\n|--------------|-------------|---------|\n| `ODOO_MCP_TRANSPORT` / `--transport` | Transport type: stdio, streamable-http | `stdio` |\n| `ODOO_MCP_HOST` / `--host` | Host to bind for HTTP transports | `localhost` |\n| `ODOO_MCP_PORT` / `--port` | Port to bind for HTTP transports | `8000` |\n\n<details>\n<summary>Running streamable-http transport for remote access</summary>\n\n```json\n{\n  \"mcpServers\": {\n    \"odoo-remote\": {\n      \"command\": \"uvx\",\n      \"args\": [\"mcp-server-odoo\", \"--transport\", \"streamable-http\", \"--port\", \"8080\"],\n      \"env\": {\n        \"ODOO_URL\": \"https://your-odoo-instance.com\",\n        \"ODOO_API_KEY\": \"your-api-key-here\",\n        \"ODOO_DB\": \"your-database-name\"\n      }\n    }\n  }\n}\n```\n</details>\n\n### Setting up Odoo\n\n1. **Install the MCP module**:\n   - Download the [mcp_server](https://apps.odoo.com/apps/modules/18.0/mcp_server) module\n   - Install it in your Odoo instance\n   - Navigate to Settings > MCP Server\n\n2. **Enable models for MCP access**:\n   - Go to Settings > MCP Server > Enabled Models\n   - Add models you want to access (e.g., res.partner, product.product)\n   - Configure permissions (read, write, create, delete) per model\n\n3. **Generate an API key**:\n   - Go to Settings > Users & Companies > Users\n   - Select your user\n   - Under the \"API Keys\" tab, create a new key\n   - Copy the key for your MCP configuration\n\n### YOLO Mode (Development/Testing Only) \u26a0\ufe0f\n\nYOLO mode allows the MCP server to connect directly to any standard Odoo instance **without requiring the MCP module**. This mode bypasses all MCP security controls and is intended **ONLY for development, testing, and demos**.\n\n**\ud83d\udea8 WARNING: Never use YOLO mode in production environments!**\n\n#### YOLO Mode Levels\n\n1. **Read-Only Mode** (`ODOO_YOLO=read`):\n   - Allows all read operations (search, read, count)\n   - Blocks all write operations (create, update, delete)\n   - Safe for demos and testing\n   - Shows \"READ-ONLY\" indicators in responses\n\n2. **Full Access Mode** (`ODOO_YOLO=true`):\n   - Allows ALL operations without restrictions\n   - Full CRUD access to all models\n   - **EXTREMELY DANGEROUS** - use only in isolated environments\n   - Shows \"FULL ACCESS\" warnings in responses\n\n#### YOLO Mode Configuration\n\n<details>\n<summary>Read-Only YOLO Mode (safer for demos)</summary>\n\n```json\n{\n  \"mcpServers\": {\n    \"odoo-demo\": {\n      \"command\": \"uvx\",\n      \"args\": [\"mcp-server-odoo\"],\n      \"env\": {\n        \"ODOO_URL\": \"http://localhost:8069\",\n        \"ODOO_USER\": \"admin\",\n        \"ODOO_PASSWORD\": \"admin\",\n        \"ODOO_DB\": \"demo\",\n        \"ODOO_YOLO\": \"read\"\n      }\n    }\n  }\n}\n```\n</details>\n\n<details>\n<summary>Full Access YOLO Mode (\u26a0\ufe0f use with extreme caution)</summary>\n\n```json\n{\n  \"mcpServers\": {\n    \"odoo-test\": {\n      \"command\": \"uvx\",\n      \"args\": [\"mcp-server-odoo\"],\n      \"env\": {\n        \"ODOO_URL\": \"http://localhost:8069\",\n        \"ODOO_USER\": \"admin\",\n        \"ODOO_PASSWORD\": \"admin\",\n        \"ODOO_DB\": \"test\",\n        \"ODOO_YOLO\": \"true\"\n      }\n    }\n  }\n}\n```\n</details>\n\n#### When to Use YOLO Mode\n\n\u2705 **Appropriate Uses:**\n- Local development with test data\n- Quick demos with non-sensitive data\n- Testing MCP clients before installing the MCP module\n- Prototyping in isolated environments\n\n\u274c **Never Use For:**\n- Production environments\n- Instances with real customer data\n- Shared development servers\n- Any environment with sensitive information\n\n#### YOLO Mode Security Notes\n\n- Connects directly to Odoo's standard XML-RPC endpoints\n- Bypasses all MCP access controls and model restrictions\n- No rate limiting is applied\n- All operations are logged but not restricted\n- Model listing shows 200+ models instead of just enabled ones\n\n## Usage Examples\n\nOnce configured, you can ask Claude:\n\n**Search & Retrieve:**\n- \"Show me all customers from Spain\"\n- \"Find products with stock below 10 units\"\n- \"List today's sales orders over $1000\"\n- \"Search for unpaid invoices from last month\"\n- \"Count how many active employees we have\"\n- \"Show me the contact information for Microsoft\"\n\n**Create & Manage:**\n- \"Create a new customer contact for Acme Corporation\"\n- \"Add a new product called 'Premium Widget' with price $99.99\"\n- \"Create a calendar event for tomorrow at 2 PM\"\n- \"Update the phone number for customer John Doe to +1-555-0123\"\n- \"Change the status of order SO/2024/001 to confirmed\"\n- \"Delete the test contact we created earlier\"\n\n## Available Tools\n\n### `search_records`\nSearch for records in any Odoo model with filters.\n\n```json\n{\n  \"model\": \"res.partner\",\n  \"domain\": [[\"is_company\", \"=\", true], [\"country_id.code\", \"=\", \"ES\"]],\n  \"fields\": [\"name\", \"email\", \"phone\"],\n  \"limit\": 10\n}\n```\n\n**Field Selection Options:**\n- Omit `fields` or set to `null`: Returns smart selection of common fields\n- Specify field list: Returns only those specific fields\n- Use `[\"__all__\"]`: Returns all fields (use with caution)\n\n### `get_record`\nRetrieve a specific record by ID.\n\n```json\n{\n  \"model\": \"res.partner\",\n  \"record_id\": 42,\n  \"fields\": [\"name\", \"email\", \"street\", \"city\"]\n}\n```\n\n**Field Selection Options:**\n- Omit `fields` or set to `null`: Returns smart selection of common fields with metadata\n- Specify field list: Returns only those specific fields\n- Use `[\"__all__\"]`: Returns all fields without metadata\n\n### `list_models`\nList all models enabled for MCP access.\n\n```json\n{}\n```\n\n### `create_record`\nCreate a new record in Odoo.\n\n```json\n{\n  \"model\": \"res.partner\",\n  \"values\": {\n    \"name\": \"New Customer\",\n    \"email\": \"customer@example.com\",\n    \"is_company\": true\n  }\n}\n```\n\n### `update_record`\nUpdate an existing record.\n\n```json\n{\n  \"model\": \"res.partner\",\n  \"record_id\": 42,\n  \"values\": {\n    \"phone\": \"+1234567890\",\n    \"website\": \"https://example.com\"\n  }\n}\n```\n\n### `delete_record`\nDelete a record from Odoo.\n\n```json\n{\n  \"model\": \"res.partner\",\n  \"record_id\": 42\n}\n```\n\n## Resources\n\nThe server also provides direct access to Odoo data through resource URIs:\n\n- `odoo://res.partner/record/1` - Get partner with ID 1\n- `odoo://product.product/search?domain=[[\"qty_available\",\">\",0]]` - Search products in stock\n- `odoo://sale.order/browse?ids=1,2,3` - Browse multiple sales orders\n- `odoo://res.partner/count?domain=[[\"customer_rank\",\">\",0]]` - Count customers\n- `odoo://product.product/fields` - List available fields for products\n\n## Security\n\n- Always use HTTPS in production environments\n- Keep your API keys secure and rotate them regularly\n- Configure model access carefully - only enable necessary models\n- The MCP module respects Odoo's built-in access rights and record rules\n- Each API key is linked to a specific user with their permissions\n\n## Troubleshooting\n\n<details>\n<summary>Connection Issues</summary>\n\nIf you're getting connection errors:\n1. Verify your Odoo URL is correct and accessible\n2. Check that the MCP module is installed: visit `https://your-odoo.com/mcp/health`\n3. Ensure your firewall allows connections to Odoo\n</details>\n\n<details>\n<summary>Authentication Errors</summary>\n\nIf authentication fails:\n1. Verify your API key is active in Odoo\n2. Check that the user has appropriate permissions\n3. Try regenerating the API key\n4. For username/password auth, ensure 2FA is not enabled\n</details>\n\n<details>\n<summary>Model Access Errors</summary>\n\nIf you can't access certain models:\n1. Go to Settings > MCP Server > Enabled Models in Odoo\n2. Ensure the model is in the list and has appropriate permissions\n3. Check that your user has access to that model in Odoo's security settings\n</details>\n\n<details>\n<summary>\"spawn uvx ENOENT\" Error</summary>\n\nThis error means UV is not installed or not in your PATH:\n\n**Solution 1: Install UV** (see Installation section above)\n\n**Solution 2: macOS PATH Issue**\nClaude Desktop on macOS doesn't inherit your shell's PATH. Try:\n1. Quit Claude Desktop completely (Cmd+Q)\n2. Open Terminal\n3. Launch Claude from Terminal:\n   ```bash\n   open -a \"Claude\"\n   ```\n\n**Solution 3: Use Full Path**\nFind UV location and use full path:\n```bash\nwhich uvx\n# Example output: /Users/yourname/.local/bin/uvx\n```\n\nThen update your config:\n```json\n{\n  \"command\": \"/Users/yourname/.local/bin/uvx\",\n  \"args\": [\"mcp-server-odoo\"]\n}\n```\n</details>\n\n<details>\n<summary>Database Configuration Issues</summary>\n\nIf you see \"Access Denied\" when listing databases:\n- This is normal - some Odoo instances restrict database listing for security\n- Make sure to specify `ODOO_DB` in your configuration\n- The server will use your specified database without validation\n\nExample configuration:\n```json\n{\n  \"env\": {\n    \"ODOO_URL\": \"https://your-odoo.com\",\n    \"ODOO_API_KEY\": \"your-key\",\n    \"ODOO_DB\": \"your-database-name\"\n  }\n}\n```\nNote: `ODOO_DB` is required if database listing is restricted on your server.\n</details>\n\n<details>\n<summary>\"SSL: CERTIFICATE_VERIFY_FAILED\" Error</summary>\n\nThis error occurs when Python cannot verify SSL certificates, often on macOS or corporate networks.\n\n**Solution**: Add SSL certificate path to your environment configuration:\n\n```json\n{\n  \"env\": {\n    \"ODOO_URL\": \"https://your-odoo.com\",\n    \"ODOO_API_KEY\": \"your-key\",\n    \"SSL_CERT_FILE\": \"/etc/ssl/cert.pem\"\n  }\n}\n```\n\nThis tells Python where to find the system's SSL certificate bundle for HTTPS connections. The path `/etc/ssl/cert.pem` is the standard location on most systems.\n</details>\n\n<details>\n<summary>Debug Mode</summary>\n\nEnable debug logging for more information:\n\n```json\n{\n  \"env\": {\n    \"ODOO_URL\": \"https://your-odoo.com\",\n    \"ODOO_API_KEY\": \"your-key\",\n    \"ODOO_MCP_LOG_LEVEL\": \"DEBUG\"\n  }\n}\n```\n</details>\n\n## Development\n\n<details>\n<summary>Running from source</summary>\n\n```bash\n# Clone the repository\ngit clone https://github.com/ivnvxd/mcp-server-odoo.git\ncd mcp-server-odoo\n\n# Install in development mode\npip install -e \".[dev]\"\n\n# Run tests\npytest --cov\n\n# Run the server\npython -m mcp_server_odoo\n```\n</details>\n\n<details>\n<summary>Testing with MCP Inspector</summary>\n\n```bash\n# Using uvx\nnpx @modelcontextprotocol/inspector uvx mcp-server-odoo\n\n# Using local installation\nnpx @modelcontextprotocol/inspector python -m mcp_server_odoo\n```\n</details>\n\n## Testing\n\n### Transport Tests\n\nYou can test both stdio and streamable-http transports to ensure they're working correctly:\n\n```bash\n# Run comprehensive transport tests\npython tests/run_transport_tests.py\n```\n\nThis will test:\n- **stdio transport**: Basic initialization and communication\n- **streamable-http transport**: HTTP endpoint, session management, and tool calls\n\n### Unit Tests\n\nFor complete testing including unit and integration tests:\n\n```bash\n# Run all tests\nuv run pytest --cov\n\n# Run specific test categories\nuv run pytest tests/test_tools.py -v\nuv run pytest tests/test_server_foundation.py -v\n```\n\n## License\n\nThis project is licensed under the Mozilla Public License 2.0 (MPL-2.0) - see the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nContributions are very welcome! Please see the [CONTRIBUTING](CONTRIBUTING.md) guide for details.\n\n## Support\n\nThank you for using this project! If you find it helpful and would like to support my work, kindly consider buying me a coffee. Your support is greatly appreciated!\n\n<a href=\"https://www.buymeacoffee.com/ivnvxd\" target=\"_blank\"><img src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" style=\"height: 60px !important;width: 217px !important;\" ></a>\n\nAnd do not forget to give the project a star if you like it! :star:",
    "bugtrack_url": null,
    "license": "MPL-2.0",
    "summary": "A Model Context Protocol server for Odoo ERP systems",
    "version": "0.3.0",
    "project_urls": {
        "Changelog": "https://github.com/ivnvxd/mcp-server-odoo/releases",
        "Documentation": "https://github.com/ivnvxd/mcp-server-odoo#readme",
        "Homepage": "https://github.com/ivnvxd/mcp-server-odoo",
        "Issues": "https://github.com/ivnvxd/mcp-server-odoo/issues",
        "Repository": "https://github.com/ivnvxd/mcp-server-odoo"
    },
    "split_keywords": [
        "ai",
        " anthropic",
        " claude",
        " erp",
        " llm",
        " mcp",
        " model-context-protocol",
        " odoo"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ffd62fb90761b2eef8fe2671e0567b8cfdc2e9ebeb3138590242e3a29011ea4c",
                "md5": "110359a5798bfa68f2c9f3e263850acb",
                "sha256": "35f0caf3cd325326b05e99efe33ecdf0fe27f060719655d115ca36a95931cb73"
            },
            "downloads": -1,
            "filename": "mcp_server_odoo-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "110359a5798bfa68f2c9f3e263850acb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 71730,
            "upload_time": "2025-09-14T19:54:40",
            "upload_time_iso_8601": "2025-09-14T19:54:40.349250Z",
            "url": "https://files.pythonhosted.org/packages/ff/d6/2fb90761b2eef8fe2671e0567b8cfdc2e9ebeb3138590242e3a29011ea4c/mcp_server_odoo-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b4068de4c46cd7599c5352c202bf9503d144bc44790ab10b0857b28074985869",
                "md5": "0d120d5e203c80363c15235a8e4f7290",
                "sha256": "cb2de683911a2884069b5d89b8d507b5096f5212bf30c219ae759ec21385f264"
            },
            "downloads": -1,
            "filename": "mcp_server_odoo-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0d120d5e203c80363c15235a8e4f7290",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 192519,
            "upload_time": "2025-09-14T19:54:41",
            "upload_time_iso_8601": "2025-09-14T19:54:41.931695Z",
            "url": "https://files.pythonhosted.org/packages/b4/06/8de4c46cd7599c5352c202bf9503d144bc44790ab10b0857b28074985869/mcp_server_odoo-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-14 19:54:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ivnvxd",
    "github_project": "mcp-server-odoo",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "mcp-server-odoo"
}
        
Elapsed time: 1.24321s