Skip to main content
Glama
aljon-zb

peltierpro-mcp

by aljon-zb

Claude–Odoo 19 OAuth 只读 MCP 连接器

支持 OAuth 的只读 Odoo 19 MCP 连接器。

Claude
  -> OAuth 2.1 access token
  -> Python MCP Resource Server
  -> Odoo JSON-2 API

重要架构

Python 服务是一个 OAuth 资源服务器。它验证由外部 OAuth/OIDC 授权服务器(如 Microsoft Entra ID、Auth0、Okta 或其他兼容身份提供者)颁发的 bearer 令牌。

Odoo API 密钥仅保留在 Python 连接器服务器上。

Related MCP server: MCP Server for Odoo

Odoo 工具

  • test_odoo_connection

  • search_crm_opportunities

  • get_crm_opportunity

  • search_sales_orders

  • get_sales_order

  • search_products

  • get_stock_by_location

  • search_inventory_transfers

不包含任何 Odoo 创建/更新/删除/确认/验证/取消工具。

在 Windows 上安装

py -m venv .venv
.venv\Scripts\Activate.ps1
pip install -r requirements.txt
Copy-Item .env.example .env

首次本地测试

保留:

AUTH_ENABLED=false
TRANSPORT=streamable-http
HOST=0.0.0.0
PORT=8000

运行:

python test_connection.py
python -m unittest discover -s tests
python -m app.server

然后使用 MCP Inspector 测试 http://127.0.0.1:8000/mcp。

OAuth 配置

在客户端的身份提供者处注册 API/资源和 OAuth 客户端。该提供者必须颁发包含以下内容的 JWT 访问令牌:

  • iss 与 AUTH_ISSUER_URL 匹配

  • aud 与 AUTH_AUDIENCE 匹配

  • exp

  • 必需的 scope,默认为 odoo.read

然后配置:

AUTH_ENABLED=true
AUTH_ISSUER_URL=https://auth.example.com
AUTH_RESOURCE_SERVER_URL=https://YOUR_PUBLIC_HOST/mcp
AUTH_JWKS_URL=https://auth.example.com/.well-known/jwks.json
AUTH_AUDIENCE=https://YOUR_PUBLIC_HOST/mcp
AUTH_REQUIRED_SCOPES=odoo.read
AUTH_ALGORITHMS=RS256

重启:

python -m app.server

MCP SDK 将发布受保护资源元数据,Claude 用于 OAuth 发现。授权服务器本身保持外部。

Claude

添加:

https://YOUR_PUBLIC_HOST/mcp

如果身份提供者不支持动态客户端注册,请在 Claude 连接器高级设置中添加 OAuth 客户端 ID 和客户端密钥。

然后每个授权的 Claude 用户点击"连接",通过配置的身份提供者登录。

开发隧道

公共 VS Code 开发隧道可临时用于测试环境。如果其 URL 发生变化,请更新 AUTH_RESOURCE_SERVER_URL,通常还需要更新 AUTH_AUDIENCE。

请勿在可公开访问的持久 MCP 部署中将 AUTH_ENABLED 设置为 false。

peltierpro-mcp

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    This read-only MCP Server allows you to connect to Odoo data from Claude Desktop through CData JDBC Drivers. For full CRUD support, check out the first managed MCP platform: CData Connect AI (https://www.cdata.com/ai/).
    2
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    An MCP server that enables AI assistants like Claude to interact with Odoo ERP systems through natural language, allowing users to search, create, update, and manage business data in their Odoo instance.
    1,543 PyPI
    397
    Mozilla Public 2.0
  • A
    license
    B
    quality
    D
    maintenance
    An MCP server that enables AI assistants to interact with Odoo ERP apps like Inventory, CRM, Sales, and Manufacturing. It allows users to read, create, and manage Odoo records and workflows using natural language commands.
    25
    13 npm
    1
    ISC
  • A
    license
    Not graded
    quality
    D
    maintenance
    A read-only MCP server that enables AI assistants to query Odoo instances via XML-RPC, supporting search, read, count, and field inspection without requiring custom modules.
    97 PyPI
    1
    Mozilla Public 2.0