Odoo MCP Unified Server

Odoo MCP Unified Server

Enables interaction with Odoo ERP systems through 17+ business tools covering sales, purchasing, inventory, and accounting operations. Supports both Claude Desktop integration and web deployment with dual transport modes.

Category
访问服务器

README

Odoo MCP Unified Server 🚀

Unified Odoo Model Context Protocol (MCP) Server with dual transport support (stdio + SSE), enhanced business tools, and type-safe configuration management.

✨ Features

🔌 Dual Transport Support

  • stdio: For Claude Desktop integration
  • SSE: For web deployment (Zeabur, Railway, etc.) - No Supergateway needed!

🛠️ Complete Tool Set (17+ Tools)

Core Tools (3)

  • execute_method - Execute any Odoo method (most powerful)
  • search_employee - Search for employees
  • search_holidays - Search for holidays/time-off

Sales Tools (3)

  • search_sales_orders - Search sales orders
  • create_sales_order - Create new sales order
  • analyze_sales_performance - Analyze sales performance with trends

Purchase Tools (3)

  • search_purchase_orders - Search purchase orders
  • create_purchase_order - Create new purchase order
  • analyze_supplier_performance - Analyze supplier on-time delivery

Inventory Tools (2)

  • get_stock_levels - Get current stock levels
  • predict_stock_needs - Predict future stock needs

Accounting Tools (2)

  • get_financial_summary - Get financial overview
  • analyze_receivables - Analyze accounts receivable

📦 Resources (4)

  • odoo://models - List all available models
  • odoo://model/{model_name} - Get model information
  • odoo://record/{model_name}/{record_id} - Get specific record
  • odoo://search/{model_name}/{domain} - Search records

⚙️ Configuration Management

  • Type-safe configuration with Pydantic
  • Support for environment variables and JSON config
  • Validation on startup

🚀 Quick Start

For Claude Desktop (stdio mode)

  1. Install
cd E:\gitHub\odoo-mcp-unified
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
pip install -e .
  1. Configure - Add to Claude Desktop config (%APPDATA%\Claude\claude_desktop_config.json):
{
  "mcpServers": {
    "odoo-unified": {
      "command": "E:\\gitHub\\odoo-mcp-unified\\venv\\Scripts\\python.exe",
      "args": ["E:\\gitHub\\odoo-mcp-unified\\run_server.py"],
      "env": {
        "ODOO_URL": "https://alpha-goods-corporation.odoo.com",
        "ODOO_DB": "alpha-goods-corporation",
        "ODOO_USERNAME": "your-username",
        "ODOO_PASSWORD": "your-password",
        "MCP_TRANSPORT": "stdio"
      }
    }
  }
}
  1. Restart Claude Desktop

For Zeabur Deployment (SSE mode)

  1. Connect GitHub repo to Zeabur

  2. Set environment variables:

ODOO_URL=https://your-company.odoo.com
ODOO_DB=your-database
ODOO_USERNAME=your-username
ODOO_PASSWORD=your-password
MCP_TRANSPORT=sse
PORT=8000
  1. Deploy - Zeabur will automatically:
    • Build using Dockerfile
    • Expose SSE endpoint at /sse
    • No Supergateway needed!

📋 Environment Variables

Required

  • ODOO_URL - Odoo instance URL
  • ODOO_DB - Database name
  • ODOO_USERNAME - Username
  • ODOO_PASSWORD - Password

Optional

  • MCP_TRANSPORT - Transport mode: stdio or sse (default: stdio)
  • ODOO_TIMEOUT - Request timeout in seconds (default: 60)
  • ODOO_VERIFY_SSL - Verify SSL certificates (default: false)
  • PORT - Server port for SSE mode (default: 8000)
  • HOST - Server host for SSE mode (default: 0.0.0.0)
  • LOG_LEVEL - Logging level (default: INFO)

📖 Usage Examples

Execute Any Odoo Method

# Get product.product records
execute_method(
    model="product.product",
    method="search_read",
    args=[],
    kwargs={"fields": ["name", "list_price"], "limit": 10}
)

Analyze Sales Performance

analyze_sales_performance(
    params={
        "start_date": "2024-01-01",
        "end_date": "2024-12-31",
        "group_by": "month"
    }
)

Check Supplier Performance

analyze_supplier_performance(
    params={
        "supplier_id": 123,
        "start_date": "2024-01-01",
        "end_date": "2024-12-31"
    }
)

🏗️ Project Structure

odoo-mcp-unified/
├── src/odoo_mcp/
│   ├── __init__.py
│   ├── __main__.py
│   ├── server.py              # Main MCP server
│   ├── config.py              # 🆕 Configuration management
│   ├── odoo_client.py         # Odoo XML-RPC client
│   ├── extensions.py          # Extension registration
│   ├── models.py              # Pydantic models
│   ├── prompts.py             # MCP prompts
│   ├── resources.py           # MCP resources
│   ├── tools_sales.py         # Sales tools
│   ├── tools_purchase.py      # Purchase tools
│   ├── tools_inventory.py     # Inventory tools
│   └── tools_accounting.py    # Accounting tools
├── run_server.py              # 🆕 Unified server runner (stdio + SSE)
├── requirements.txt           # Fixed FastMCP version
├── pyproject.toml
├── Dockerfile                 # 🆕 Zeabur-ready
└── README.md

🔧 Development

Run Tests

pytest tests/

Run Server Locally (stdio)

export ODOO_URL=https://your-company.odoo.com
export ODOO_DB=your-database
export ODOO_USERNAME=your-username
export ODOO_PASSWORD=your-password
python run_server.py

Run Server Locally (SSE)

export MCP_TRANSPORT=sse
export PORT=8000
python run_server.py
# Access: http://localhost:8000/sse

🐛 Troubleshooting

✅ Using Latest Stable Versions

This project uses the latest stable versions of FastMCP (>=0.7.0) and MCP (>=1.0.0):

  • Modern FastMCP API without deprecated parameters
  • Enhanced performance and stability
  • Latest features and improvements

SSL Certificate Error

If you see SSL errors:

export ODOO_VERIFY_SSL=false

Connection Timeout

Increase timeout:

export ODOO_TIMEOUT=120

📦 What's New in v2.0

🆕 Compared to odoo-mcp-improved

  • ✅ SSE Transport support (Zeabur deployment without Supergateway)
  • ✅ Unified config.py module (type-safe configuration)
  • ✅ Dual transport mode in single codebase
  • ✅ Enhanced documentation

🆕 Compared to mcp-odoo

  • ✅ All basic features (execute_method, resources)
  • ✅ 12+ additional business tools
  • ✅ Extension system
  • ✅ SSE support
  • ✅ Better error handling

📄 License

MIT License

🤝 Contributing

Contributions welcome! Please open an issue or PR.

🔗 Links


Made with ❤️ for Alpha Goods Corporation

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选