关于 sociallens
sociallens 提供访问 Rolli IQ 社交搜索与分析功能的 CLI 和 MCP 服务,涵盖关键词、用户和专家搜索,以及 Agent、计划任务和账户用量。每次调用只返回 API 当前状态,不会持续轮询直至完成。
主要功能
- 01按关键词、用户和专家搜索
- 02获取搜索结果和帖子
- 03管理 Agent 运行及计划任务
- 04配置集成并查看用量
- 05提供 CLI 和 stdio MCP 服务
适用场景
- 01查找符合关键词的社交帖子
- 02搜索用户或专家
- 03启动并管理 Agent 运行
- 04检查计划任务运行和账户用量
MCP 相关
通过 stdio MCP 服务将 Rolli IQ 的搜索、分析、Agent、计划任务、集成和用量操作作为工具提供。每次调用仅请求一次 API;仍在运行的搜索可通过对应的 get 工具再次查询。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
30收录的工具列表 · 更新于 1 周前
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| status | string | 否 | 列出项的状态筛选条件。 |
详细介绍
sociallens
sociallens 可调用 Rolli IQ 的社交媒体搜索与分析 API:关键词、用户和专家搜索,以及搜索到的帖子、主题树、Agent 运行、Agent 计划、集成设置和账户用量。一个二进制文件同时提供命令行界面和 stdio MCP 服务。
使用前必须提供 API 令牌。设置 ROLLI_API_TOKEN;如果未设置或为空,所有工具都会在发出请求前报错。ROLLI_USER_ID 是可选的,默认值为 rolli-mcp;每次请求都会发送其值。可以通过 SOCIALENS_API_URL 覆盖 API 基础 URL;未设置时,请求会发送到 https://api.rolli.ai。
有一点与原始服务不同,值得提前了解:原始服务会持续轮询,直到搜索完成(最长可能需要十分钟)。sociallens 每次工具调用只发送一个请求,并返回 API 当时报告的状态和结果;如果搜索仍在运行,请再次调用对应的 get_* 工具查看进度。
安装
npx @reneturcios/sociallens get_usage
或者运行容器镜像:
docker run -i ghcr.io/cloudcorprecords/sociallens
容器默认启动 MCP 服务(见下文)。传入 CLI 参数即可将其用作 CLI。
CLI
子命令与 MCP 工具名称一致:
export ROLLI_API_TOKEN=...
sociallens list_keyword_searches --status completed
sociallens keyword_search --query "electric vehicles" --platforms x,reddit
sociallens get_keyword_search --id ks1
sociallens get_keyword_search_posts --id ks1
sociallens list_user_searches
sociallens user_search --query "@someone"
sociallens list_expert_searches
sociallens expert_search --query "climate science"
sociallens get_topic_tree
sociallens list_agent_runs --status running
sociallens start_agent_run --agent-id ag1 --input "weekly roundup"
sociallens create_agent_schedule --agent-id ag1 --cron-expression "0 9 * * *" --name daily
sociallens pause_agent_schedule --id s1
sociallens list_agent_schedule_runs --id s1
sociallens get_integration_setup
sociallens update_integration_setup --platform slack --enabled true
sociallens get_usage
sociallens --version
结果会输出上游 JSON 载荷。退出代码:成功时为 0;调用失败时为 1(包括缺少令牌或上游 API 错误);用法错误时为 2。
MCP 服务
同一个二进制文件提供两种接口。mcp 子命令会启动 stdio MCP 服务:
npx -y @reneturcios/sociallens mcp
MCP 客户端配置:
{
"mcpServers": {
"sociallens": {
"command": "npx",
"args": ["-y", "@reneturcios/sociallens", "mcp"],
"env": { "ROLLI_API_TOKEN": "..." }
}
}
}
工具
| 工具 | 输入 | 功能 |
|---|---|---|
list_keyword_searches | status(可选) | 列出关键词搜索。 |
keyword_search | query(必填)、platforms、start_date、end_date | 启动关键词搜索。 |
get_keyword_search | id(必填) | 获取一个关键词搜索。 |
list_user_searches | status(可选) | 列出用户搜索。 |
user_search | query(必填)、platforms、start_date、end_date | 启动用户搜索。 |
get_user_search | id(必填) | 获取一个用户搜索。 |
list_expert_searches | status(可选) | 列出专家搜索。 |
expert_search | query(必填)、platforms、start_date、end_date | 启动专家搜索。 |
get_expert_search | id(必填) | 获取一个专家搜索。 |
get_topic_tree | (无) | 获取主题树。 |
get_keyword_search_posts | id(必填) | 获取关键词搜索的帖子。 |
get_user_search_posts | id(必填) | 获取用户搜索的帖子。 |
list_agent_runs | status(可选) | 列出 Agent 运行记录。 |
start_agent_run | agent_id(必填)、input | 启动 Agent 运行。 |
get_agent_run | id(必填) | 获取一条 Agent 运行记录。 |
cancel_agent_run | id(必填) | 取消 Agent 运行。 |
rerun_agent_run | id(必填) | 重新运行 Agent。 |
update_agent_run | id(必填)、name、status | 更新 Agent 运行记录。 |
delete_agent_run | id(必填) | 删除 Agent 运行记录。 |
list_agent_schedules | status(可选) | 列出 Agent 计划任务。 |
create_agent_schedule | agent_id、cron_expression(均为必填)、name | 创建 Agent 计划任务。 |
get_agent_schedule | id(必填) | 获取一个 Agent 计划任务。 |
update_agent_schedule | id(必填)、name、cron_expression、agent_id | 更新 Agent 计划任务。 |
delete_agent_schedule | id(必填) | 删除 Agent 计划任务。 |
pause_agent_schedule | id(必填) | 暂停 Agent 计划任务。 |
resume_agent_schedule | id(必填) | 恢复 Agent 计划任务。 |
list_agent_schedule_runs | id(必填)、status | 列出计划任务的运行记录。 |
get_integration_setup | (无) | 获取集成设置。 |
update_integration_setup | platform、webhook_url、enabled | 更新集成设置。 |
get_usage | (无) | 获取账户用量。 |
platforms 是平台名称数组。日期使用
YYYY-MM-DD 格式,作为 start_date / end_date。
开发
npm install
npm run build # tsc -> dist/
npm test # node test runner over test/*.test.ts, no network (fake fetch fixtures)
npm run dev # run the CLI from source via tsx
许可证
MIT — 详见 LICENSE。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。