### 接口介绍 为 YASA 对外开放的所有 MCP 工具搭建一个统一的 Server 框架,提供 tool 注册机制、传输模式(stdio / streamable-http)、入参校验、错误处理、日志与健康检查,作为后续所有 MCP 工具的运行底座。 ### 工具名 `bootstrap_mcp_framework` > 注:这是一个**项目骨架任务**,不是 MCP tool 本身,而是为后续 14 个 tool 提供运行底座。 ### 背景与目标 YASA 计划对外开放一组程序分析能力作为 MCP(Model Context Protocol)服务,需要先有一个统一的 MCP Server 框架。这个任务的目标是: 1. 选定 MCP SDK(推荐 Python `fastmcp` 或官方 `mcp` 包),搭建可启动的 MCP Server 进程 2. 完成 `stdio` 和 `streamable-http` 两种传输模式的入口 3. 提供 tool 注册机制(装饰器或注册表),后续 tool 开发者只需写 tool 函数本身 4. 提供统一的入参校验、错误处理、日志、健康检查 5. 完成 README,讲清如何本地启动、如何在 Claude Desktop / Cline 等 client 里配置使用 ### 输入参数 启动参数(命令行 / 环境变量),非 MCP tool 入参: | 参数 | 类型 | 必填 | 默认 | 说明 | | --- | --- | --- | --- | --- | | `--transport` | enum(stdio, http) | 否 | stdio | 传输模式 | | `--port` | int | 否 | 8765 | http 模式监听端口 | | `--log-level` | enum(debug, info, warn, error) | 否 | info | 日志级别 | | `YASA_MCP_REPO_ROOT` | env | 是 | — | 被分析的代码仓库根目录 | ### 输出结构 不直接产生 tool 输出,而是为后续 tool 提供运行时。一个最小可用 demo tool `ping` 应返回: ```json { "status": "ok", "server_name": "yasa-mcp", "version": "0.1.0", "transports_supported": ["stdio", "streamable-http"] } ``` ### 验收标准 - [ ] `python -m yasa_mcp --transport stdio` 能启动并通过 MCP inspector 通信 - [ ] `python -m yasa_mcp --transport http --port 8765` 能启动 HTTP 服务,`GET /healthz` 返回 200 - [ ] 注册一个 demo tool `ping`,在 Claude Desktop / Cline 客户端中可被发现并调用 - [ ] README 包含至少一个 Claude Desktop 配置示例(`claude_desktop_config.json` 片段) - [ ] 单元测试覆盖:tool 注册、参数校验失败、日志输出格式 ### 预估工作量 2-3 人日(熟悉 MCP 协议的同学 1 人日即可)
Activity
wryyyds7 commentedon Jul 21, 2026
I can try it.
ponyha commentedon Jul 21, 2026
OK
feat: bootstrap MCP server framework (bootstrap_mcp_framework)
wryyyds7 commentedon Jul 22, 2026
I have finshed a simple framework.Now it can't work with the system of logging and so on,please tall me whether to connect them.
wryyyds7 commentedon Jul 27, 2026
Hello, I have completed this task. What do you think? Does it need any revisions?