Social Listening社交聆听
一个通过Syften的API提供人工智能驱动的社会提及分析的MCP服务器,具有实时通知和趋势分析功能。
服务介绍
社交监听 MCP 服务器
这是一个通过 Syften 的 API 提供社交监听功能的模型上下文协议(MCP)服务器。该服务器支持通过 webhook 实现实时通知的由 AI 驱动的社交提及分析。
功能
- 实时社交提及监控
- AI 驱动的内容分类
- 重要提及的 webhook 通知
- 历史数据回填
- 趋势分析和报告
- 自然语言查询支持
先决条件
- Node.js (v16 或更高版本)
- 拥有 API 访问权限的 Syften 账户
- Claude 桌面应用程序或带有 Claude 扩展的 VSCode
安装
- 克隆仓库:
git clone https://github.com/fred-em/social-listening.git
cd social-listening
- 安装依赖项:
npm install
- 构建服务器:
npm run build
配置
1. Syften API 设置
- 登录您的 Syften 账户
- 转到设置 > API 访问
- 如果还没有生成 API 密钥,请生成一个
- 复制您的 API 密钥以备下一步使用
2. Claude 桌面配置
将服务器配置添加到 ~/Library/Application Support/Claude/claude_desktop_config.json 中:
{
"mcpServers": {
"social-listening": {
"command": "node",
"args": ["/absolute/path/to/social-listening/build/index.js"],
"env": {
"SYFTEN_API_KEY": "your-api-key-here"
}
}
}
}
3. VSCode 配置(可选)
如果您使用的是带有 Claude 扩展的 VSCode,将配置添加到 /Users/YOUR_USERNAME/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json 中:
{
"mcpServers": {
"social-listening": {
"command": "node",
"args": ["/absolute/path/to/social-listening/build/index.js"],
"env": {
"SYFTEN_API_KEY": "your-api-key-here"
}
}
}
}
可用工具
1. configure_ai_filter
为提及分析配置 AI 过滤设置。
{
"enabled": true,
"min_confidence": 0.7,
"categories": ["spam", "support", "feedback", "bug_report", "feature_request"],
"webhook_url": "https://your-webhook.com/endpoint",
"webhook_secret": "your-secret-token"
}
2. setup_webhook
为实时通知配置 webhook 端点。
{
"endpoint_url": "https://your-webhook.com/endpoint",
"secret_token": "your-secret-token",
"enabled": true
}
3. backfill_month
为特定月份回填提及。
{
"year": 2024,
"month": 2
}
4. sync_latest
同步自上次更新以来的新提及。
{}
5. analyze_trends
分析随时间变化的提及趋势。
{
"start_date": "2024-01-01",
"end_date": "2024-02-01",
"group_by": "day",
"tags": ["feature", "bug"]
}
6. get_top_sources
获取顶级提及来源/作者。
{
"start_date": "2024-01-01",
"end_date": "2024-02-01",
"limit": 10
}
7. nlp_prompt
处理自然语言查询。
{
"prompt": "show me feedback mentions from last week"
}
8. get_ai_filtered_mentions
获取经过 AI 过滤处理的提及。
{
"start_date": "2024-01-01",
"end_date": "2024-02-01",
"min_confidence": 0.8,
"categories": ["feedback", "bug_report"],
"limit": 50
}
在 Claude 中的示例用法
以下是一些您可以与 Claude 一起使用的示例提示:
- 配置 AI 过滤:
Configure the social listening AI filter to detect bug reports and feature requests with 80% confidence.
- 设置 webhook 通知:
Set up a webhook for the social listening server to send notifications to https://my-server.com/webhook with the secret token "my-secret".
- 分析趋势:
Show me the trend of bug reports and feature requests from last month.
- 获取过滤后的提及:
Show me all high-confidence bug reports from the past week.
- 自然语言查询:
What kind of feedback have we received about the new feature launch?
Webhook 集成
在配置 webhook 时,服务器将以以下格式发送通知:
{
"mention_url": "https://example.com/post",
"ai_score": 0.95,
"ai_categories": ["bug_report", "feature_request"],
"timestamp": "2024-02-12T15:30:00Z"
}
Webhook 请求中包含的头部:
Content-Type: application/jsonX-Webhook-Secret: your-secret-token
开发
从源代码构建
# Install dependencies
npm install
# Build the server
npm run build
# Run tests
npm test
添加新功能
- 在
src/中实现新功能 - 在
tests/中添加测试 - 本地构建和测试
- 提交拉取请求
故障排除
- Webhook 错误:确保您的 webhook 端点是可访问的并且支持 HTTPS
- API 密钥问题:验证您的 Syften API 密钥已在配置中正确设置
- 数据库错误:检查
data目录是否存在且可写
贡献
请根据实际需要填充对应的代码块内容(如 #0, #1, ...)。这些标记仅用于指示翻译前后保持一致性的位置。
- Fork 仓库
- 创建特性分支
- 提交你的更改
- 推送到分支
- 创建 Pull Request
许可证
MIT 许可证 - 详情见 LICENSE 文件