Odoo CRM MCP Server

Odoo CRM MCP Server

Enables AI agents to query and interact with Odoo CRM data via MCP, supporting sales pipeline analysis, customer risk assessment, meeting preparation, and executive reporting, with human approval for write actions.

Category
访问服务器

README

Agentic CRM — Odoo + Microsoft Foundry

From CRM insight to autonomous action. A working demo showing an AI agent read live CRM data, reason across multiple signals, and take approved actions — built on a self-hosted Odoo backend and a pro-code agent on Microsoft Foundry.


What this is

Most "agentic CRM" demos are either a chatbot bolted onto static screenshots, or a low-code assistant that can't explain its own reasoning. This project is neither: it's a real Odoo CRM instance, seeded with a coherent fictional dataset, exposed to a hosted Foundry agent through a custom-built MCP server — so every answer the agent gives is grounded in an actual queryable record, not a hallucinated summary.

The fictional premise: Meridian Fleet Technologies sells fleet telematics, cold-chain monitoring, and supply-chain SaaS/hardware to logistics, retail-distribution, and manufacturing customers. Every account, product, and support case in the demo dataset is written to be plausible within that business.


Architecture

flowchart LR
    A[Foundry Agent] -->|MCP tool calls over HTTPS| B[Cloudflare Tunnel]
    B --> C[MCP Server<br/>Python / FastMCP]
    C -->|XML-RPC| D[(Odoo CRM<br/>+ PostgreSQL)]
  • Odoo CRM — the business system of record. Self-hosted Community Edition via Docker, chosen deliberately over SaaS trials to keep unrestricted External API access.
  • MCP server — a Python service that translates Model Context Protocol tool calls into Odoo XML-RPC calls, and back into readable results. Runs on Streamable HTTP so a hosted agent can call it directly.
  • Cloudflare Tunnel — exposes the local MCP server over a public HTTPS URL without opening any inbound ports.
  • Microsoft Foundry Agent Service — hosts the actual agent: grounds responses in CRM context, calls the MCP tools, and enforces human approval before any write action.

Tech stack

Layer Technology
CRM backend Odoo 19 Community, PostgreSQL 16, Docker Compose
Data/tool layer Custom MCP server (Python, FastMCP SDK) over Odoo's XML-RPC API
Tunneling Cloudflare Tunnel (cloudflared)
Agent layer Microsoft Foundry Agent Service — hosted agent
Cases model Odoo Project app (Community-compatible substitute for the Enterprise-only Helpdesk app)

Agent scenarios

Scenario Question it answers Key tool(s)
Sales Pipeline Agent "Which deals are likely to slip this month?" find_stalled_opportunities, create_followup_task
Customer Risk Agent "Which customers need attention today? Why?" list_accounts_needing_attention, explain_account_risk, escalate_case
Meeting Prep Agent "Prepare me for my call with this account." prepare_meeting_brief
Executive Reporting Agent "Give me this week's customer and pipeline health." get_weekly_executive_summary

Two tools (create_followup_task, escalate_case) write to Odoo. Every other tool is read-only. Write actions are designed to be gated behind explicit human approval in the agent's instructions — the agent explains and recommends first, and only acts once approved.


Repository structure

.
├── docker-compose.yml               # Odoo + PostgreSQL services
├── addons/                          # Odoo custom addons mount point
├── seed_demo_data.py                # Seeds Odoo with the demo dataset
├── odoo_mcp_foundry_connector.py    # MCP server exposing 7 tools over XML-RPC (the one Foundry connects to)
├── testing-connection.py            # Standalone XML-RPC auth sanity check
├── .env.example                     # Template for required environment variables — copy to .env, never commit .env
├── .gitignore
├── pyproject.toml / uv.lock         # Python dependency management (uv)
├── .python-version
├── command.md                       # Command reference
├── restore_database.md              # Snapshot/restore instructions
├── Tunnel-cheat-sheet.md            # Full command-by-command tunnel reference
└── README.md

Note: this repo previously carried two other MCP server drafts (mcp-server.py, odoo-mcp-server.py) from earlier iterations. Only odoo_mcp_foundry_connector.py is live — the other two should be deleted before this goes public, since leftover near-duplicate files read as unfinished work to anyone reviewing the repo. backup.dump and hero_reference.json are environment-specific/generated output and should not be tracked in git — see Security below.


Getting started

Three processes need to run at once: Odoo, the MCP server, and a tunnel.

1. Start Odoo

docker compose up -d

Then install the CRM, Contacts, Project, and Sales apps from the Odoo Apps screen.

2. Seed the demo data

python seed_demo_data.py

Creates 20 products, 6 hand-crafted "hero" accounts (each engineered to demonstrate one scenario above), and ~44 additional accounts with contacts, opportunities, activities, and cases. Record IDs for the hero accounts are saved to hero_reference.json.

3. Run the MCP server

export ODOO_URL="http://localhost:8069"
export ODOO_DB="your-db-name"
export ODOO_USERNAME="agent@demo.local"
export ODOO_PASSWORD="your-agent-password"
export MCP_HOST="0.0.0.0"
export MCP_PORT="8000"

uv run python odoo_mcp_foundry_connector.py --http

Use a dedicated least-privilege Odoo user for ODOO_USERNAME — not the admin account.

4. Expose it and connect Foundry

cloudflared tunnel --url http://localhost:8000

Register the printed URL (with /mcp appended) as an MCP Toolbox in your Foundry project.

For a full command-by-command reference, see Tunnel-cheat-sheet.md. For database snapshot/restore, see restore_database.md.


Demo flow

  1. Open the Odoo CRM dashboard — signals come from a real business app.
  2. Ask the agent: "Which accounts need attention today?" — retrieval and prioritization over live records.
  3. Ask: "Why is this account risky?" — multi-factor reasoning across opportunities, cases, and activity history.
  4. Ask: "Draft a follow-up email." — content generation grounded in account context.
  5. Approve task creation — human-in-the-loop write action.
  6. Trigger an escalation — event-driven automation path.

Security

This repo previously had real credentials exposed in tracked files — if you're forking or referencing this project, note the pattern below rather than the mistake:

  • Never commit .env. All credentials are read from environment variables (ODOO_URL, ODOO_DB, ODOO_USERNAME, ODOO_PASSWORD) — see .env.example for the required keys. Both scripts refuse to run with a clear error if required variables are missing, rather than falling back to a hardcoded default.
  • hero_reference.json and backup.dump are environment-specific generated output, not source code — they're gitignored and should never be tracked. If either is currently committed in your history, remove them with git rm --cached hero_reference.json backup.dump and commit that removal.
  • If credentials were ever committed and pushed (even briefly, even in an old commit), rotate them immediately in Odoo — deleting the file afterward does not remove it from git history. Scrubbing history (git filter-repo or the BFG Repo-Cleaner) is the correct fix if the repo needs to stay public and keep its commit history; for a solo demo repo, deleting and recreating it clean is often simpler.
  • Least privilege: the MCP server authenticates as a scoped demo Odoo user (agent@demo.local in this project), not admin — see Odoo_Setup_and_Demo_Data_Guide for how that user was created with restricted access rights.
  • Fictional data only — no real customer or personal information anywhere in the dataset.
  • Read/write separation — 5 of the 7 MCP tools are strictly read-only; the two write tools (create_followup_task, escalate_case) are designed to sit behind explicit human approval in the agent's instructions, not to be called freely.

Status

Phase Status
Odoo CRM foundation + demo data ✅ Complete
MCP server + tunnel exposure ✅ Complete
Foundry agent creation ✅ Complete
Automation (scheduled runs, notifications) ⬜ Planned
Observability & demo polish ⬜ Planned

License

This is a demo/portfolio project using entirely fictional data. Not affiliated with or endorsed by Odoo S.A. or Microsoft.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选