使用说明
GoHighLevel MCP服务器
用于GoHighLevel API的强大模型上下文协议(MCP)服务器,提供用于管理联系人的工具。
安装
-
克隆存储库:
git clone https://github.com/CallBackCode/ghlMCP.git cd ghlMCP -
安装依赖项:
npm install -
设置您的GoHighLevel API密钥和位置ID:
-
创建一个
.env项目根目录中的文件:cat <<EOF > .env # --- Required: Agency Token or Location Token and Location ID --- GHL_API_KEY=your_api_key_here GHL_LOCATION_ID=your_location_id_here # --- Optional: Test Only Variables --- GHL_TEST_BUSINESS_ID=your_business_id_here GHL_TEST_CONTACT_ID=your_contact_id_here EOF
-
4. **Build the project:**
```sh
npm run build
-
运行MCP服务器:
npm start -
运行测试:
npm test
环境变量
GHL_API_KEY(必需):您的GoHighLevel API密钥GHL_LOCATION_ID(必填):您的GoHighLevel位置ID
可选:仅测试
GHL_TEST_BUSINESS_ID:用于基于businessId的联系人测试GHL_TEST_CONTACT_ID:用于基于contactId的测试(如果需要)
可用的MCP端点(工具)
Contacts
| 端点 | 描述 | 必需参数 | 可选参数 |
|---|---|---|---|
listContacts |
列出所有联系人 | locationId |
|
getContact |
通过ID获取联系人 | id, locationId |
|
createContact |
创建新联系人 | locationId |
firstName, lastName, email, phone |
updateContact |
按ID更新联系人 | id, locationId |
firstName, lastName, email, phone |
deleteContact |
按ID删除联系人 | id, locationId |
|
upsertContact |
更新(创建/更新)联系人 | locationId, email |
firstName, lastName, phone |
getContactsByBusinessId |
按businessId获取联系人 | businessId, locationId |
limit, skip, query |
项目结构
src/api/-用于GoHighLevel端点的API包装器src/types/--集中式TypeScript类型src/index.ts--MCP服务器入口点test/--每个端点的Jest测试套件
备注
- 所有终结点都需要有效的GoHighLevel API密钥和位置ID。
- 为了LLM兼容性,响应以文本格式返回打印精美的JSON。
- 看 GoHighLevel API文档 了解更多详情。
由CallBack提供