Files
ssw-platform/crates/sspf-mcp/Cargo.toml
T
admin 217dadf008 feat(mcp): 落地 MCP 工具层 —— 4 元工具 + 分层加载 + 进程内适配器
- 新增 crates/sspf-mcp:registry / jsonrpc / server / 4 个元工具(context·discover·describe·call)
- 内核新增 mcp_adapter.rs(NativeAdapter,直接调 AppState)与 `--mcp` 子命令
- 工具定义自带五段自提示(含 pitfalls/examples),示例必须能被测试跑通
- 新增 scripts/mcp-smoke.sh(13 条)与 docs/mcp.md(接入说明)
- 影响:协议层只暴露 4 个工具(常驻约 1.8K token);业务失败返回结构化 error 而非协议错
- 踩坑记录:内嵌 PG 会抢 fd 0/1,必须在开库前 detach 标准流;tokio 的 stdin 在管道上 ENXIO
2026-10-31 10:29:14 +08:00

23 lines
893 B
TOML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
[package]
name = "sspf-mcp"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
# 🔴 AR5:本 crate **不许依赖内核**(sspf-store / ssw-platform)。
#
# 为什么:MCP 层要能同时接两种后端 ——
# ① 进程内内核(SspfNativeAdapter,P1 起)
# ② 远端基线平台 Java 后端(BaselineHttpAdapter,P4 对账时)
# 一旦依赖内核内部类型,② 这条路就死了。
#
# 依赖只允许:契约类型 + 序列化 + 异步运行时。
# axum 不在列表里 —— 协议走 stdio(NDJSON),不用 HTTP 框架。
# async-trait 也不需要:trait 方法统一返回 `BoxFut`(Pin<Box<dyn Future>>),
# 手写两行泛型比引一个宏 crate 更可控。
[dependencies]
sspf-contract = { path = "../sspf-contract" }
serde = { workspace = true }
serde_json = { workspace = true }
tokio = { workspace = true }