CRM数据连接服务

一个连接Pipedrive API v2的模型上下文协议服务器,将Pipedrive CRM数据暴露给如Claude等LLM应用程序使用。

  • by bratland
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 bratland/pipedrive-mcp-server

使用说明

Pipedrive MCP服务器

模型上下文协议(MCP)服务器,连接到Pipedrive API v2,向Claude等LLM应用程序公开PipedriveCRM数据。

特性

  • 只读访问 到Pipedrive数据
  • 全面实体支持 包括:
    • 交易
    • 人员(联系人)
    • 组织
    • 管道和阶段
    • 活动
    • 备注
  • 搜索功能 跨所有实体类型
  • 自定义字段支持 -所有字段,包括自定义字段,均已公开
  • 预定义提示 用于常见操作

先决条件

  • Node.js(v16或更高版本)
  • 具有API访问权限的Pipedrive帐户
  • Pipedrive API令牌

安装

  1. 克隆存储库:
git clone https://github.com/yourusername/pipedrive-mcp-server.git
cd pipedrive-mcp-server
  1. 安装依赖项:
npm install
  1. 创建一个 .env 根目录中的文件:
cp .env.example .env
  1. 将您的Pipedrive API令牌添加到 .env 文件:
PIPEDRIVE_API_TOKEN=your_pipedrive_api_token_here
  1. 构建项目:
npm run build

获取Pipedrive API代币

  1. 登录您的Pipedrive帐户
  2. 转到个人设置→ API
  3. 复制您的个人API令牌

用法

发展模式

运行服务器并自动重新加载以进行开发:

npm run dev

生产模式

构建并运行编译后的服务器:

npm run build
npm start

使用Claude Desktop进行配置

将以下内容添加到您的Claude Desktop配置文件中:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json 视窗: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "pipedrive": {
      "command": "node",
      "args": ["/path/to/pipedrive-mcp-server/dist/index.js"],
      "env": {
        "PIPEDRIVE_API_TOKEN": "your_pipedrive_api_token_here"
      }
    }
  }
}

可用工具

交易

  • get_deals -列表处理过滤选项
  • get_deal -按ID获取特定交易
  • search_deals -按术语搜索交易

人员(联系人)

  • get_persons -列出具有筛选选项的人员
  • get_person -通过ID获取特定人员
  • search_persons -按姓名搜索人员

组织

  • get_organizations -列出组织
  • get_organization -按ID获取特定组织
  • search_organizations -搜索组织

管道和阶段

  • get_pipelines -列出所有管道
  • get_pipeline -获取特定的管道
  • get_stages -列出管道阶段
  • get_stage -获得特定阶段

活动

  • get_activities -使用筛选列出活动
  • get_activity -获取特定活动

备注

  • get_notes -列出带有过滤功能的笔记
  • get_note -获取特定注释

搜索

  • search_items -跨多个项目类型搜索

预定义提示

服务器包括几个用于常见操作的预定义提示:

  • list_all_deals -列出所有交易及其详细信息
  • search_person -按姓名搜索某人
  • get_organization_deals -获取特定组织的所有交易
  • pipeline_overview -获取所有管道及其阶段的概述

发展

命令

npm run dev        # Run with auto-reload for development
npm run build      # Build TypeScript to JavaScript
npm run start      # Run the compiled server
npm run lint       # Run ESLint
npm run typecheck  # Run TypeScript type checking
npm test           # Run tests (when implemented)

项目结构

pipedrive-mcp-server/
├── src/
│   ├── index.ts           # Main MCP server entry point
│   ├── pipedrive-client.ts # Pipedrive API client
│   └── tools/             # Individual tool implementations
│       ├── deals.ts
│       ├── persons.ts
│       ├── organizations.ts
│       ├── pipelines.ts
│       ├── activities.ts
│       ├── notes.ts
│       └── search.ts
├── dist/                  # Compiled JavaScript output
├── package.json
├── tsconfig.json
├── .eslintrc.json
└── .env.example

API费率限制

Pipedrive API有速率限制。服务器适当地处理API响应,但要注意:

  • 默认速率限制:每2秒80个请求
  • 考虑对频繁访问的数据实施缓存
  • 使用分页参数限制数据传输

错误处理

服务器提供详细的错误消息,包括:

  • API身份验证失败
  • 网络错误
  • 无效参数
  • 超出速率限制警告

贡献

欢迎投稿!请随时提交拉取请求。

许可证

MIT许可证-有关详细信息,请参阅许可证文件

支持

对于问题或疑问:

  • 在GitHub上创建问题
  • 检查Pipedrive API文档:https://developers.pipedrive.com/docs/api/v1

致谢