Agent / MCP 集成
Infoget Hotspots 面向 AI Agent 暴露 MCP tool:get_news_hotspots。它读取服务端缓存,适合为 Agent 提供中文互联网热点、热榜、趋势话题上下文。
MCP Tool
get_news_hotspots
能力
| action | 说明 |
|---|---|
list_boards |
获取当前支持哪些榜单 |
all_boards |
获取全站全部榜单列表,默认每榜 50 条 |
board_items |
获取单个榜单列表 |
snapshot |
兼容旧热点快照 |
参数
{
"action": "all_boards",
"limit": 50,
"board": "微博热搜"
}
| 参数 | 说明 |
|---|---|
action |
list_boards、all_boards、board_items 或 snapshot |
force |
兼容旧参数;当前不会触发源站抓取 |
limit |
每个榜单或单个榜单最多返回多少条,默认 50 |
board |
board_items 必填,可传榜单名称或榜单 id |
Cursor MCP 配置
把服务地址填入 INFOGET_HOTSPOTS_BASE_URL。
{
"mcpServers": {
"infoget-hotspots": {
"command": "python",
"args": ["-m", "hotspots.mcp_server"],
"cwd": "D:/Projects/Infoget",
"env": {
"INFOGET_HOTSPOTS_BASE_URL": "BASE_URL"
}
}
}
}
调用示例
{"action": "list_boards"}
{"action": "all_boards", "limit": 50}
{"action": "board_items", "board": "微博热搜", "limit": 50}
Agent 行为建议
- 用户问“有哪些榜单 / 支持哪些平台”时,用
list_boards。 - 用户问“全站热点 / 全部榜单”时,用
all_boards,默认limit=50。 - 用户问某个平台或榜单时,用
board_items。 - 不要为了“刷新 / 最新 / 重新拉取”传
force=true;服务端会自动更新缓存。 - 回答时引用
snapshot.fetch_time或snapshot.cache_mtime,不要猜测数据时间。 errors[]非空时,告诉用户哪些源失败或是否使用了缓存。