mcp-ccnu-lib: Instructions file for Claude Code

CLAUDE.md

mcp-ccnu-lib CLAUDE.md is an instructions file for Claude Code from cxdpowered/mcp-ccnu-lib. It costs 1,892 tokens per session, scanned A, original, MIT.

Project-specific instructions for developing and running an MCP server that operates Chinese university library seat reservations. MCP is a standard way for an AI agent to call external tools.

In plain words
What is it for?
Working on the library service that logs in, checks seats, makes or cancels reservations, and manages related seat actions through HTTP APIs and Docker.
Why use it?
It records the project's purpose, required commands, network limits, authentication rules, and testing guidance so development changes follow the intended design.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is cxdpowered/mcp-ccnu-lib's own configuration. It tells Claude Code how to work on mcp-ccnu-lib itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mcp-ccnu-lib configures →

Reuse

Borrowing it

Nothing to install: this file belongs to cxdpowered/mcp-ccnu-lib. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/cxdpowered/mcp-ccnu-lib/master/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/cxdpowered/mcp-ccnu-lib

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mcp-ccnu-lib CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/cxdpowered/mcp-ccnu-lib/claude-md/github.svg)](https://agentmods.dev/instructions/cxdpowered/mcp-ccnu-lib/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/cxdpowered/mcp-ccnu-lib/claude-md"><img src="https://agentmods.dev/badge/instructions/cxdpowered/mcp-ccnu-lib/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mcp-ccnu-lib CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/cxdpowered/mcp-ccnu-lib/claude-md"><img src="https://agentmods.dev/badge/instructions/cxdpowered/mcp-ccnu-lib/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,892 This file is loaded in full into every session.
When invoked 1,892 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.01892 $0.01892
Opus 5.5 $0.00757 $0.00757
Sonnet 5.5 $0.00378 $0.00378
Haiku 4.5 $0.00189 $0.00189

Measured 2mo ago against content hash c79859738feb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

mcp-ccnu-lib CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 55 lines

How it starts

The opening of the file, as written. The whole thing — 55 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

项目定位

华中师范大学图书馆空间预约的 MCP 执行器。被上游"小青团"QQ 机器人当作工具调用:本服务只负责执行(登录、查座、约/取消、暂离/回座/退座、违约/历史/闸机记录),不做 NLU、不做调度、不做提醒——那些在调用方侧。纯 HTTP 实现,无浏览器(历史上用过 Playwright,2026-07 已全量重构为 httpx 直连 CAS + 后端 API)。详尽的对外 API 契约、错误码、部署说明都在 README.md,改动工具签名/返回结构时必须同步更新它。

关键约束:

  • 真实系统 https://kjyy.ccnu.edu.cn/jsq-v/(Vue SPA,CAS 统一认证),仅校园网内可访问,部署机必须在校园网。
  • 验证码/短信走人工输入(challenge 机制),不做 OCR/自动打码——这是产品决策,不要主动加。

常用命令

# 本地开发(不走 Docker)
pip install -e .                            # 装 httpx + cryptography + mcp,无浏览器
python -m ccnu_lib.server                   # 启动,监听 0.0.0.0:8010/mcp (streamable-http)

# Docker(生产推荐)— 轻量 python:slim 镜像,无 Chromium
docker compose up -d --build

# 冒烟测试(先在另一终端启动服务,再跑)— 走真实 MCP 协议,只读不下单
python scripts/smoke_mcp.py

无单元测试(pyproject.toml 列了 pytest 但仓库无 test 文件)。注意 scripts/ 下的老验证/probe 脚本(try_login/try_api/try_reserve/probe*)是 Playwright 时代的,重构后已失效,仅作接口反推的历史参考;真机验证改用临时脚本走 login.start_login/reservations.*。

Windows 本地连 127.0.0.1 的坑:必须设 NO_PROXY=127.0.0.1,localhost,否则系统代理把本地请求也转走 → 502。(WindowsProactorEventLoopPolicy 那条已随 Playwright 移除,纯 HTTP 不需要。)

架构(关键在于两条数据通路 + challenge 中断模型)

工具调用入口在 server.py(@mcp.tool() 装饰,17 个工具,全部接受可选 user_key 做多用户隔离,缺省 default)。每个工具是薄壳,转发到 login.py 或 reservations.py。

核心设计:纯 HTTP。登录复刻 CAS SSO 重定向链,查询/预约直连后端 JSON API 并在 Python 里现算 HMAC 签名。

  1. http_client.py — 进程级单例 HttpManager,每个 user_key 一个 httpx.AsyncClient(cookie jar)。登录态保活载体 = 持久化的 cookie(关键是无过期的 CASTGC,支持静默 SSO 重登)+ 缓存的 app token,一起存 {user_dir}/session.json;建会话时回灌。Session 持有 client/token/realkey/syscfg/asyncio.Lock/pending/login_ctx。

  2. login.py — 纯 HTTP CAS 状态机。ensure_syscfg 打 getSysSet 取配置(含 CASSSERVICE/VUESERVICE/hmacKey)并解出 realkey。_sso_walk GET {CAS}/static/sso/login?redirectUrl={VUE} 手动跟随重定向:落到 CAS 登录表单(200,含 execution)=未登录→抓 captcha.jpg 返回 challenge;直接跳回 VUESERVICE 带 ?token=<JWT>(CASTGC 有效时)=静默登录。submit_challenge POST CAS 表单(username/password/captcha/lt/execution)→跟随 ticket→拿 JWT→auth/cas 换 app token。判定真登录=拿到 app token,不是 URL。

Read the full file on GitHub · 55 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 55 lines · 1,892 tokens per session scan A c79859738feb

Subscribe to this mod's changes

mcp-ccnu-lib CLAUDE.md is an instructions file published in the GitHub repository cxdpowered/mcp-ccnu-lib (0 stars, last pushed 4mo ago), licensed MIT. It adds 1,892 tokens to every session, about $0.0076 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

mcp-ccnu-lib CLAUDE.md compared with instructions from other repositories

mcp-ccnu-lib CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mcp-ccnu-lib CLAUDE.mdcxdpowered/mcp-ccnu-libInstructions file04mo agoMITA1,892Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file144ktodayMITA8,130Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA5,685GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file150ktodayMITA4,680Codex, OpenCode
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file283ktodayMITA4,342Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA3,153GitHub Copilot