nwafu-mcp
mcp-for-nwafactivity · 西北农林科技大学校园信息 MCP 工具集
一套符合 MCP 协议 的智能体工具集,为部署在 任意智能体平台上的 Agent 提供西农校园信息能力:
校园频道热门总结:总结西北农林科技大学官方 QQ 频道 (pd.qq.com/g/inwafu1934)近期热门帖子, 自动归类为「活动 / 竞赛 / 通知 / 推荐 / 贴士 / 求助」等,重要信息附来源标题与链接。
官网快速查询:查询学校官网(www.nwafu.edu.cn) 最近的通知、活动、竞赛、招聘,支持输入「植保学院」「教务处」等关键词缩小范围。
跨站自定义检索:自动拆解问题关键词,在官网全文索引与校园频道近期帖子中 检索并合并输出,排版为易读的 Markdown。
工具列表
工具 | 用途 | 关键参数 |
| 校园频道近期热门帖子总结(热度榜 + 分类 + 来源引用) |
|
| 官网最近通知/活动/竞赛/招聘查询与总结 |
|
| 官网全文检索 |
|
| 跨「官网 + 校园频道」自定义问题检索 |
|
Related MCP server: zju-mcp
快速开始(本地)
cd nwafu-mcp
uv sync --extra dev --extra cookies
uv run mcp-for-nwafactivity频道类工具需要 QQ 频道会话 Cookie(p_uin / uuid / EO-Bot-Js-Token),
首次使用请先导出并配置:
uv run nwafu-export-cookies --out cookies.json
$env:NWAFU_COOKIE_FILE = "F:\path\to\cookies.json"
# 或把 cookies.json 中的 cookie_header 填入环境变量 PDQQ_COOKIES不想手动维护 Cookie?见下文「Cookie 自动化」。
部署到魔搭社区(可托管部署)
项目已发布到 PyPI。魔搭 STDIO 托管只支持 npx / uvx,且只能拉取已发布包,
因此服务配置如下:
{
"mcpServers": {
"nwafu-campus": {
"command": "uvx",
"args": ["mcp-for-nwafactivity"],
"env": {
"PDQQ_COOKIES": "p_uin=xxx; uuid=xxx; EO-Bot-Js-Token=xxx",
"PDQQ_GUILD_ID": "inwafu1934",
"PDQQ_CHANNEL_ID": "670126629"
}
}
}
}创建步骤:
打开 创建 MCP 服务,保持 「从 GitHub 仓库快速创建」。
GitHub 地址填
https://github.com/unielevotor/nwafu-AgentPlatformMCP, 英文名称填nwafu-campus,托管类型选「可托管部署」。平台自动解析本 README 的服务配置并执行部署检测 (
uvx安装包 → 连接 →list_tools),通过后即可在工具页测试使用。
同一份配置也可直接用于 Claude Desktop / Cursor 等本地客户端。
PDQQ_COOKIES 过期后重新导出并在连接时更新;官网类工具无需 Cookie。
如需以远程 HTTP 方式部署(Docker / Serverless),用
mcp-for-nwafactivity --transport streamable-http 启动,详见代码内
--help 与仓库 Dockerfile。
Cookie 自动化(无需手动填 PDQQ_COOKIES)
QQ 频道会话 Cookie 会过期,手动复制容易忘。项目提供两个自动化手段:
本地 Cookie 守护程序
nwafu-cookie-keeper:周期性用浏览器自动刷新 Cookie 并写入cookies.json,可附带启动 HTTP 端点供 MCP 拉取:uv run nwafu-cookie-keeper --serve 127.0.0.1:8765 --token 换成随机长令牌 --out cookies.jsonMCP server 自动拉取:在 MCP 环境里配置
PDQQ_COOKIE_URL指向上面端点的/cookie,server 会按 TTL 自动拉取并缓存,无需手工填写:PDQQ_COOKIE_URL=http://127.0.0.1:8765/cookie PDQQ_COOKIE_TOKEN=换成随机长令牌 PDQQ_COOKIE_REFRESH_TTL=600
本地 / 局域网部署时 keeper 与 MCP 同机即可;若 MCP 部署在魔搭云端,需要把 keeper 端点通过内网穿透(如 Cloudflare Tunnel)暴露为公网 HTTPS 地址。
环境变量
变量 | 说明 |
| QQ 频道会话 Cookie(频道类工具需要) |
| 指向 |
| 远程 Cookie 提供者地址与 Bearer 令牌(自动化) |
| 远程 Cookie 缓存秒数,默认 600 |
| 频道与子版块标识,默认 |
| 单请求超时秒数,默认 30 |
|
|
参考 .env.example。
合规说明
仅抓取公开可见内容,不绕过登录 / 权限校验;内置随机 UA、限速与重试,请勿调低 延迟做高频抓取。重要信息请以官方原文为准。
Available Tools
4 toolscampus_channel_summaryA
抓取西北农林科技大学官方 QQ 频道(https://pd.qq.com/g/inwafu1934)近期帖子,按互动量(点赞+评论)排名出热度榜,并自动归类为活动/竞赛/通知/推荐/贴士/求助/其他,输出 Markdown 总结;每条重要信息都附来源帖子标题与链接。
Inputs: top_n, max_posts, window_hours, comment_top_n, +1 more. Returns: result
campus_question_searchA
对“学校官网 + 校园 QQ 频道”两个信息源做自定义问题检索:先自动从问题中提取关键词,在官网全文索引与频道近期帖子中检索,合并输出 Markdown 结果,每条均附来源标题与链接。
Inputs: question (required), days, keywords, max_results, +1 more. Returns: result
official_site_recentA
查询西北农林科技大学官网(https://www.nwafu.edu.cn/)最近的活动、竞赛、通知、招聘等官方信息并输出 Markdown 总结。支持传入关键词(如学院名)缩小检索范围,例如 keyword='植保学院' 只返回植保学院相关通知。
Inputs: days, keyword, category, max_results. Returns: result
official_site_searchB
对西北农林科技大学官网(含新闻网)执行关键词全文检索,返回 Markdown 排版的结果列表(标题/日期/来源/摘要/原文链接)。
Inputs: query (required), days, keyword, max_results. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a fairly distinct retrieval need: QQ channel hot summaries, official-site recent info, official-site full-text search, and cross-source question search. The only mild overlap is between official_site_recent and official_site_search, but their descriptions make the difference clear enough.
Tool names are consistently lowercase snake_case and follow recognizable source prefixes like campus_* and official_site_*. However, suffixes mix result-oriented terms (summary, recent) with action terms (search), so they do not follow a strict verb_noun pattern throughout.
Four tools is well-scoped for a campus information retrieval server. Each tool covers a distinct retrieval workflow without redundancy, and the set is neither too thin nor overloaded for its stated purpose.
The set covers recent official announcements, full-text official-site search, QQ channel hot content, and a combined question-based search across both sources. A dedicated channel-only keyword search is missing, but campus_question_search partially fills that gap, so the surface is reasonably complete.
Related MCP Connectors
Search MCP servers, agent skills and coding-agent plugins: trending tools and best-of lists.
Unofficial Tavily MCP — wraps the Tavily API (tavily.com)
Search and inspect source-pinned agent skills, plugins and tools through a free public MCP.
Read-only MCP tools for AI agent discovery, structured resources, and NIULAI information.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceMCP server that aggregates department notices and provides structured answers to queries about courses, schedules, and academic dates via tool calling.-
- FlicenseAqualityDmaintenanceEnables interaction with Zhejiang University's learning platform (学在浙大 / 智云课堂) via MCP tools, allowing natural language commands to check todos, view schedules, fetch lecture transcripts, and submit homework.79-
- AlicenseAqualityBmaintenanceProvides Google search, URL extraction, and academic paper inline extraction without API keys, enabling search and content retrieval from a single MCP server.5443 npmMIT
- FlicenseNot gradedqualityBmaintenanceEnables searching the Xiangtan University Computer Science College official website, retrieving article content and attachments, and listing common sections through a Cloudflare-hosted MCP server.-