Skip to main content
Glama

nwafu-mcp · MCP-Werkzeugsammlung für Campus-Informationen der Northwest A&F University

Die Werkzeugsammlung stellt für Agenten, die auf beliebigen Agentenplattformen bereitgestellt werden, eine Reihe von Werkzeugen bereit, die dem MCP-Protokoll entsprechen. Sie deckt drei Kernfähigkeiten ab:

  1. Zusammenfassung beliebter Beiträge im Campus-Kanal: Ruft die aktuell beliebten Beiträge des offiziellen QQ-Kanals der Northwest A&F University (pd.qq.com/g/inwafu1934) ab, sortiert sie nach Interaktionsrate und klassifiziert sie automatisch in Kategorien wie „Aktivitäten / Wettbewerbe / Ankündigungen / Empfehlungen / Tipps / Hilfegesuche“. Jede wichtige Information enthält Titel und Link des Quellbeitrags und ist damit nachvollziehbar.

  2. Schnelle Suche auf der offiziellen Website: Über die Volltextindizes der offiziellen Universitätswebsite (www.nwafu.edu.cn) und des Nachrichtennetzwerks lassen sich aktuelle Aktivitäten, Wettbewerbe, Ankündigungen und Stellenausschreibungen schnell abrufen; es können Schlüsselwörter wie „Pflanzenschutzkolleg“ oder „Dekanat für Studienangelegenheiten“ übergeben werden, um den Suchbereich einzugrenzen.

  3. Plattformübergreifende benutzerdefinierte Suche: Zerlegt Nutzerfragen automatisch in Suchbegriffe, durchsucht gleichzeitig den Volltextindex der offiziellen Website und die aktuellen Beiträge des Campus-Kanals und führt die Ergebnisse zusammen. Alle Ergebnisse werden als gut lesbares Markdown formatiert und mit Links zu den Originaltexten versehen.


Funktionen und Merkmale

  • MCP-Standardimplementierung: Basierend auf dem offiziellen mcp Python SDK (FastMCP) mit stdio-Übertragung; kann direkt in Claude Desktop, Cursor, Windsurf sowie in alle MCP-fähigen Agentenplattformen integriert werden.

  • Nachvollziehbare Informationen: Alle Ergebnis-Einträge enthalten Quellentitel und Link zum Originaltext; wichtige Informationen erscheinen in separaten Abschnitten für „Wichtige Hinweise / Aktualitätshinweise“.

  • Intelligente Klassifizierung: Eine Regel-Engine ordnet Kanalbeiträge automatisch Kategorien wie „Empfehlungen / Tipps / Aktivitäten / Wettbewerbe / Ankündigungen / Hilfegesuche“ zu; innerhalb der Gruppen wird nach Beliebtheit (Likes + gewichtete Kommentare) sortiert.

  • Präzise Stichwortsuche: Die Suche auf der offiziellen Website unterstützt beliebige Schlüsselwörter zur Eingrenzung (z. B. Fakultätsname, Abteilungsname, Sachgebiet).

  • Robuste Fehlertoleranz: Anforderungs-Timeout, Wiederholungen, zufällige Verzögerungen zur Ratenbegrenzung, Hinweise auf abgelaufene Cookies; ein fehlgeschlagenes Tool beeinträchtigt andere Tools nicht.

  • Datenschutzkonformität: Es werden nur öffentlich sichtbare Inhalte abgerufen; Anmelde- oder Berechtigungsprüfungen werden nicht umgangen. Cookies werden über Umgebungsvariablen injiziert und nicht ins Repository geschrieben.


Related MCP server: zju-mcp

Werkzeugliste

Werkzeug

Verwendung

Wichtige Parameter

campus_channel_summary

Intelligente Zusammenfassung der aktuell beliebten Beiträge des Campus-QQ-Kanals (Beliebtheitsranking + Klassifizierung + wichtige Informationen)

window_hours Zeitfenster, max_posts Abrufmenge, top_n Anzahl der Einträge im Beliebtheitsranking, include_comments ob Top-Kommentare abgerufen werden

official_site_recent

Schnelle Suche und Zusammenfassung der neuesten Ankündigungen/Aktivitäten/Wettbewerbe/Stellenausschreibungen auf der offiziellen Website

category Kategorie, keyword Eingrenzung (z. B. Fakultätsname), days Zeitraum, max_results

official_site_search

Volltextsuche auf der offiziellen Website (benutzerdefinierte Schlüsselwörter)

query Kernbegriff, keyword zusätzlicher Einschränkungsbegriff, days, max_results

campus_question_search

Benutzerdefinierte Fragensuche über „offizielle Website + Campus-Kanal“

question ursprüngliche Frage, keywords optionale explizite Suchbegriffe, days, include_channel

Alle Werkzeuge geben Markdown-Text aus; die Struktur umfasst: Datenquelle, Abrufzeitpunkt, Abfragebedingungen, Ergebnisliste (Titel / Datum / Quelle / Zusammenfassung / Link) und wichtige Hinweise.


Funktionsweise

Campus-QQ-Kanal

Die Webversion des Tencent-Kanals ist rein clientseitig gerendert; die öffentlichen Daten stammen von einem protobuf-over-JSON-Gateway:

POST https://pd.qq.com/qunng/guild/gotrpc/noauth/trpc.qchannel.commreader.ComReader/<Method>
x-oidb: {"uint32_service_type": 11 时间线 | 5 评论}

Die öffentlichen Inhalte sind anonym lesbar, aber das Gateway verlangt browserbezogene Sitzungs-Cookies (p_uin + uuid + EO-Bot-Js-Token). Dieses Werkzeug:

  • Ruft standardmäßig die letzten N Beiträge (sortiert nach Veröffentlichungszeit) aus dem Unterforum „Beitragsbereich“ (670126629) ab;

  • Schätzt die Beliebtheit anhand von 点赞数 + 2 × 评论数 und wählt die beliebtesten Beiträge im Zeitfenster aus;

  • Eine Regel-Engine klassifiziert automatisch; wichtige Informationen (Ankündigungen/Bekanntmachungen/Anmeldungen/Fristen/Prüfungen usw.) werden gesondert hervorgehoben;

  • Optional können für Beiträge im Beliebtheitsranking die Top-Kommentare abgerufen werden (GetFeedComments).

Hinweis: Die Schnittstelle „Beliebtheitssortierung“ von GetGuildFeeds liefert nachweislich leere Daten. Daher verwendet das Beliebtheitsranking das Schema „aktuelle Beiträge × Interaktionsrate“, was der Bedeutung von „aktuell beliebt“ besser entspricht.

Offizielle Universitätswebsite

Die Hauptwebsite und das Nachrichtennetzwerk der Universität verwenden die Volltextsuche von 通元 CMS:

GET https://www.nwsuaf.edu.cn/cms/web/search/index.jsp
    ?query=<关键词>&siteID=<站点ID>&searchScope=0&channelID=&matchType=0
    &sortField=publishDate&order=1&date=<3|6|12>&page=<页码>
  • siteID=32e6d9be... ist der Index der Hauptwebsite (umfasst alle Fakultäten/Abteilungen der Universität);

  • Generiert Suchbegriffe pro Kategorie (Ankündigungen/Bekanntmachungen, Aktivitäten/Vorträge/Foren, Wettbewerbe, Stellenausschreibungen usw.), ruft nach der Kombination mit Benutzerschlüsselwörtern seitenweise ab und extrahiert Titel, Datum, Quelle, Zusammenfassung und Link zum Originaltext;

  • Der Zeitraum ist standardmäßig auf die letzten 90 Tage festgelegt (abgebildet auf den 3/6/12-Monats-Filter des Index).


Schnellstart (lokale Ausführung)

cd nwafu-mcp
uv sync --extra dev
uv run nwafu-export-cookies --out cookies.json

Das Skript öffnet die Kanalseite mit dem lokalen Edge/Chrome, erstellt eine Sitzung und exportiert das Cookie. Anschließend wird der cookie_header aus cookies.json in eine Umgebungsvariable geschrieben:

$env:PDQQ_COOKIES = "p_uin=xxx; uuid=xxx; EO-Bot-Js-Token=xxx"
# 或
$env:NWAFU_COOKIE_FILE = "F:\path\to\cookies.json"

Cookies laufen ab (das Anti-Crawling-Token ist an die Browserinstanz gebunden). Bei einer Cloud-Bereitstellung wird empfohlen, sie regelmäßig zu aktualisieren.

2. Werkzeugfunktionen direkt testen (ohne MCP-Client)

uv run python -c "
import os
os.environ['NWAFU_COOKIE_FILE'] = 'cookies.json'
from nwafu_mcp.server import official_site_recent
print(official_site_recent(category='通知', keyword='植保学院'))
"

3. Als MCP-Server ausführen

uv run nwafu-mcp

Anbindung an MCP-Clients

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "nwafu-campus": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/unielevotor/nwafu-AgentPlatformMCP",
        "nwafu-mcp"
      ],
      "env": {
        "PDQQ_COOKIES": "p_uin=xxx; uuid=xxx; EO-Bot-Js-Token=xxx"
      }
    }
  }
}

Cursor / Windsurf / Allgemeine Plattformen (JSON-Form)

{
  "mcpServers": {
    "nwafu-campus": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/unielevotor/nwafu-AgentPlatformMCP", "nwafu-mcp"],
      "env": {
        "PDQQ_COOKIES": "p_uin=xxx; uuid=xxx; EO-Bot-Js-Token=xxx",
        "PDQQ_GUILD_ID": "inwafu1934",
        "PDQQ_CHANNEL_ID": "670126629"
      }
    }
  }
}

Alternativ kann das Paket über pip install git+https://github.com/unielevotor/nwafu-AgentPlatformMCP installiert und dann direkt mit dem Befehl nwafu-mcp gestartet werden.


GitHub-Bereitstellungsschritte

  1. In das GitHub-Repository (unielevotor/nwafu-AgentPlatformMCP) pushen:

git remote add origin https://github.com/unielevotor/nwafu-AgentPlatformMCP.git
git push -u origin main
  1. Sicherstellen, dass das Repository Public ist (bei einem privaten Repository muss die Ziel-Agentenplattform auf GitHub-Anmeldeinformationen zugreifen können).

  2. Den obigen Startbefehl uvx --from git+... in die MCP-Konfiguration der Agentenplattform eintragen und Umgebungsvariablen wie PDQQ_COOKIES injizieren.


Umgebungsvariablen

Variable

Erforderlich

Beschreibung

PDQQ_COOKIES

Für Kanal-Werkzeuge erforderlich

Browser-Sitzungs-Cookie des QQ-Kanals

NWAFU_COOKIE_FILE

Für Kanal-Werkzeuge erforderlich

Verweist auf das von nwafu-export-cookies exportierte JSON

PDQQ_GUILD_ID

Nein

Standard inwafu1934

PDQQ_CHANNEL_ID

Nein

Unterforum-ID, Standard 670126629 (Beitragsbereich)

PDQQ_MIN_DELAY / PDQQ_MAX_DELAY

Nein

Abstand zwischen Kanalanfragen (Sekunden), Standard 0.3–0.8

NWAFU_TIMEOUT

Nein

Timeout pro Anforderung (Sekunden), Standard 30

Siehe .env.example.


Beispielausgabe (Auszug)

# 🎓 西农校园频道 · 近期热门总结

> 数据来源:西北农林科技大学官方 QQ 频道 | 时间窗口:近 72 小时 | 帖子数:48

## 🔥 热度榜
1. **中元节鬼是真的多啊…**(👍7 · 💬1 · 08-27)
   来源:[中元节鬼是真的多啊](https://pd.qq.com/g/inwafu1934/post/...)

## 🏆 竞赛(2)
- **关于举办2026年创新创业大赛的通知**(👍5 · 💬2 · 08-26)
  来源:[…](https://pd.qq.com/g/inwafu1934/post/...)

## ⚠️ 重点信息(建议优先查看)
- [关于选课时间安排的通知](https://pd.qq.com/g/inwafu1934/post/...)
# 📢 西北农林科技大学官网 · 近期信息查询

> 查询条件:分类=通知 | 关键词=植保学院 | 时间范围:近 90 天 | 结果数:12

1. **关于举办2026年植保论坛系列学术报告会(十七)的通知**(2026-08-26 · 植物保护学院)
   [查看原文](https://ppc.nwafu.edu.cn/xzbg/...)

Konformität und Nutzungsempfehlungen

  • Es werden nur öffentlich sichtbare Inhalte abgerufen; Anmelde-, Zahlungs- oder Berechtigungsprüfungen werden nicht umgangen.

  • Es sind bereits zufällige User-Agents, zufällige Verzögerungen und Wiederholungsversuche eingebaut. Verringern Sie bei der Bereitstellung die Verzögerungen nicht für hochfrequente Abrufe und beachten Sie die Nutzungsbedingungen der Zielplattform sowie geltende Gesetze wie das „Gesetz zum Schutz personenbezogener Informationen“.

  • Bitte verlassen Sie sich bei wichtigen Informationen (Anmeldefristen, Prüfungspläne usw.) auf die offiziellen Originaltexte; die Werkzeugausgabe dient nur der schnellen Übersicht.

  • Kanal-Cookies enthalten Sitzungskennungen. Committen Sie sie niemals in ein öffentliches Repository und injizieren Sie sie unbedingt über Umgebungsvariablen.


Häufige Fragen

Symptom

Lösung

Kanal-Werkzeug meldet „Kein Cookie konfiguriert“

Lokal nwafu-export-cookies --out cookies.json ausführen und dann die Umgebungsvariable konfigurieren

Kanal-Werkzeug meldet retcode=150/4000

Cookie ist abgelaufen oder Anti-Crawling-Token fehlt; erneut exportieren

Suche auf der offiziellen Website liefert keine Ergebnisse

days erweitern, Schlüsselwörter entfernen oder Kategorie wechseln und erneut versuchen

Kein Edge/Chrome in der Cloud

playwright installieren und python -m playwright install chromium ausführen, oder regelmäßig lokal Cookies exportieren und injizieren

Verzeichnisstruktur

src/nwafu_mcp/
  server.py          MCP 服务器与四个工具定义
  qq_channel.py      QQ 频道数据层(时间线/热评)
  official_site.py   官网全文检索数据层
  classify.py        帖子分类与热度评分
  format.py          Markdown 报告排版
  config.py          环境变量与默认配置
  export_cookies.py  本地导出频道 Cookie 的 CLI
tests/               单元测试
scripts/mcp_smoke.py 端到端 MCP 冒烟测试(连接 stdio server 并调用全部工具)

Available Tools

4 tools
campus_channel_summaryA

抓取西北农林科技大学官方 QQ 频道(https://pd.qq.com/g/inwafu1934)近期帖子,按互动量(点赞+评论)排名出热度榜,并自动归类为活动/竞赛/通知/推荐/贴士/求助/其他,输出 Markdown 总结;每条重要信息都附来源帖子标题与链接。

NameRequiredDescriptionDefault
top_nNo
max_postsNo
window_hoursNo
comment_top_nNo
include_commentsNo

Output Schema

NameRequiredDescription
resultYes

TDQS

A3.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It transparently discloses the source URL, ranking formula, automatic categorization, Markdown output, and source attribution. It does not mention failure modes or rate limits, but the core behavior is clearly described.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single dense sentence that front-loads the fetch action, source, ranking, categorization, and output format. Every clause is relevant, though a more structured breakdown of parameters would improve readability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The output schema covers return structure, and the description explains source, ranking, categories, and citations. However, with five parameters and no explicit guidance on when to invoke this tool versus siblings, the description is not fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description does not explain any of the five parameters. Terms like 'top_n' and 'window_hours' are only indirectly related to '热度榜' and '近期帖子', while max_posts, comment_top_n, and include_comments receive no clarification.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action: fetch recent posts from a named QQ channel, rank them by likes+comments, categorize them into seven types, and output a Markdown summary with source links. It clearly identifies the resource and unique behavior, distinguishing it from a plain recent-posts or search tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies this tool is for obtaining a ranked, categorized summary of QQ-channel posts rather than raw retrieval or search. It does not explicitly state when to use this tool versus the sibling tools or describe exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

official_site_recentA

查询西北农林科技大学官网(https://www.nwafu.edu.cn/)最近的活动、竞赛、通知、招聘等官方信息并输出 Markdown 总结。支持传入关键词(如学院名)缩小检索范围,例如 keyword='植保学院' 只返回植保学院相关通知。

NameRequiredDescriptionDefault
daysNo
keywordNo
categoryNo全部
max_resultsNo

Output Schema

NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the behavioral burden; it discloses that this is a read-only query of the official site and that output is a Markdown summary, plus that keyword narrows the results. It does not mention rate limits, freshness boundaries, or failure modes, but for a simple read tool the key behavioral traits are disclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with no filler: the first establishes tool, source URL, content scope, and output format; the second gives the key parameter example. The most load-bearing information is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple and the output schema is present, which covers return structure. However, the description does not explain three of the four parameters, nor does it position the tool against official_site_search, so an agent still has meaningful uncertainty about how to set days/category/max_results and when to choose this over its siblings.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, but only keyword is given real meaning (with the '植保学院' example). days, category, and max_results are left to inference from their names and defaults, which is insufficient with no schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb–resource pair: query the NWAFU official website for recent activities, competitions, notices, and recruitment information, then output a Markdown summary. It does not explicitly distinguish itself from official_site_search or the other siblings, so it loses a point for lacking sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The intended use—retrieving recent official-site news—is implied and there is a concrete keyword example, but no alternative tools are named and no when-not-to-use conditions are given. Sibling tools like official_site_search could overlap, yet the description does not route the agent between them.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv0.1.0
    • First observedcampus_channel_summary
    • First observedcampus_question_search
    • First observedofficial_site_recent
    • First observedofficial_site_search

TDQS

A3.7/5.0

Scored across 4 tools

Disambiguation4/5

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.

Naming Consistency4/5

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.

Tool Count5/5

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.

Completeness4/5

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.

Maintenance

ActivityStale
ResponsivenessNo recent community issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    A
    quality
    D
    maintenance
    Enables 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.
    7
    9
    -
  • A
    license
    A
    quality
    B
    maintenance
    Provides Google search, URL extraction, and academic paper inline extraction without API keys, enabling search and content retrieval from a single MCP server.
    5
    601 npm
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    Enables searching the Xiangtan University Computer Science College official website, retrieving article content and attachments, and listing common sections through a Cloudflare-hosted MCP server.
    -