Skip to main content
Glama

GoHighLevel MCP Server

一个 Model Context Protocol 服务器,让 LLM 智能体能够对 GoHighLevel CRM 进行操作控制——在 24 个模块中提供 114 个工具,涵盖联系人、销售管道、日历、消息、开票与支付,全部基于 GoHighLevel API v2。

问题

GoHighLevel 是一家小型代理机构的记录系统:每一位客户、每一次预订、每一张发票。真正消耗一整天的不是某个独立的 CRM 操作,而是它们之间的衔接——一次拍摄确认了,于是就得有人创建商机、把它移动到正确的销售管道阶段、针对正确的联系人预订日历时段、起草发票,并记录一条备注。每一步都只需要五十秒的点击,而这套流程每周要跑好几遍。

这套流程正是智能体擅长做的事——只要它能触达 CRM。本服务器就是那个「触达」:它把 GoHighLevel 暴露为一组有类型、带注解的工具,让智能体只凭一句话的指令就能走完整条链路,同时让破坏性和面向外部的步骤仍然保留为可审批的环节。

Related MCP server: GoHighLevel MCP Server

架构

24 个工具模块通过 stdio 注册到一个 McpServer 上。所有流量都经由一个独立的 ghlRequest() 路由,它负责认证、强制要求的 Version 头部、查询字符串组装以及错误整形。模块可以通过 GHL_DISABLED_MODULES 在启动时切换开关——它的重要性比听上去要大得多:因为 114 个工具定义本身就占据智能体上下文窗口的相当一部分,而这还发生在它读到用户请求的第一个字之前。一个只涉及预订的部署可以只注册六个模块,跳过其余所有。

  MCP host (Claude Desktop / Claude Code)
          | stdio (JSON-RPC)
  +-------v--------------------------------------------+
  |  index.ts   MODULES registry, GHL_DISABLED_MODULES  |
  +-------+--------------------------------------------+
          |
  +-------v-----+ +---------------+ +-----------+ ......  24 modules
  |  contacts   | | opportunities | | invoices  |
  +-------+-----+ +-------+-------+ +-----+-----+
          |               |               |
          |               |         +-----v--------------+
          |               |         | billing-helpers.ts |
          |               |         |  businessDetails   |
          |               |         |  contactDetails    |
          |               |         |  sender resolution |
          |               |         +-----+--------------+
          +-------+-------+---------------+
                  |
        +---------v----------------------------+
        |  client.ts  ghlRequest()             |
        |   Bearer token + Version header      |
        |   status-specific error hints        |
        +---------+----------------------------+
                  |
          services.leadconnectorhq.com

每个写入工具都带有 MCP 注解;其中 17 个被标为 destructiveHint,另外 ghl_send_messageghl_send_invoice 被标记为面向外部,因为它们会接触真实客户。宿主在批准调用之前会先把这些标注呈现出来,这正是「一个替你起草发票的智能体」与「一个不小心把发票‘群发’出去给客户的智能体」之间的区别。

真正难的蛋糕

创建发票。端点接收 businessDetailscontactDetails 两个块,而文档对两者的描述都远远不足:如果按文档说的那样传一个 contactId 和几个明细行,那么你会得到一个不涉及任何字段名称的校验错误。两个块都必须完整给出,而且 businessDetails.phoneNocontactDetails.phoneNo 是强制的————一个只有电子邮箱、没有手机号的联系人,根本无法开票。

更糟的是,这些值必须和 UI 输出的 完全一致,否则通过 API 创建的发票会和手工创建的发票看起来不一样——不同的 logo、缺失的条款、凌乱的编号。这些默认值并不在你以为能找到它们的位置配置(location profile)中,而是藏在 GET /invoices/settings 背后,而这个接口正是 UI 预填时使用的同一个数据源。

src/tools/billing-helpers.ts 把两个块的内容都解析好,让工具只需要一个 contactId 即可。企业信息按四级回退:单个调用参数 → GHL_BUSINESS_* 环境变量 → 已保存的发票设置 → 位置配置文件,每一层只负责补上上一层留空的部分。联系人信息则抓取后组装,name 按回退顺序取全名 → 姓+名 → 公司名称 → 邮箱 → 电话,因为 GoHighLevel 会拒绝空名字,而真实 CRM 记录里经常缺名字。两条路径都会在缺字段时抛出「字段名 + 如何补充」的提示,而不是直接暴露 GHL 不透明的 422。每次查找都会按 location 做记忆化(memoised),所以一次批量开十张发票只触发一次设置读取,而不是十次。

我会有不用的做法的地方

  1. 完全没有测试。 大约 4000 行代码、零测试。billing-helpers 里的回退链是对 fixture 数据做纯逻辑操作——这是整个仓库里最好测的东西,也是出错成本最高的部分,失败模式就是一张畸形的发票直接被发给了最终客户。

  2. 429 之后没有重试。 ghrRequest 会告诉调用方「已限流,请稍后重试」,然后真就不重试了。退避应该在客户端实现,而不应该由智能体做判断。

  3. 缓存是模块级的可变 map,而且没有失效机制。 对宿主能随意重启的 stdio 服务器来说这是正确的;但一旦这个进程是长生命周期的服务,就错了——因为企业资料的编辑永远不会被这个缓存感知到。

  4. 响应到处都是 Record<string, unknown> GoHighLevel 发布了 OpenAPI 规范;按规范生成类型,可以把一类本来在运行时爆出来的意外变成编译期错误。

  5. 一个服务器塞进 114 个工具太多了。 模块开关只是 workaround,不是修复。更好的形态是一小组基础工具加一个「发现」机制,让智能体按需商会它所实际需要的东西。

配置

需要 Node.js 20+ 以及 GoHighLevel 账户。

1. 创建 Private Integration(私有集成)令牌

Settings → Private Integrations → Create new integration。勾选要与你要用的工具匹配的权限范围;最少包括:

contacts.readonlycontacts.write, opportunities.readonlyopportunities.writecalendars.readonlycalendars/events.writeconversations.readonlyconversations/message.writeinvoices.readonly(仅发票), invoices.write products.readonlyproducts.writelocations/customFields.readonly workflows.readonly

复制令牌——它以 pit- 开头。

2. 找到你的 Location ID

Settings → Business Profile,或者从 Dashboard 地址栏读出来::.../location/<LOCATION_ID>/...

3. 构建

git clone <this-repo>
cd ghl-mcp
npm install
npm run build

4. 注册到某个 MCP 宿主

{
  "mcpServers": {
    "gohighlevel": {
      "command": "node",
      "args": ["/absolute/path/to/ghl-mcp/dist/index.js"],
      "env": {
        "GHL_API_KEY": "pit-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "GHL_LOCATION_ID": "your-location-id"
      }
    }
  }
}

重启宿主。所有支持的变量见 .env.example,包括发票的 business 块以及模块开关。

要绕过宿主来验证这个服务:

GHL_API_KEY=pit-... GHL_LOCATION_ID=... npm run inspect

关于「构建自动化」的说明

GoHighLevel 的 API 不能创建 工作流的逻辑——可视化编辑器只能在 UI 里使用。推荐的做法是:先在 UI 中把工作流建好,然后用 ghl_list_workflows 找到这个工作流 id,再用 ghl_add_contact_to_workflow 把联系人加入工作流。

工具参考

领域

工具

联系人

ghl_search_contactsghl_get_contactghl_create_contactghl_update_contactghl_add_contact_tagsghl_delete_contact

商机 / 销售管道

ghl_get_pipelinesghl_search_opportunitiesghl_get_opportunityghl_create_opportunityghl_update_opportunity

日历 / 预约

ghl_get_calendarsghl_get_free_slotsghl_create_appointmentghl_get_appointmentghl_update_appointmentghl_delete_appointment

Conversation / 消息

ghl_search_conversationsghl_get_messagesghl_send_message

发票

ghl_list_invoicesghl_get_invoiceghl_create_invoiceghl_send_invoiceghl_void_invoiceghl_delete_invoice

报价单

ghl_list_estimatesghl_generate_estimate_numberghl_create_estimateghl_update_estimateghl_send_estimateghl_estimate_to_invoiceghl_delete_estimate

产品

ghl_list_productsghl_get_productghl_create_productghl_update_productghl_delete_productghl_list_product_pricesghl_create_product_price

自定义字段

ghl_list_custom_fieldsghl_get_custom_fieldghl_create_custom_fieldghl_update_custom_fieldghl_delete_custom_field

任务

ghl_list_contact_tasksghl_get_contact_taskghl_create_contact_taskghl_update_contact_taskghl_delete_contact_task

备注

ghl_list_contact_notesghl_get_contact_noteghl_create_contact_noteghl_update_contact_noteghl_delete_contact_note

工作流(自动化)

ghl_list_workflowsghl_add_contact_to_workflowghl_remove_contact_from_workflow

支付

ghl_list_ordersghl_get_orderghl_list_transactionsghl_list_subscriptionsghl_get_subscription

表单与调查问卷

ghl_list_formsghl_get_form_submissionsghl_list_surveysghl_get_survey_submissions

用户与团队

ghl_list_usersghl_get_user

日历事件

ghl_get_calendar_eventsghl_block_calendar_slotghl_list_appointment_notesghl_create_appointment_note

社媒排期

ghl_list_social_accountsghl_list_social_postsghl_get_social_postghl_create_social_postghl_delete_social_post

媒体库

ghl_list_mediaghl_upload_media_by_urlghl_delete_media

营销活动与链接

ghl_list_campaignsghl_add_contact_to_campaignghl_remove_contact_from_campaignghl_list_trigger_linksghl_create_trigger_linkghl_delete_trigger_link

标签

ghl_list_tagsghl_create_tagghl_update_tagghl_delete_tag

自定义值

ghl_list_custom_valuesghl_get_custom_valueghl_create_custom_valueghl_update_custom_valueghl_delete_custom_value

企业

ghl_list_businessesghl_get_businessghl_create_businessghl_update_businessghl_delete_business

自定义对象

ghl_list_object_schemasghl_get_object_schemaghl_search_object_recordsghl_get_object_recordghl_create_object_recordghl_update_object_recordghl_delete_object_record

关联关系

ghl_list_associationsghl_get_record_relationsghl_create_relationghl_delete_relation

漏斗

ghl_list_funnelsghl_list_funnel_pages

许可证

MIT——见 LICENSE。本项目与 GoHighLevel 既无关联,也是未被其认可。

Install Server
F
license - not found
B
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to perform CRM operations like creating contacts, managing deals, and updating leads through natural language using the Model Context Protocol.
    4
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI assistants to directly interact with the entire GoHighLevel CRM via 563+ tools across 44 categories, allowing natural language control for contacts, messaging, opportunities, calendars, and more.
    23
    1
    ISC
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents to interact with a CRM covering companies, people, leads, deals, and more, with role checks, scoped agent keys, approval gates, and a shared audit trail.
    AGPL 3.0
  • F
    license
    Not graded
    quality
    C
    maintenance
    An MCP-native CRM backend for AI agents, enabling customer, opportunity, note, follow-up, and pipeline health management through 15 MCP tools.

View all related MCP servers

Related MCP Connectors

  • Agent-native CRM. 25 tools — contacts, deals, sequences, enrichment waterfall, audit log.

  • SaaS intelligence for AI agents. 5 unified tools cover 1,000+ services with 91-96% token savings.

  • See, price, and control every tool call your AI agents make: policy checks, cost, and audit tools.

View all MCP Connectors

Latest Blog Posts

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/vmproductions631-tech/gohighlevel-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server