shiban-mcp(师伴需求理解与契约校验 MCP)
为「师伴」01 需求理解 与案例导览智能体提供的标准 MCP(支持 Stdio 与可选 Streamable HTTP / SSE),打包内置了全库快照数据,支持离线与云端 uvx 独立运行。
1. 提供的 3 个工具
| 工具名 | 作用 |
|---|---|
lookup_topic_and_contract |
根据教师需求匹配 150 个已注册主题(topics.py / topics_extra.py)、136 个页面场景骨架(scene_registry.py)和 115 条案例清单,返回标准自变量、安全数值上限、核心公式及边界告警(危险实操 / P3 不做项 / 开放表达) |
validate_requirement_json |
按 01 -> 02 -> 03 -> 04 下游契约校验 9 字段 JSON(必填字段、实验名称 <= 10 字、变量结构完整度与安全数值上限) |
search_case_catalog |
按关键词、学科、学段检索 115 条全学段教学实验案例清单 |
2. 目录结构
shiban_mcp/
├── pyproject.toml uvx / pip 安装配置,入口命令为 shiban-mcp
├── export_snapshot.py 从上层 topics / scene_registry / 案例清单导出快照
├── src/shiban_mcp/
│ ├── data/registry_snapshot.json 随包打包的快照数据(150 主题 / 136 骨架 / 115 案例)
│ ├── registry.py 查询、边界拦截与 JSON 校验逻辑
│ ├── server.py MCP 服务入口(默认 stdio,也支持 streamable-http / sse)
│ └── __main__.py
└── tests/
└── test_shiban_mcp.py 单元测试 + 真实 stdio JSON-RPC 端到端测试
3. 本地运行与同步快照
当上层 topics.py、scene_registry.py 或 06_full_catalog/全学段案例清单.json 更新后,先刷新随包快照再跑测试:
python shiban_mcp/export_snapshot.py
python -m unittest shiban_mcp/tests/test_shiban_mcp.py -v
本地直接启动 Stdio MCP:
cd shiban_mcp
pip install -e .
shiban-mcp
4. 部署到华为云 AgentArts 的填写方式
AgentArts 云端 Stdio 框只支持 npx 或 uvx 安装命令,不会读取你本地的 D:\codeplus\ICT\main 目录:
- 方式 A(通过 GitHub 仓库 +
uvx拉取,前提是推到sixpenceeeee/ICT且平台容器可访问 GitHub):- 选择类型:
Stdio - 启动命令:
uvx - 参数:
--from、git+https://github.com/sixpenceeeee/ICT.git#subdirectory=shiban_mcp、shiban-mcp
- 选择类型:
- 方式 B(发布到 PyPI 后用
uvx,最稳):- 在
shiban_mcp/下打包发布到 PyPI(如shiban-mcp)后,AgentArts 直接填命令uvx、参数shiban-mcp。
- 在
- 方式 C(若平台网络不允许从 GitHub 安装或你想直接连本地/ECS 机器):
- 改用 AgentArts 的
HTTP类型(Streamable HTTP),在有公网地址的服务器运行:shiban-mcp --transport streamable-http --host 0.0.0.0 --port 8080
- 改用 AgentArts 的
Metadata
Release files for shiban-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| shiban_mcp-0.1.0.tar.gz | 71.5 kB | Without provenance | Details for shiban_mcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| shiban_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for shiban_mcp-0.1.0-py3-none-any.whl |
Total release size: 141.0 kB
Release files / shiban_mcp-0.1.0.tar.gz
| Download URL | shiban_mcp-0.1.0.tar.gz |
|---|---|
| Size | 71.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d30d5580f91a96c8719d6893e0a26bda43cd27bfecf006358f9fb770f3713c42
|
|
BLAKE2b-256 checksum How to use checksums |
b0e34e223d14ce7eee3132d3738618d5ff71d56734a8941ff51287437bc2e0d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|
Release files / shiban_mcp-0.1.0-py3-none-any.whl
| Download URL | shiban_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 69.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
26436b19013f5c9f825173351b99593ee529dc45f7858b9fca2f49f2bd7ba048
|
|
BLAKE2b-256 checksum How to use checksums |
9f9091e4de11480a28485e44240b986eeb36f0b22bd6b340fc79b6ab977f4f73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|
Security for shiban-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.