GoHighLevel MCP服务器
ghl-mcp 是GoHighLevel API v2的模型上下文协议服务器。它通过stdio将联系人、机会、对话、日历、工作流、用户、发票、付款、社交、表单、漏斗、任务、产品、电子邮件、活动和文档作为MCP工具公开,因此Claude Code、Cursor、Codex、OpenClaw、VS Code和其他MCP客户端可以直接使用GoHighLevel CRM数据。
特性
- 50个MCP工具,涵盖高价值的GoHighLevel CRM、计费、营销和运营工作流程
- 建立在
@modelcontextprotocol/sdkv1.x - 严格的TypeScript配置
- Zod验证了工具输入,每个字段都有描述
- 自动
locationId环境变量注入 - 基本请求起搏保持在GoHighLevel速率限制范围内
- 人类可读的工具错误有效载荷,而不是原始堆栈跟踪
需求
- Node.js 18+
- GoHighLevel API令牌
- GoHighLevel位置ID
安装
本地开发
npm install
npm run build
node dist/index.js与一起跑步 npx
npx -y ghl-mcp配置
在MCP客户端配置中设置这些环境变量:
GHL_API_TOKEN:私有集成令牌或OAuth访问令牌GHL_LOCATION_ID:GoHighLevel位置或子帐户ID
服务器在每次请求时都会发送这些标头:
Authorization: Bearer {GHL_API_TOKEN}
Content-Type: application/json
Version: 2021-07-28MCP客户端设置
克劳德代码
注:claude mcp add注册本地服务器名称——它不会从注册表下载。之后的部分--是运行服务器的实际命令。
# After npm publish (recommended):
claude mcp add gohighlevel --scope user \
--env GHL_API_TOKEN="your-token" \
--env GHL_LOCATION_ID="your-location-id" \
-- npx -y ghl-mcp
# Local development (before publishing):
claude mcp add gohighlevel --scope user \
--env GHL_API_TOKEN="your-token" \
--env GHL_LOCATION_ID="your-location-id" \
-- node /absolute/path/to/ghl-mcp/dist/index.js游标/VS代码/Code样式配置
{
"mcpServers": {
"gohighlevel": {
"command": "npx",
"args": ["-y", "ghl-mcp"],
"env": {
"GHL_API_TOKEN": "your-token-here",
"GHL_LOCATION_ID": "your-location-id"
}
}
}
}MCP检查员
npx @modelcontextprotocol/inspector node dist/index.js刀具清单
联系人
search_contacts:按文本、标签、分页或高级筛选器搜索联系人get_contact:按ID检索一个联系人create_contact:创建联系人update_contact:更新联系人字段delete_contact:删除联系人add_contact_tags:为联系人添加标签remove_contact_tags:从联系人中删除标签get_contact_notes:列出联系人的备注create_contact_note:在联系人上创建注释
机会
search_opportunities:按查询、渠道、阶段、状态、联系人或所有者搜索交易get_opportunity:按ID检索一个商机create_opportunity:创造机会update_opportunity:更新商机字段delete_opportunity:删除商机update_opportunity_status:将状态更改为open,won,lost,或abandonedlist_pipelines:列出管道并获取其阶段
对话
search_conversations:搜索对话get_conversation:按ID检索一个对话get_conversation_messages:列出对话中的消息send_message:发送短信、电子邮件、WhatsApp或类似消息create_conversation:开始新的对话
日历
list_calendars:列出日历list_events:列出事件或约会create_event:创建事件get_available_slots:检索可用的预订时段
工作流
list_workflows:列出工作流trigger_workflow:触发联系人的工作流
用户
list_users:列出配置位置中的用户get_user:按ID检索一个用户
发票和付款
list_invoices:列出发票create_invoice:创建发票list_transactions:列出付款交易记录list_orders:列出付款单list_subscriptions:列出订阅
社交
list_social_posts:列出社交帖子create_social_post:创建或安排社交帖子list_social_accounts:列出已连接的社交帐户get_social_stats:检索社会统计数据
表格和漏斗
list_forms:列表表单list_funnels:列出漏斗list_funnel_pages:列出漏斗页面
任务
list_tasks:列出联系人的任务create_task:为联系人创建任务
产品
list_products:列出产品list_product_prices:列出产品的价格
电子邮件
list_email_templates:列出电子邮件模板list_email_schedules:列出已安排的电子邮件
活动
list_campaigns:列出活动
文件
list_contracts:列出合同或文件send_contract_link:发送合同链接以供签署
发展
npm run dev构建输出转到 dist/.
建筑
src/
├── index.ts
├── client.ts
├── types.ts
└── tools/
├── calendars.ts
├── campaigns.ts
├── contacts.ts
├── conversations.ts
├── documents.ts
├── emails.ts
├── forms.ts
├── invoices.ts
├── opportunities.ts
├── products.ts
├── social.ts
├── tasks.ts
├── users.ts
└── workflows.ts实施说明
- 大多数端点需要
locationId。除非已经提供了值,否则此服务器会自动将其注入请求查询字符串和JSON正文中。 - 客户端在请求之间应用最小延迟,以减少达到GoHighLevel速率限制的机会。
- 工具响应以JSON文本块的形式返回,其中包含简短摘要和原始API负载。
- 管道列表获取每个返回管道的管道阶段详细信息,以便代理在一次调用中获得可用的阶段元数据。
示例工作流
查找联系人并添加备注
- 呼叫
search_contacts随着query: "jane@company.com" - 呼叫
get_contact与所选contactId - 呼叫
create_contact_note随着contactId和注释文本
创造并推进机会
- 呼叫
list_pipelines查找目标管道和阶段ID - 呼叫
create_opportunity随着contactId,pipelineId,pipelineStageId,以及name - 呼叫
update_opportunity或update_opportunity_status随着交易的进展
预约
- 呼叫
get_available_slots带着一个calendarId日期范围 - 呼叫
create_event具有选定的时隙和可选contactId
出版
npm publish --access public已发布的软件包将安装 ghl-mcp 二进制从 dist/index.js.
