shiban-mcp 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,65 @@
1
+ Metadata-Version: 2.4
2
+ Name: shiban-mcp
3
+ Version: 0.1.0
4
+ Summary: 师伴(ShiBan)教学实验需求理解与案例契约 Stdio MCP 服务
5
+ Requires-Python: >=3.10
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: mcp>=1.2.0
8
+
9
+ # shiban-mcp(师伴需求理解与契约校验 MCP)
10
+
11
+ 为「师伴」`01 需求理解` 与案例导览智能体提供的标准 MCP(支持 **Stdio** 与可选 **Streamable HTTP / SSE**),打包内置了全库快照数据,支持离线与云端 `uvx` 独立运行。
12
+
13
+ ## 1. 提供的 3 个工具
14
+
15
+ | 工具名 | 作用 |
16
+ |---|---|
17
+ | `lookup_topic_and_contract` | 根据教师需求匹配 150 个已注册主题(`topics.py` / `topics_extra.py`)、136 个页面场景骨架(`scene_registry.py`)和 115 条案例清单,返回标准自变量、安全数值上限、核心公式及边界告警(危险实操 / P3 不做项 / 开放表达) |
18
+ | `validate_requirement_json` | 按 `01 -> 02 -> 03 -> 04` 下游契约校验 9 字段 JSON(必填字段、`实验名称 <= 10 字`、变量结构完整度与安全数值上限) |
19
+ | `search_case_catalog` | 按关键词、学科、学段检索 115 条全学段教学实验案例清单 |
20
+
21
+ ## 2. 目录结构
22
+
23
+ ```
24
+ shiban_mcp/
25
+ ├── pyproject.toml uvx / pip 安装配置,入口命令为 shiban-mcp
26
+ ├── export_snapshot.py 从上层 topics / scene_registry / 案例清单导出快照
27
+ ├── src/shiban_mcp/
28
+ │ ├── data/registry_snapshot.json 随包打包的快照数据(150 主题 / 136 骨架 / 115 案例)
29
+ │ ├── registry.py 查询、边界拦截与 JSON 校验逻辑
30
+ │ ├── server.py MCP 服务入口(默认 stdio,也支持 streamable-http / sse)
31
+ │ └── __main__.py
32
+ └── tests/
33
+ └── test_shiban_mcp.py 单元测试 + 真实 stdio JSON-RPC 端到端测试
34
+ ```
35
+
36
+ ## 3. 本地运行与同步快照
37
+
38
+ 当上层 `topics.py`、`scene_registry.py` 或 `06_full_catalog/全学段案例清单.json` 更新后,先刷新随包快照再跑测试:
39
+
40
+ ```bash
41
+ python shiban_mcp/export_snapshot.py
42
+ python -m unittest shiban_mcp/tests/test_shiban_mcp.py -v
43
+ ```
44
+
45
+ 本地直接启动 Stdio MCP:
46
+
47
+ ```bash
48
+ cd shiban_mcp
49
+ pip install -e .
50
+ shiban-mcp
51
+ ```
52
+
53
+ ## 4. 部署到华为云 AgentArts 的填写方式
54
+
55
+ AgentArts 云端 **Stdio** 框只支持 `npx` 或 `uvx` 安装命令,不会读取你本地的 `D:\codeplus\ICT\main` 目录:
56
+
57
+ - **方式 A(通过 GitHub 仓库 + `uvx` 拉取,前提是推到 `sixpenceeeee/ICT` 且平台容器可访问 GitHub)**:
58
+ - 选择类型:`Stdio`
59
+ - 启动命令:`uvx`
60
+ - 参数:`--from`、`git+https://github.com/sixpenceeeee/ICT.git#subdirectory=shiban_mcp`、`shiban-mcp`
61
+ - **方式 B(发布到 PyPI 后用 `uvx`,最稳)**:
62
+ - 在 `shiban_mcp/` 下打包发布到 PyPI(如 `shiban-mcp`)后,AgentArts 直接填命令 `uvx`、参数 `shiban-mcp`。
63
+ - **方式 C(若平台网络不允许从 GitHub 安装或你想直接连本地/ECS 机器)**:
64
+ - 改用 AgentArts 的 `HTTP` 类型(Streamable HTTP),在有公网地址的服务器运行:
65
+ `shiban-mcp --transport streamable-http --host 0.0.0.0 --port 8080`
@@ -0,0 +1,57 @@
1
+ # shiban-mcp(师伴需求理解与契约校验 MCP)
2
+
3
+ 为「师伴」`01 需求理解` 与案例导览智能体提供的标准 MCP(支持 **Stdio** 与可选 **Streamable HTTP / SSE**),打包内置了全库快照数据,支持离线与云端 `uvx` 独立运行。
4
+
5
+ ## 1. 提供的 3 个工具
6
+
7
+ | 工具名 | 作用 |
8
+ |---|---|
9
+ | `lookup_topic_and_contract` | 根据教师需求匹配 150 个已注册主题(`topics.py` / `topics_extra.py`)、136 个页面场景骨架(`scene_registry.py`)和 115 条案例清单,返回标准自变量、安全数值上限、核心公式及边界告警(危险实操 / P3 不做项 / 开放表达) |
10
+ | `validate_requirement_json` | 按 `01 -> 02 -> 03 -> 04` 下游契约校验 9 字段 JSON(必填字段、`实验名称 <= 10 字`、变量结构完整度与安全数值上限) |
11
+ | `search_case_catalog` | 按关键词、学科、学段检索 115 条全学段教学实验案例清单 |
12
+
13
+ ## 2. 目录结构
14
+
15
+ ```
16
+ shiban_mcp/
17
+ ├── pyproject.toml uvx / pip 安装配置,入口命令为 shiban-mcp
18
+ ├── export_snapshot.py 从上层 topics / scene_registry / 案例清单导出快照
19
+ ├── src/shiban_mcp/
20
+ │ ├── data/registry_snapshot.json 随包打包的快照数据(150 主题 / 136 骨架 / 115 案例)
21
+ │ ├── registry.py 查询、边界拦截与 JSON 校验逻辑
22
+ │ ├── server.py MCP 服务入口(默认 stdio,也支持 streamable-http / sse)
23
+ │ └── __main__.py
24
+ └── tests/
25
+ └── test_shiban_mcp.py 单元测试 + 真实 stdio JSON-RPC 端到端测试
26
+ ```
27
+
28
+ ## 3. 本地运行与同步快照
29
+
30
+ 当上层 `topics.py`、`scene_registry.py` 或 `06_full_catalog/全学段案例清单.json` 更新后,先刷新随包快照再跑测试:
31
+
32
+ ```bash
33
+ python shiban_mcp/export_snapshot.py
34
+ python -m unittest shiban_mcp/tests/test_shiban_mcp.py -v
35
+ ```
36
+
37
+ 本地直接启动 Stdio MCP:
38
+
39
+ ```bash
40
+ cd shiban_mcp
41
+ pip install -e .
42
+ shiban-mcp
43
+ ```
44
+
45
+ ## 4. 部署到华为云 AgentArts 的填写方式
46
+
47
+ AgentArts 云端 **Stdio** 框只支持 `npx` 或 `uvx` 安装命令,不会读取你本地的 `D:\codeplus\ICT\main` 目录:
48
+
49
+ - **方式 A(通过 GitHub 仓库 + `uvx` 拉取,前提是推到 `sixpenceeeee/ICT` 且平台容器可访问 GitHub)**:
50
+ - 选择类型:`Stdio`
51
+ - 启动命令:`uvx`
52
+ - 参数:`--from`、`git+https://github.com/sixpenceeeee/ICT.git#subdirectory=shiban_mcp`、`shiban-mcp`
53
+ - **方式 B(发布到 PyPI 后用 `uvx`,最稳)**:
54
+ - 在 `shiban_mcp/` 下打包发布到 PyPI(如 `shiban-mcp`)后,AgentArts 直接填命令 `uvx`、参数 `shiban-mcp`。
55
+ - **方式 C(若平台网络不允许从 GitHub 安装或你想直接连本地/ECS 机器)**:
56
+ - 改用 AgentArts 的 `HTTP` 类型(Streamable HTTP),在有公网地址的服务器运行:
57
+ `shiban-mcp --transport streamable-http --host 0.0.0.0 --port 8080`
@@ -0,0 +1,22 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "shiban-mcp"
7
+ version = "0.1.0"
8
+ description = "师伴(ShiBan)教学实验需求理解与案例契约 Stdio MCP 服务"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ dependencies = [
12
+ "mcp>=1.2.0",
13
+ ]
14
+
15
+ [project.scripts]
16
+ shiban-mcp = "shiban_mcp.server:main"
17
+
18
+ [tool.setuptools.packages.find]
19
+ where = ["src"]
20
+
21
+ [tool.setuptools.package-data]
22
+ shiban_mcp = ["data/*.json"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ """ShiBan (师伴) MCP package."""
2
+
3
+ __version__ = "0.1.0"
@@ -0,0 +1,6 @@
1
+ """Run shiban-mcp via `python -m shiban_mcp`."""
2
+
3
+ from .server import main
4
+
5
+ if __name__ == "__main__":
6
+ main()