Skip to main content
Glama

Odoo MCP server for OpenCode

本工作区附带一个本地 stdio MCP 服务器odoo_mcp),它将你自托管的 Odoo 项目任务、讨论记录(chatter)和工时记录以九个类型化工具的形式暴露出来,供 agent(智能体)直接调用。同一仓库仍保留原始的 odoo_tasks.py CLI——行为不变——它与 MCP 服务器共享服务层。

前置条件

  • Python 3.10+(工作区基于 3.12 开发)

  • uv 已在 PATH 中(如缺失,执行 pip install uv

一次性安装全部依赖:

uv sync

Related MCP server: MCP Server for Odoo

凭据(环境变量)

变量

用途

默认值

ODOO_URL

Odoo 实例的基础 URL

https://odoo.geosigmoid.group

ODOO_DB

数据库名

odoo

ODOO_USERNAME

你的登录邮箱

必填

ODOO_PASSWORD

密码或外部 API 密钥

必填

ODOO_URL 必须是绝对 HTTPS URL,确保凭据绝不会通过明文 HTTP 传输。

强烈建议使用 API 密钥而不是密码(Odoo:首选项 → 账户安全 → 新建 API 密钥):它可以被撤销,且不能用于网页登录。将 .env.example 复制为 .env,填写内容,再加载到你的 shell 中,或者按照你管理密钥的方式设置这些变量。当工作区根目录存在 .env 时,MCP 服务器和 CLI 辅助工具都会自动加载它;已经由 OpenCode 或 shell 设置的环境变量优先。切勿提交 .env

插值注意事项: opencode.json 使用 {env:VAR} 占位符。如果某个变量在 OpenCode 启动时缺失,它会变成空字符串,然后每次工具调用都会以清晰的错误信息失败,指出缺失的变量(Missing required environment variables: ODOO_USERNAME, ...),而不是把错误的凭据发往任何地方。任何值都不会被回显到日志或结果中。

如何向 OpenCode 注册

本工作区的 opencode.json 已经包含:

{
  "mcp": {
    "odoo": {
      "type": "local",
      "command": ["uv", "run", "python", "-m", "odoo_mcp"],
      "environment": { "...": "{env:ODOO_*} placeholders" },
      "enabled": true
    }
  }
}

OpenCode 在启动时加载配置——在修改凭据或此文件之后,退出并重启 OpenCode 即可使其生效。服务器只在每次会话中通过 stdio 生成一次;没有任何网络端口在监听。

工具

修改类工具默认立即执行;其中每个工具都可接受 dry_run=true 标志,该标志会先返回预览而不写入任何内容。

工具

功能说明

list_my_tasks

分配给你的任务;可按项目、阶段、状态、截止日期过滤

get_task

单个任务的完整详情(包含计划/记录的工时)

update_task

设置名称/描述/优先级/截止日期/工时/状态/阶段;append_description 将文本合并到现有描述

post_task_message

发布到任务的讨论记录(chatter)中(关注者会收到通知)

get_task_states

该服务器上有效的工作流状态码 + 哪些是终态

list_stages

任务阶段 的 ID/名称,用于过滤

list_timesheets

你的工时记录;可按任务或最近的天数过滤

create_timesheet

在任务上记录工时时(日期默认为今天)

update_timesheet

修改某条记录的工时/日期/描述/任务

状态码因 Odoo 构建版本而异——先调用 get_task_states 而不是猜测;无效状态会被拒绝并附带有有效状态码,再返回安全使用。

验证安装

uv sync                                              # deps resolve
uv run pytest tests -q                               # protocol + service suites
uv run python -m unittest discover -s tests -v       # CLI characterization suite
uv run python odoo_tasks.py --help                   # legacy CLI still intact

stdio 握手过程本身由 tests/test_stdio_smoke.py 覆盖。

Install Server
F
license - not found
A
quality
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants to interact with Odoo ERP systems through natural language, allowing users to search, create, update, and manage business records like customers, products, and invoices across any Odoo instance.
    1
    Mozilla Public 2.0
  • A
    license
    A
    quality
    B
    maintenance
    Enables AI agents to interact with Odoo ERP as the authenticated user, with tools for discovery, planning, and mutations bounded by user permissions.
    34
    37
    2
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    Enables ChatGPT to interact with Odoo by providing tools for repository management, git operations, Odoo.sh management, Odoo RPC, browser screenshots, and approval workflows.

View all related MCP servers

Related MCP Connectors

  • Odoo ERP for AI agents: hosted OAuth endpoint, gated writes, one endpoint for every instance.

  • Task manager your agent can fully operate: boards, tasks, sprints, roles, worklogs, day planner.

  • Manage projects, tasks, time tracking, and team collaboration through natural language.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hazem-gs/odoo-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server