Ambivo MCP Server
Provides access to Ambivo API endpoints for natural language querying of entity data through a Model Context Protocol server with JWT authentication.
README
Ambivo MCP Server
This MCP (Model Context Protocol) server provides access to Ambivo API endpoints for natural language querying of entity data.
Features
- Natural Language Queries: Execute natural language queries against entity data using the
/entity/natural_queryendpoint - JWT Authentication: Secure access using Bearer token authentication
- Rate Limiting: Built-in rate limiting to prevent API abuse
- Token Caching: Efficient token validation with caching
- Error Handling: Comprehensive error handling with detailed error messages
- Retry Logic: Automatic retry with exponential backoff for failed requests
- Remote Hosting Support: Can be hosted in the cloud for multi-user access via HTTP/SSE transport
Tools
1. set_auth_token
Set the JWT Bearer token for authentication with the Ambivo API.
Parameters:
token(string, required): JWT Bearer token
Usage:
{
"token": "your-jwt-token-here"
}
2. natural_query
Execute natural language queries against Ambivo entity data.
Parameters:
query(string, required): Natural language query describing what data you wantresponse_format(string, optional): Response format - "table", "natural", or "both" (default: "both")
Example queries:
- "Show me leads created this week"
- "Find contacts with gmail addresses"
- "List opportunities worth more than $10,000"
- "Show me leads with attribution_source google_ads from the last 7 days"
Usage:
{
"query": "Show me leads created this week with attribution_source google_ads",
"response_format": "both"
}
Installation
Option 1: Install from PyPI (Recommended)
pip install ambivo-mcp-server
# For remote server support (optional)
pip install "ambivo-mcp-server[remote]"
Option 2: Install from Source
git clone https://github.com/ambivo-corp/ambivo-mcp-server.git
cd ambivo-mcp-server
pip install -e .
# For remote server support (optional)
pip install -e ".[remote]"
Running the Server
Local Mode (Default)
# If installed via pip
ambivo-mcp-server
# Or using Python module
python -m ambivo_mcp_server.server
Remote Mode (Cloud Hosting)
Host the server in the cloud for multiple users:
- Start the HTTP/SSE server (on your cloud server):
python http_sse_server.py
- Configure Claude Desktop (on user's machine):
{
"mcpServers": {
"ambivo": {
"command": "python",
"args": ["-m", "http_sse_client_bridge"],
"env": {
"MCP_SERVER_URL": "https://your-server.com",
"AMBIVO_AUTH_TOKEN": "user-jwt-token"
}
}
}
}
See INSTALL_HTTP_SSE.md for detailed cloud deployment instructions.
Configuration
The server uses the following default configuration:
- Base URL:
https://goferapi.ambivo.com - Timeout: 30 seconds
- Content Type:
application/json
You can modify these settings in the AmbivoAPIClient class if needed.
Authentication
- First, set your authentication token using the
set_auth_tokentool - The token will be included in all subsequent API requests as a Bearer token
- The token should be a valid JWT token from your Ambivo API authentication
Error Handling
The server provides comprehensive error handling:
- Authentication errors: Clear messages when token is missing or invalid
- HTTP errors: Detailed HTTP status codes and response messages
- Validation errors: Parameter validation with helpful error messages
- Network errors: Timeout and connection error handling
API Endpoints
This MCP server interfaces with these Ambivo API endpoints:
/entity/natural_query
- Method: POST
- Purpose: Process natural language queries for entity data retrieval
- Authentication: Required (JWT Bearer token)
- Content-Type: application/json
/entity/data
- Method: POST
- Purpose: Direct entity data access with structured parameters
- Authentication: Required (JWT Bearer token)
- Content-Type: application/json
Example Workflow
-
Set Authentication:
{ "tool": "set_auth_token", "arguments": { "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." } } -
Natural Language Query:
{ "tool": "natural_query", "arguments": { "query": "Show me all leads created in the last 30 days with phone numbers", "response_format": "both" } } -
Direct Entity Query:
{ "tool": "entity_data", "arguments": { "entity_type": "contact", "filters": {"email": {"$regex": "@gmail.com$"}}, "limit": 100, "sort": {"created_date": -1} } }
Development
To extend this MCP server:
- Add new tools: Implement additional tools in the
handle_list_tools()andhandle_call_tool()functions - Modify API client: Extend the
AmbivoAPIClientclass to support additional endpoints - Update configuration: Modify default settings in the configuration section
Troubleshooting
Common Issues:
- "Authentication required" error: Ensure you've called
set_auth_tokenfirst - HTTP 401/403 errors: Verify your JWT token is valid and not expired
- Connection timeout: Check network connectivity and API endpoint availability
- Invalid parameters: Review the tool schemas for required and optional parameters
Logging:
The server logs important events and errors. Check the console output for debugging information.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。