Skip to main content
Glama
EviterLesRoses2

cc98-mcp

README.md
# cc98-mcp

CC98(浙江大学校网论坛)的 MCP server,让 Claude 可以搜索、阅读、整合论坛信息。基于 CC98 官方 REST API(`api.cc98.org`,OpenID 认证),全部工具**只读**,不会发帖/回帖/点赞。

## 工具列表

| 工具 | 功能 |
|---|---|
| `cc98_search_topics` | 全站搜索主题帖 |
| `cc98_get_posts` | 读取帖子楼层内容(UBB 已清洗为纯文本) |
| `cc98_hot_topics` | 今日/本周/本月/历史十大 |
| `cc98_new_topics` | 全站最新主题帖 |
| `cc98_list_boards` | 全部分区与版面 |
| `cc98_get_board_topics` | 某版面的主题帖(可只看精华) |
| `cc98_get_user` | 用户公开资料及最近发帖 |
| `cc98_get_image` | 下载帖子中的图片并返回图片本体(供 AI 直接查看) |
| `cc98_download` | 将帖子中的图片/附件下载到本地(默认 ~/Downloads/cc98) |
| `cc98_status` | 连接与登录状态自检 |

## 网络要求

按优先级自动选择(`CC98_WEBVPN_MODE=auto`,默认):

1. **直连** — 校园网内,或校外但 IPv6 可达 `api.cc98.org`(CC98 有公网 IPv6)
2. **WebVPN** — 直连失败时,用浙大统一认证账号自动登录 `webvpn.zju.edu.cn` 中转

也可以强制:`CC98_WEBVPN_MODE=direct`(只直连)或 `vpn`(只走 WebVPN)。

## 配置

环境变量:

| 变量 | 必需 | 说明 |
|---|---|---|
| `CC98_USERNAME` | 是 | CC98 论坛用户名 |
| `CC98_PASSWORD` | 是 | CC98 论坛密码 |
| `CC98_WEBVPN_MODE` | 否 | `auto`(默认)/ `direct` / `vpn` |
| `ZJU_USERNAME` | 否 | 浙大统一认证学号(仅 WebVPN 需要) |
| `ZJU_PASSWORD` | 否 | 浙大统一认证密码(仅 WebVPN 需要) |

> WebVPN 若提示需要验证码,先在浏览器登录一次 `webvpn.zju.edu.cn` 再重试。

## 构建与接入

```bash
git clone https://github.com/<your-account>/cc98-mcp.git
cd cc98-mcp
npm install && npm run build
```

接入 Claude Code(把 `/path/to/cc98-mcp` 换成你 clone 的实际路径):

```bash
claude mcp add cc98 \
  -e CC98_USERNAME=你的用户名 \
  -e CC98_PASSWORD=你的密码 \
  -- node /path/to/cc98-mcp/dist/index.js
```

或在 Claude Desktop 的 `claude_desktop_config.json` 中:

```json
{
  "mcpServers": {
    "cc98": {
      "command": "node",
      "args": ["/path/to/cc98-mcp/dist/index.js"],
      "env": {
        "CC98_USERNAME": "你的用户名",
        "CC98_PASSWORD": "你的密码"
      }
    }
  }
}
```

## 致谢

- API 端点与 WebVPN 实现参考 [Lucent-Snow/CC98-CLI](https://github.com/Lucent-Snow/CC98-CLI)(MIT)
- [CC98 API 文档](http://cc98-frontend-development.github.io/API/index.html) / [ZJU-CC98/Forum](https://github.com/ZJU-CC98/Forum)

TDQS

A3.6/5.0

Scored across 10 tools

Disambiguation5/5

Each tool targets a distinct function: downloading, browsing boards, reading posts, user info, hot topics, listing boards, new topics, search, and status. No overlap in purpose.

Naming Consistency4/5

All tools start with 'cc98_' and mostly follow a verb_noun pattern (e.g., cc98_get_posts, cc98_search_topics). Minor inconsistency with cc98_hot_topics (adjective_noun) and cc98_status (noun only), but overall clear.

Tool Count5/5

10 tools is well-scoped for a forum reader: covers browsing, searching, reading, downloading, and status checking. Neither too few nor too many.

Completeness2/5

The tool set is read-only; missing create, update, delete operations for posts, topics, replies, or user interaction. Significant gap for full forum support.

Maintenance

ActivityInactive
ResponsivenessNo issues