Ambivo Claude MCP(模型上下文协议)服务器提供了访问 Ambivo API 端点的功能,可借助 Claude AI 对实体数据进行自然语言查询。
/entity/natural_query 端点对实体数据执行自然语言查询。set_auth_token设置用于与 Ambivo API 进行身份验证的 JWT Bearer 令牌。
token(字符串,必需):JWT Bearer 令牌。{
"token": "your-jwt-token-here"
}
natural_query对 Ambivo 实体数据执行自然语言查询。
query(字符串,必需):描述所需数据的自然语言查询。response_format(字符串,可选):响应格式 - "table"、"natural" 或 "both"(默认:"both")。{
"query": "Show me leads created this week with attribution_source google_ads",
"response_format": "both"
}
这是一个基于 Claude 的纯 MCP 服务器实现,用于 Ambivo API,旨在与 Claude Desktop 和其他兼容 Claude 的 MCP 客户端无缝协作。它通过 Claude 强大的语言理解能力,实现与 Ambivo CRM 数据的自然语言交互。
pip install ambivo-mcp-server
git clone https://github.com/ambivo-corp/ambivo-mcp-server.git
cd ambivo-mcp-server
pip install -e .
# 如果通过 pip 安装
ambivo-mcp-server
# 或者使用 Python 模块
python -m ambivo_mcp_server.server
服务器使用以下默认配置:
| 属性 | 详情 |
|---|---|
| 基础 URL | https://goferapi.ambivo.com |
| 超时时间 | 30 秒 |
| 内容类型 | application/json |
如有需要,您可以在 AmbivoAPIClient 类中修改这些设置。
set_auth_token 工具设置您的身份验证令牌。服务器提供全面的错误处理:
此 MCP 服务器与以下 Ambivo API 端点进行交互:
/entity/natural_query/entity/data{
"tool": "set_auth_token",
"arguments": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
}
{
"tool": "natural_query",
"arguments": {
"query": "Show me all leads created in the last 30 days with phone numbers",
"response_format": "both"
}
}
{
"tool": "entity_data",
"arguments": {
"entity_type": "contact",
"filters": {"email": {"$regex": "@gmail.com$"}},
"limit": 100,
"sort": {"created_date": -1}
}
}
要扩展此 MCP 服务器:
handle_list_tools() 和 handle_call_tool() 函数中实现额外的工具。AmbivoAPIClient 类以支持更多的端点。set_auth_token。服务器会记录重要事件和错误。请检查控制台输出以获取调试信息。