mcp-dolibarr
🚀 mcp-dolibarr
基于 FastMCP 的高性能、安全的 MCP(Model Context Protocol)服务器,允许任何 AI 助手(Claude Desktop、Cursor、AI Agents)通过其官方 REST API 与 Dolibarr ERP/CRM 进行原生交互。
✨ 主要功能
MCP 服务器通过分布在 12 个模块中的 30 多个专用工具 覆盖 Dolibarr 上的所有企业管理需求:
🏢 客户与公司 (
tools/thirdparties.py):按名称进行列表、全文搜索,按 ID 详细查看,创建和部分更新客户/潜在客户档案。👤 联系人 (
tools/contacts.py):列出和创建与公司关联的联系人(自然人)。📦 产品与服务 (
tools/products.py):完整的商品和服务目录,按参考号搜索,创建、更新以及管理不含税价格 / 增值税税率。📄 报价单与商业建议 (
tools/proposals.py):创建多行报价单,验证,更新/删除行以及自动转换。🛒 客户订单 (
tools/orders.py):从已验证的报价单生成订单,查看和精细修改订单行。💳 发票与付款 (
tools/invoices.py):从订单或直接创建发票,最终验证以及管理发票行。📊 按仓库的库存 (
tools/stocks.py):按仓库即时查看产品的实际库存水平。📁 项目 (
tools/projects.py):创建、查看项目并将其关联到客户档案。📜 合同 (
tools/contracts.py):跟踪服务合同并为第三方创建合同。🛠️ 干预单 (
tools/interventions.py):管理现场技术干预单。📑 文档与 PDF (
tools/documents.py):自动生成官方 PDF(Azur、Crabe 等模板)并下载 Base64 编码内容。🔌 直接 REST API(备用模式) (
tools/raw.py):call_dolibarr_api工具允许直接查询 Dolibarr 的任何未被专用工具覆盖的 REST 路由。
Related MCP server: MCP Server for Odoo
🌟 与其他 MCP 服务器相比,mcp-dolibarr 的额外优势
与基础或通用的 MCP 网关不同,该服务器带来了决定性的附加值:
🔄 单次调用的复杂编排(
convert_proposal_to_invoice):该编排工具不会强制 AI 连续执行 4 次手动请求,而是自动串联:已验证的报价单 $\rightarrow$ 客户订单 $\rightarrow$ 发票 $\rightarrow$ 发票验证。✏️ 细粒度行操作(添加 / 更新 / 删除):完全支持对报价单、订单和发票进行逐行管理(添加商品、修改数量/价格/标签、删除行)。
🛡️ 原生安全 / 只读模式(
READ_ONLY=true):可以将服务器限制为仅查看,适用于敏感的生产环境。所有写请求(POST、PUT、DELETE)都会被拦截并在源头拒绝。🔁 弹性和指数退避(HTTP 429):智能管理 Dolibarr API 的速率限制:在过载时自动重试并延迟(1 秒、2 秒、4 秒),而不会导致 AI 代理失败。
🎯 针对 LLM 优化的清理和格式化:
Dolibarr 的原始 JSON 响应(通常包含 50 多个无用的内部字段)会被清理并总结为清晰可读的文本。
上游严格验证(电子邮件、正数金额、必填字段),以避免向 Dolibarr 发送格式错误的请求。
📄 实际生成和提取 PDF 文件:允许命令生成法规 PDF,并获取其 Base64 编码内容供 AI 代理使用。
🌐 原生多传输(
stdio、http、sse、streamable-http):既可在本地计算机(Claude Desktop、Cursor)上运行,也可作为云服务器上的容器化微服务运行。
🏃 如何启动和运行 MCP 服务器(Run)
1. 准备本地环境
# 1. Créer l'environnement virtuel Python
python -m venv .venv
# 2. Activer l'environnement
# Linux / macOS / Git Bash :
source .venv/bin/activate
# Windows PowerShell :
# .venv\Scripts\Activate.ps1
# 3. Installer les dépendances
pip install -r requirements.txt
# 4. Configurer le fichier de variables d'environnement
cp .env.example .env在 .env 文件中,配置对您的 Dolibarr 实例的访问:
DOLIBARR_URL=http://localhost:8080/api/index.php
DOLIBARR_API_KEY=votre_cle_api_dolibarr
MCP_TRANSPORT=stdio
LOG_LEVEL=INFO
READ_ONLY=false2. 启动 MCP 服务器
A. 本地 stdio 模式(Claude Desktop / Cursor / VS Code)
在终端中简单启动:
python server.py要连接 Claude Desktop,请在您的 claude_desktop_config.json 文件中添加以下配置:
{
"mcpServers": {
"dolibarr": {
"command": "python",
"args": ["/chemin/absolu/vers/mcp-dolibarr/server.py"],
"env": {
"DOLIBARR_URL": "http://localhost:8080/api/index.php",
"DOLIBARR_API_KEY": "votre_cle_api_dolibarr"
}
}
}
}B. 远程服务器 http / Streamable HTTP 模式
要通过 HTTP 暴露 MCP 服务器(例如在远程服务器或云容器上):
MCP_TRANSPORT=http MCP_PORT=8000 python server.py服务器将在 http://0.0.0.0:8000 上可访问。
3. 使用 Docker 执行
通过 Docker Compose(推荐)
docker-compose up -d --build通过 Docker CLI
docker build -t mcp-dolibarr .
docker run -d -p 8000:8000 --env-file .env mcp-dolibarr🧪 执行单元测试
单元测试套件使用 pytest 和 HTTP mock respx 验证客户端和工具的行为(不会进行真实的网络调用,也不会修改您的 Dolibarr):
pytest📁 项目架构与结构
mcp-dolibarr/
├── app.py # Initialisation de l'instance FastMCP & gestion du lifespan
├── server.py # Point d'entrée principal (Transports stdio/http & Logging)
├── config/
│ └── settings.py # Centralisation et validation des paramètres d'environnement (.env)
├── dolibarr/
│ ├── client.py # Client HTTP asynchrone httpx connecté à l'API REST Dolibarr
│ ├── auth.py # Authentification HTTP via le header DOLAPIKEY
│ └── exceptions.py # Hiérarchie des erreurs et exceptions métier
├── tools/ # 12 modules d'outils MCP exposés aux assistants IA
│ ├── thirdparties.py # Gestion des tiers et sociétés clients/prospects
│ ├── contacts.py # Gestion des contacts personnes physiques
│ ├── products.py # Catalogue produits et services
│ ├── proposals.py # Devis & Orchestrateur de conversion devis->facture
│ ├── orders.py # Commandes clients et gestion de leurs lignes
│ ├── invoices.py # Facturation, validation et paiements
│ ├── stocks.py # Suivi des niveaux de stock par entrepôt
│ ├── projects.py # Fiches projets
│ ├── contracts.py # Suivi des contrats clients
│ ├── interventions.py # Fiches d'intervention technique
│ ├── documents.py # Génération & téléchargement de PDF
│ └── raw.py # Outil de secours API REST brute
├── utils/
│ ├── formatters.py # Nettoyage et mise en forme des réponses JSON pour les LLM
│ └── validators.py # Validation stricte des entrées utilisateur
├── tests/ # Tests unitaires automatisés (pytest + respx)
├── Dockerfile # Image Docker du serveur MCP
├── docker-compose.yml # Fichier Docker Compose
├── requirements.txt # Liste des dépendances Python
└── README.md # Documentation du projetThis server cannot be installed
Maintenance
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
- -licenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to interact with Odoo ERP systems through natural language to search records, create entries, update data, and manage business operations. Supports secure authentication and configurable access controls for production environments.
- AlicenseNot gradedqualityCmaintenanceEnables 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.1Mozilla Public 2.0
- AlicenseNot gradedqualityDmaintenanceProvides a Model Context Protocol interface for the Dolibarr ERP/CRM, enabling AI agents to manage customers, products, invoices, and orders. It features specialized search tools and server-side filtering to efficiently interact with Dolibarr's REST API while minimizing token usage.1MIT
- FlicenseNot gradedqualityCmaintenanceExposes a curated subset of the Officegest API v2 (22 CRUD tools) for managing clients, sales, and stock to AI clients like Claude Code and Claude Desktop.1
Related MCP Connectors
Odoo ERP for AI agents: hosted OAuth endpoint, gated writes, one endpoint for every instance.
Chile DTE for AI agents - boleta/factura electronica via OpenFactura or LibreDTE. Stateless BYO.
Universal AI API Orchestrator — 1,554 tools, 96 services. One install.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Houmamba1/mcp-dolibarr'
If you have feedback or need assistance with the MCP directory API, please join our Discord server