使用说明
Pipedrive MCP服务器
用于与Pipedrive CRM API交互的模型控制协议(MCP)服务器实现。此服务器使Claude能够通过MCP工具调用创建、读取、更新和删除Pipedrive记录。
特性
此MCP服务器实现了以下Pipedrive功能:
- 人员 -创建、读取、更新、删除和搜索人员实体
- 组织 -管理组织及其追随者
- 交易 -创建、管理和搜索交易,包括交易产品
- 潜在客户 -创建、管理和搜索潜在客户,包括潜在客户标签
- 活动 -跟踪和管理活动和活动类型
- 商品搜索 -在Pipedrive实体中进行全局和特定领域的搜索
附加功能:
- 具有全面错误处理功能的异步API客户端
- 启用/禁用特定模块的功能标志
- 用于可维护性的垂直切片架构
- 全面的测试覆盖率
Claude Code快速入门
开始使用Pipedrive MCP服务器并在claude桌面应用程序中设置它的最快方法:
1.安装所需工具
打开终端或命令提示符并运行以下命令:
# Install Python's uv package manager (if not already installed)
curl -sSf https://install.python-uv.org/uv | python3 -
有关uv的更多详细安装说明,请访问: Astral的紫外线安装文档
2.下载代码
不需要GitHub帐户! 只需在终端中运行以下命令:
选择要下载代码的文件夹并运行以下命令:
# Clone the repository (download the code)
git clone https://github.com/Wirasm/pipedrive-mcp.git
# Move into the project folder
cd pipedrive-mcp
3.安装Python依赖项
打开您的终端,并按照所写的方式运行此命令:
# Install all required packages
uv sync
4.设置您的Pipedrive凭据
- 查找
.env.example项目文件夹中的文件 - 复制并重命名为
.env - 打开
.env任何文本编辑器中的文件 - 用实际的Pipedrive信息替换占位符:
PIPEDRIVE_API_TOKEN=your_api_token
PIPEDRIVE_COMPANY_DOMAIN=your_company_domain
您在.env文件中看到的所有其他配置都是可选的,可以保持原样。
获取您的Pipedrive API代币:
- 登录您的Pipedrive帐户
- 点击右上角的个人资料图片
- 选择“个人偏好”
- 转到“API”选项卡
- 如果您还没有,请单击“生成新令牌”
- 复制生成的令牌并将其粘贴到
.env文件
对于公司域名:
如果您的Pipedrive URL为 https://mycompany.pipedrive.com/pipeline,那么您的域名是 mycompany
5.在Claude Desktop中安装MCP服务器
打开终端并运行以下命令:
# Install the MCP server
mcp install server.py
这将自动在Claude Desktop中注册Pipedrive工具。
6.开始与Claude一起使用Pipedrive
- 重要提示: 如果Claude Desktop应用程序已在运行,请重新启动它
- 打开克劳德桌面
- 开始新的聊天,克劳德现在可以与您的Pipedrive CRM互动了!
试着让克劳德“给我看看我最近的交易”或“在这里创建一个新的联系人,详细信息如下:…”来开始。
可用的MCP工具
个人工具
| 工具名称 | 描述 |
|---|---|
create_person_in_pipedrive |
在Pipedrive CRM中创建新用户 |
get_person_from_pipedrive |
按ID检索特定人员的详细信息 |
update_person_in_pipedrive |
在Pipedrive中更新现有人员 |
delete_person_from_pipedrive |
从Pipedrive中删除一个人 |
search_persons_in_pipedrive |
按姓名、电子邮件、电话等搜索人员。 |
组织工具
| 工具名称 | 描述 |
|---|---|
create_organization_in_pipedrive |
在Pipedrive中创建新组织 |
get_organization_from_pipedrive |
按ID检索组织详细信息 |
update_organization_in_pipedrive |
更新现有组织 |
delete_organization_from_pipedrive |
删除组织 |
list_organizations_in_pipedrive |
列出具有过滤和分页功能的组织 |
search_organizations_in_pipedrive |
按名称或其他条件搜索组织 |
add_follower_to_organization |
将用户添加为组织的追随者 |
delete_follower_from_organization |
从组织中删除追随者 |
交易工具
| 工具名称 | 描述 |
|---|---|
create_deal_in_pipedrive |
创建新交易 |
get_deal_from_pipedrive |
按ID检索交易详细信息 |
update_deal_in_pipedrive |
更新现有交易 |
delete_deal_from_pipedrive |
删除交易 |
list_deals_in_pipedrive |
列表处理过滤和分页 |
search_deals_in_pipedrive |
按标题或其他条件搜索交易 |
add_product_to_deal |
将产品添加到交易中 |
update_deal_product |
更新与交易相关的产品 |
delete_product_from_deal |
从交易中删除产品 |
铅工具
| 工具名称 | 描述 |
|---|---|
create_lead_in_pipedrive |
创建新的潜在客户 |
get_lead_from_pipedrive |
按ID检索潜在客户详细信息 |
update_lead_in_pipedrive |
更新现有潜在客户 |
delete_lead_from_pipedrive |
删除潜在客户 |
list_leads_in_pipedrive |
列出具有过滤和分页功能的潜在客户 |
search_leads_in_pipedrive |
按标题或其他条件搜索潜在客户 |
get_lead_labels |
检索可用的潜在客户标签 |
get_lead_sources |
检索可用的潜在客户来源 |
项目搜索工具
| 工具名称 | 描述 |
|---|---|
search_items_in_pipedrive |
跨多个项目类型的全局搜索 |
search_field_in_pipedrive |
在给定实体类型中搜索特定字段值 |
功能模块
该项目遵循垂直切片架构,每个功能都有自己的目录:
- 人员/ -人实体管理
- 组织/ -组织实体管理
- 交易/ -交易管理,包括产品
- 线索/ -潜在客户管理,包括标签
- 活动/ -活动跟踪和管理
- 项目搜索/ -跨实体搜索功能
- 共享/ -跨功能使用的通用实用程序
入门指南
先决条件
安全说明
此MCP服务器实施了多种安全措施:
- 本地运行时默认绑定到localhost(127.0.0.1)
- 正确的错误处理和记录
部署时:
- 对于本地开发,保留默认主机(127.0.0.1)
- 对于容器部署,请设置
CONTAINER_MODE=true
克隆存储库
git clone git@github.com:Wirasm/pipedrive-mcp.git
cd pipedrive-mcp
设置环境
- 创建虚拟环境并安装依赖项:
uv venv
source .venv/bin/activate # On Unix/macOS
# OR
.venv\Scripts\activate # On Windows
uv pip install -e .
- 创建一个
.env根目录中的文件:
# API Credentials
PIPEDRIVE_API_TOKEN=your_api_token
PIPEDRIVE_COMPANY_DOMAIN=your_company_domain # Just the subdomain portion (e.g., "mycompany" from mycompany.pipedrive.com)
# Server Configuration
HOST=127.0.0.1 # Use 127.0.0.1 for local development, 0.0.0.0 only in containers
PORT=8152
TRANSPORT=sse # "sse" or "stdio"
# Security Settings
CONTAINER_MODE=false
VERIFY_SSL=true # Set to "false" if you encounter SSL certificate issues (development only)
# Feature Flags (optional)
PIPEDRIVE_FEATURE_PERSONS=true
PIPEDRIVE_FEATURE_DEALS=true
PIPEDRIVE_FEATURE_ORGANIZATIONS=true
PIPEDRIVE_FEATURE_LEADS=true
PIPEDRIVE_FEATURE_ITEM_SEARCH=true
PIPEDRIVE_FEATURE_ACTIVITIES=true
运行测试
uv run pytest
安装到Claude桌面
mcp install server.py
在本地运行
uv run server.py
使用Docker
- 构建Docker镜像:
docker build -t pipedrive-mcp .
- 使用环境变量运行容器:
# IMPORTANT: Replace values in quotes with your real Pipedrive credentials
docker run -d -p 8152:8152 \
-e PIPEDRIVE_API_TOKEN="your-actual-pipedrive-api-token" \
-e PIPEDRIVE_COMPANY_DOMAIN="your-company-subdomain" \
-e PORT=8152 \
-e TRANSPORT=sse \
-e CONTAINER_MODE=true \
-e VERIFY_SSL=true \
--name pipedrive-mcp-server \
pipedrive-mcp
例如,如果您的Pipedrive域是 mycompany.pipedrive.com,您将使用:
-e PIPEDRIVE_COMPANY_DOMAIN="mycompany"
- 检查容器是否正在运行并查看日志:
# Check container status
docker ps | grep pipedrive-mcp-server
# View logs
docker logs pipedrive-mcp-server
- 完成后,停止并移除容器:
docker stop pipedrive-mcp-server
docker rm pipedrive-mcp-server
- 配置Claude以使用MCP服务器:
要在Claude Desktop中使用此服务器,请在Claude桌面设置中注册MCP服务器:
- 服务器名称:Pipedrive MCP
- 终结点URL:http://localhost:8152
- 认证:无
项目结构
该项目遵循垂直切片架构,代码按功能而不是技术层组织:
pipedrive/
├── api/
│ ├── base_client.py # Core HTTP client
│ ├── pipedrive_api_error.py # API error handling
│ ├── pipedrive_client.py # Main client facade
│ ├── pipedrive_context.py # Client lifecycle management
│ ├── features/
│ │ ├── tool_registry.py # Feature registry system
│ │ ├── tool_decorator.py # Feature-aware tool decorator
│ │ ├── persons/ # Person feature module
│ │ │ ├── client/ # Person API client
│ │ │ ├── models/ # Person domain models
│ │ │ └── tools/ # Person MCP tools
│ │ ├── organizations/ # Organization feature module
│ │ ├── deals/ # Deal feature module
│ │ ├── leads/ # Lead feature module
│ │ ├── activities/ # Activity feature module
│ │ ├── item_search/ # Search feature module
│ │ └── shared/ # Shared utilities
├── feature_config.py # Feature configuration management
└── mcp_instance.py # MCP server configuration
发展
有关详细的开发信息,请参阅 CLAUDE.md.
许可证
麻省理工学院