Blueshift MCP服务器
一种模型上下文协议(MCP)服务器,它提供了一个统一的接口,用于通过Claude Desktop与多个Blueshift帐户进行交互。
特性
- 多账户支持:使用自动API密钥路由管理多个Blueshift站点
- API全面覆盖:支持所有主要的Blueshift API端点
- 智能网站匹配:灵活的站点名称与部分搜索相匹配
- 区域支持:自动路由到美国或欧盟API端点
- 错误处理:清除错误消息和身份验证失败检测
- 类型安全:具有正确类型定义的完整TypeScript实现
安装
先决条件
- Node.js 18+
- 克劳德桌面
- Blueshift API凭据(用户和事件API密钥)
设置步骤
- 克隆并构建项目:
git clone https://github.com/dunn-stephen/blueshift-mcp.git
cd blueshift-mcp
npm install
npm run build- 创建您的帐户配置:
创建 accounts.json 在项目根目录中(旁边 package.json)使用您的Blueshift证书:
{
"accounts": {
"demo.acme.com": {
"site": "demo.acme.com",
"userApiKey": "your_user_api_key",
"eventApiKey": "your_event_api_key"
},
"prod.acme.com": {
"site": "prod.acme.com",
"userApiKey": "your_user_api_key",
"eventApiKey": "your_event_api_key",
"region": "eu"
}
},
"defaultAccount": "demo.acme.com"
}- 配置Claude桌面:
添加到您的Claude Desktop配置中:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json 视窗: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"blueshift": {
"command": "node",
"args": ["/absolute/path/to/blueshift-mcp/dist/index.js"],
"env": {
"BLUESHIFT_ACCOUNTS_CONFIG": "/absolute/path/to/blueshift-mcp/accounts.json",
"DEBUG": "false"
}
}
}
}- 重新启动克劳德桌面 加载MCP服务器。
用法
账户管理
# List all configured accounts
"List all Blueshift accounts"
# The server will show available sites and the default account客户运营
# Create/update customer
"Create a customer with email john@example.com, first name John, last name Doe"
# Search for customer
"Search for customer with email john@example.com"
# Delete customer (GDPR)
"Delete all data for customer john@example.com"
# Merge duplicate profiles
"Merge customer ID old123 into customer ID new456"事件跟踪
# Track purchase event
"Track a purchase event for john@example.com with order value $99.99 and order ID 12345"
# Track custom event
"Track a newsletter_signup event for jane@example.com with source homepage"
# Bulk event tracking
"Track bulk events: purchase for john@example.com amount $50, view for jane@example.com product_id ABC123"活动管理
# Trigger a campaign
"Execute campaign UUID abc-123-def for customer john@example.com"
# List campaigns
"List all active email campaigns"
# Get campaign details
"Get detailed stats for campaign UUID abc-123-def"模板
# List email templates
"List all email templates"
# Send test email
"Send test email using template UUID xyz-789 to test@example.com"
# Create SMS template
"Create SMS template named 'Order Confirmation' with message 'Your order {order_id} is confirmed'"与多个网站合作
# Specify site explicitly
"Create customer john@example.com in demo.acme.com"
# Use partial matching (if unique)
"List campaigns in acme" # Works if only one site contains 'acme'
# Default site is used when not specified
"Track purchase event for john@example.com" # Uses defaultAccount支持的API端点
活动管理
- 执行活动
- 批量执行活动
- 列出活动
- 获取活动详细信息
客户管理
- 创建/更新客户
- 搜索客户
- 通过UUID获取客户
- 批量更新客户
- 删除客户(GDPR)
- 忘记/忘记客户
- 合并客户
事件跟踪
- 发送单个事件
- 发送批量事件
- 获取最近事件
- 获取事件摘要
目录管理
- 创建目录
- 列出目录
- 添加目录项
片段
- 列出分段
- 获取细分用户
模板
- 电子邮件模板(列表、创建、测试)
- 短信模板(列表、创建、测试)
- 推送模板(列表、创建、测试)
自定义用户列表
- 创建用户列表
- 将用户添加到列表
- 批量添加用户
- 获取种子列表
其他特征
- 实时内容推荐
- 列出适配器
- 列表标记
- 获取客户事件历史记录
发展
运行测试
npm test调试模式
通过设置启用调试日志记录 DEBUG=true 在您的Claude Desktop配置中。
从源头构建
npm run build故障排除
服务器无法启动
- 检查一下
accounts.json存在于项目根目录中(与相同级别package.json) - 验证JSON语法是否有效
- 确保存在所有必需的API密钥
- 确认
BLUESHIFT_ACCOUNTS_CONFIG环境变量指向正确的文件路径
身份验证错误
- 验证API密钥是否正确
- 检查用户API密钥是否用于管理操作
- 检查事件API密钥是否用于事件跟踪
多个网站匹配
当您有相似的名称时,请更具体地说明网站名称:
"... in demo.acme.com" # Instead of "... in demo"许可证
麻省理工学院
