Skip to main content
Glama

PaperBridge

供个人使用的西浦历年试卷检索与 PDF 保存工具,通过本地 MCP 接入 Codex、DeepSeek Harness。每位使用者使用自己的学校账号登录,文件保存在自己的电脑。

这是独立的非官方项目,只有试卷功能。无需油猴或 Computer Use。项目不提供共享账号、预置登录信息或试卷合集。

安装

需要 Node.js 20+、Chrome 或 Edge,以及能运行本地 stdio MCP 的 AI 客户端。先安装并打开一次 Codex 或 DeepSeek Harness。

在终端粘贴这一行,按提示选择要连接的客户端,并在弹出的窗口完成学校登录:

npx -y xjtlu-paperbridge@latest setup

如果让 AI 代为安装,使用下面这一行,只接入检测到的 Codex / Harness。安装后重启客户端,再由本人完成试卷库登录:

npx -y xjtlu-paperbridge@latest setup --yes --clients codex,deepseek-harness --no-login

安装器将程序放到 ~/.paperbridge/app,修改前备份客户端配置,保留其他 MCP 服务。npm 包只含程序和说明,不包含会话或试卷。升级时重新运行同一行命令,再重启 AI 客户端即可。

也可以从 GitHub 安装源码:

git clone https://github.com/shanyuzhang/xjtlu-paperbridge.git
cd xjtlu-paperbridge
npm ci --ignore-scripts
node bin/paperbridge.js setup --yes --clients codex,deepseek-harness --no-login

完全退出并重开 AI 客户端,问「帮我找 FIN104 的历年试卷,区分正考和补考,下载我选的那份」。首次使用,工具会提示本人登录。

升级时,在仓库目录运行 git pull --ff-only、npm ci --ignore-scripts,再运行相同的 setup 命令,最后重启 AI 客户端。

Related MCP server: examintel-mcp

本人登录

安装后也可以直接运行:

npx -y xjtlu-paperbridge@latest login
npx -y xjtlu-paperbridge@latest status

源码目录内使用:

node bin/paperbridge.js login
node bin/paperbridge.js status

在专用普通 Chrome / Edge 窗口完成学校登录,点击 Past Exam Papers,由本人阅读确认试卷使用协议,再搜索一次课程代码。会话保存后窗口自动关闭。AI 也能用 paperbridge_login 打开窗口,再检查 paperbridge_status。

日常浏览器和其他程序的登录不会自动同步到 PaperBridge。会话过期时重新登录;不需要向 AI 发送密码、Cookie 或 token,也不要分享本机数据目录。学校网络不可达时检查自己的校园网络或 VPN。

MCP 工具

工具

用途

paperbridge_status

检查本人会话及登录进度

paperbridge_login

打开本人专用登录窗口,立即返回

paperbridge_search

按 course_code 检索,返回记录 ID 和 next_page

paperbridge_details

按 record_ids 读取学年、学期、正考 / 补考类型

paperbridge_download

按检索记录 ID 保存 PDF,一次最多 20 份

有下一页时继续检索。相同标题可能对应正考和补考,选择前应读取详情。下载只处理当前账号有阅读权限的学校 PDF,检查文件头和结束标记,限制 60 MB;相同内容去重,不覆盖同名不同内容。工具只返回元数据和本地路径,不返回试卷正文或临时签名 URL。

保存 PDF 属于本地写盘操作。客户端请求审批时允许该次下载即可;禁止审批的只读模式可能拒绝保存。

本地文件与配置

  • 会话和配置:~/.paperbridge/,含 session.json、login-browser/ 和 config.json。

  • 默认 PDF:~/Documents/PaperBridge/<课程代码>/。

  • PAPERBRIDGE_HOME 覆盖数据目录;PAPERBRIDGE_DOWNLOADS 或 --downloads <目录> 覆盖下载目录。

  • PAPERBRIDGE_BROWSER 可指定 chrome、msedge 或 chromium。默认查找系统 Chrome / Edge。

学校会话属于敏感信息。仓库不包含本人会话、浏览器配置、PDF、.env 或任何真实凭据;安装后也不自动读取其他程序的会话。每位使用者须自行确认学校条款及资料使用范围,不要公开转发下载的试卷。

手动接入

运行 node bin/paperbridge.js config 获取这台电脑的准确 JSON。Codex 使用:

[mcp_servers.paperbridge]
command = "/absolute/path/to/node"
args = ["/absolute/path/to/bin/paperbridge.js", "serve"]

DeepSeek Harness 使用 DSH_HOME/cordis.patch.yml,未设置 DSH_HOME 时为 ~/.dsh/cordis.patch.yml。将以下 patch 合并到已有列表,路径换成本机绝对路径;需使用包含官方 MCP 客户端插件的新版 Harness。

- insert:
    - id: mcp-paperbridge
      name: '@deepseek-ai/dsh-mcp-client'
      config:
        serverName: paperbridge
        transport: stdio
        command: /absolute/path/to/node
        args: [/absolute/path/to/bin/paperbridge.js, serve]

验证与开发

npm test
node scripts/verify-live.mjs --course-code FIN104

自动测试使用本地假学校接口及真实 MCP transport,验证检索、权限拒绝、PDF 保存、去重、独立登录和配置合并。真实验证命令需要本人登录,并会保存一份选定试卷及检查 PDF 页数。它不打印会话或题目正文。

2026-10-18,PaperBridge 0.1.0 在 macOS 上通过 17 项自动测试;Codex CLI 和 DeepSeek Harness 均通过独立的 paperbridge_* 工具完成 FIN104 检索(6 条)、详情及 PDF 下载。独立解析确认所选试卷为 426316 字节、6 页。Windows / Linux 尚未真机验证。协议或学校接口变化后可能需要更新;保存的会话过期时,状态检查会要求本人重新登录。

MIT 许可,保留复用代码的作者信息,见 LICENSE。

Available Tools

5 tools
paperbridge_detailsA
Read-only

读取检索得到的试卷详情,返回学年、学期和考试类型(Final 正考 / Resit 补考),一次最多 20 份。用于区分同年同名的试卷,不读取题目正文。

ParametersJSON Schema
NameRequiredDescriptionDefault
record_idsYes

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, non-destructive, openWorld), so the description's added context is what earns credit: the 20-record cap per call, the exact return fields, and the explicit statement that question bodies are not read. It does not mention error behavior or what happens with invalid/nonexistent IDs.

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 tight sentences: the read action plus return fields come first, then the distinguishing purpose, then the negative scope. No filler, and everything needed to route the call is front-loaded.

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

Completeness4/5

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

With no output schema, the description correctly names the returned fields, and with annotations covering safety it need not re-explain read-only behavior. It does not address behavior when some of the up-to-20 IDs are missing or invalid, which is a minor gap for a batch lookup tool.

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

Parameters4/5

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

Schema description coverage is 0%, but the description compensates by stating the 20-item ceiling (matching maxItems) and, more importantly, indicating that the record_ids originate from a prior search rather than being arbitrary identifiers. The numeric-string pattern is left to the schema, but the origin constraint is real added meaning.

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?

States a specific verb and resource (读取检索得到的试卷详情) and enumerates the returned fields: 学年、学期、考试类型. It also explicitly contrasts with the content-fetching sibling by noting 不读取题目正文, so an agent can separate it from paperbridge_download without opening schemas.

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

Usage Guidelines4/5

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

Gives a clear usage context (用于区分同年同名的试卷) and implies a workflow prerequisite by scoping input to 检索得到的 records, i.e. IDs must come from paperbridge_search. It does not explicitly name or exclude the download sibling as an alternative, so it stops short of a 5.

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

paperbridge_downloadA

将检索结果中选定的试卷 PDF 保存到本人电脑,按课程代码归档。record_ids 必须来自 paperbridge_search,一次最多 20 份,按顺序下载并校验 PDF;不返回 Cookie、token 或临时签名链接。

ParametersJSON Schema
NameRequiredDescriptionDefault
record_idsYes

TDQS

A4.4/5.0
Behavior4/5

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

Adds real behavior beyond the annotations: files are written locally (consistent with readOnlyHint=false), downloads happen in order, each PDF is verified, and the response deliberately excludes cookies, tokens, and signed URLs. The remaining gap is what a failed/partial verification looks like and whether re-downloads are skipped, but the disclosure is well above the annotation baseline.

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?

Purpose is front-loaded in the first clause; every following clause (provenance, cap, ordering, verification, credential non-return) adds information. It is dense and bundles several concerns into one long sentence, but there is no filler.

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

Completeness5/5

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

For a single-parameter tool with no output schema, the description covers source of IDs, batch limit, ordering, verification, and output content restrictions — everything needed to invoke it correctly and interpret the result.

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

Parameters4/5

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

Only one parameter with 0% schema description coverage, so the description carries the burden — it supplies the provenance constraint (must come from paperbridge_search) and restates the 20-item cap. It does not explain the numeric-string pattern, but the schema already enforces that.

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?

States a concrete verb+resource: download selected exam-paper PDFs from search results and archive them locally by course code. The scope ('from search results', 'to your own computer') clearly separates it from paperbridge_search and paperbridge_details.

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

Usage Guidelines4/5

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

Explicitly routes the agent: record_ids must originate from paperbridge_search, and at most 20 per call. It gives a clear precondition and a batch limit, though it does not state any when-not-to-use case (e.g. already-downloaded items) or name an alternative tool for bulk retrieval.

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

paperbridge_loginA

为本人打开试卷库专用登录窗口。本人完成学校 SSO、阅读并确认试卷使用协议,再搜索一次课程代码。立即返回,随后用 paperbridge_status 检查;不代填密码、不自动同意协议。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.7/5.0
Behavior5/5

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

The annotations declare readOnlyHint=false, openWorldHint=true, and destructiveHint=false, but the description adds critical behavior the annotations do not cover: it returns immediately, does not fill in passwords on the user's behalf, and does not auto-agree to the usage agreement. This human-in-the-loop, non-blocking behavior is essential for correct invocation.

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?

The description is compact and front-loaded, starting with the tool's core action and then covering the required human steps, immediate return, follow-up tool, and constraints. Every clause earns its place with no redundant restatement of the name or schema.

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

Completeness5/5

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

Given the tool's simplicity (no parameters, no output schema) and the annotation coverage for openness and non-destructiveness, the description is complete. It tells the agent exactly what will happen, what the user must do, and what to do next, leaving no critical gap for correct invocation.

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

Parameters4/5

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

The tool has zero parameters, so there are no parameter semantics to clarify. Per the evaluation baseline for 0-parameter tools, a score of 4 is appropriate.

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 verb and resource: '打开试卷库专用登录窗口' (open the dedicated login window for the exam paper library). It also distinguishes the tool from siblings by naming paperbridge_status as the follow-up checker, so an agent can tell this apart from search, download, or details without opening another schema.

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

Usage Guidelines4/5

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

The description gives clear usage context: the user completes SSO, reads and confirms the agreement, searches a course code, and then the agent should check with paperbridge_status. It lacks an explicit when-not-to-use condition (e.g., if already authenticated), so it is clear but not fully exhaustive.

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

paperbridge_statusB
Read-only

检查西浦图书馆历年试卷库独立登录状态和登录进度。PaperBridge 使用独立的本人会话。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false and openWorldHint=true, so the safety profile is covered. The description's added value is the note that PaperBridge uses an independent per-user session, which tells the agent the status is caller-specific rather than global. It says nothing about polling cadence, whether concurrent login attempts matter, or what the returned progress represents — meaningful gaps for a tool whose whole purpose is watching login progress.

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 short sentences, no filler, with the resource and the session caveat front-loaded. Every clause carries information an agent needs.

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?

With no output schema and no parameters, the description is the only source of detail about what the agent will get back. It identifies the subject (login status and progress) but never describes what those fields look like or their possible states, leaving the agent to guess on the return value. Adequate but with a clear gap.

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

Parameters4/5

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

The tool takes zero parameters, so the schema carries no semantic burden and 4 is the baseline. The description correctly implies all state is resolved from the caller's session rather than from arguments.

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?

States a specific verb (检查) plus resource (登录状态和登录进度) scoped to 西浦图书馆历年试卷库, so the agent knows this is a status read rather than a login action. It does not name or contrast with the sibling paperbridge_login, which is the tool it is most easily confused with, so it stops short of a 5.

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

Usage Guidelines2/5

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

There is no explicit when-to-use, when-not-to-use, or alternative routing. The word 进度 implies polling during login, but the description never says to call this while paperbridge_login runs, nor what to do with the result. Usage is only faintly inferable from the purpose statement.

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. 5 tool updatesv0.1.0
    • First observedpaperbridge_details
    • First observedpaperbridge_download
    • First observedpaperbridge_login
    • First observedpaperbridge_search
    • First observedpaperbridge_status

TDQS

A4.2/5.0

Scored across 5 tools

Disambiguation5/5

Each tool targets a distinct step or resource: login, status, search, details, and download. Their boundaries are reinforced by cross-references (e.g. details needed before filtering, record_ids must come from search), leaving no realistic confusion.

Naming Consistency4/5

All five tools share the same `paperbridge_` prefix followed by a short identifier (search, details, download, status, login). The suffixes mix verbs and nouns (download/search vs details/status), a minor deviation but the pattern remains predictable and readable.

Tool Count5/5

Five tools map cleanly onto a search-inspect-download workflow with authentication states. Each tool earns its place with no redundancy or bloat.

Completeness5/5

The surface covers the full lifecycle: authenticating (login/status), discovering (search), disambiguating (details), and retrieving (download). No obvious gaps remain for this domain.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Read-only MCP server for Chaoxing (学习通) that logs into a user's account and exposes their class schedule, enrolled courses, course materials downloads, homework status, exam schedules and scores, chapter task-point progress, notices, and personal cloud drive files. Enables any MCP client to answer natural-language questions about a student's coursework without submitting anything or modifying account data.
    7
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables natural-language, read-only access to a user's own learning-management account for courses, assignments and deadlines, lecture attendance, notices, grades, and syllabus evidence, including reading page/slide/cell locations inside PDF, Office, HWP/HWPX, HTML, and ZIP attachments. Runs locally over stdio or remotely over OAuth-protected Streamable HTTP for desktop and mobile clients, and can compare changes against a locally encrypted baseline.
    MIT