Social Listening MCP Server

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

社交聆听 MCP 服务器

一个模型上下文协议 (MCP) 服务器,通过 Syften 的 API 提供社交聆听功能。该服务器支持 AI 驱动的社交提及分析,并支持通过 Webhook 发送实时通知。

特征

  • 实时社交提及监控
  • 人工智能驱动的内容分类
  • 重要提及的 Webhook 通知
  • 历史数据回填
  • 趋势分析和报告
  • 自然语言查询支持

先决条件

  1. Node.js(v16 或更高版本)
  2. 具有 API 访问权限的 Syften 帐户
  3. Claude 桌面应用程序或带有 Claude 扩展的 VSCode

安装

  1. 克隆存储库:
git clone https://github.com/fred-em/social-listening.git cd social-listening
  1. 安装依赖项:
npm install
  1. 构建服务器:
npm run build

配置

1. Syften API 设置

  1. 登录您的 Syften 帐户
  2. 转至“设置”>“API 访问”
  3. 如果您还没有生成 API 密钥
  4. 复制您的 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. 配置ai过滤器

配置提及分析的 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. 分析趋势

分析一段时间内的提及趋势。

{ "start_date": "2024-01-01", "end_date": "2024-02-01", "group_by": "day", "tags": ["feature", "bug"] }

6. 获取顶级来源

获得最多提及的来源/作者。

{ "start_date": "2024-01-01", "end_date": "2024-02-01", "limit": 10 }

7. nlp_prompt

处理自然语言查询。

{ "prompt": "show me feedback mentions from last week" }

8. 获取人工智能过滤提及

获取经过 AI 过滤处理的提及。

{ "start_date": "2024-01-01", "end_date": "2024-02-01", "min_confidence": 0.8, "categories": ["feedback", "bug_report"], "limit": 50 }

Claude 中的示例用法

以下是您可以与 Claude 一起使用的一些示例提示:

  1. 配置AI过滤:
Configure the social listening AI filter to detect bug reports and feature requests with 80% confidence.
  1. 设置 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".
  1. 分析趋势:
Show me the trend of bug reports and feature requests from last month.
  1. 获取过滤的提及:
Show me all high-confidence bug reports from the past week.
  1. 自然语言查询:
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/json
  • X-Webhook-Secret: your-secret-token

发展

从源代码构建

# Install dependencies npm install # Build the server npm run build # Run tests npm test

添加新功能

  1. src/中实现新功能
  2. tests/中添加测试
  3. 本地构建和测试
  4. 提交拉取请求

故障排除

  1. Webhook 错误:确保您的 webhook 端点可访问并支持 HTTPS
  2. API 密钥问题:验证您的 Syften API 密钥是否在配置中正确设置
  3. 数据库错误:检查data目录是否存在且可写

贡献

  1. 分叉存储库
  2. 创建功能分支
  3. 提交你的更改
  4. 推送到分支
  5. 创建拉取请求

执照

MIT 许可证 - 详情请参阅许可证文件

ID: axry6nqwll