Data Process Mcp — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Data Process Mcp (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
基于 Model Context Protocol (MCP) 的 Streamable HTTP Transport 示例,使用 Node.js + TypeScript 实现。该示例演示如何通过 HTTP 端点暴露 MCP 工具,供 MCP 客户端(如 Claude Desktop、Cursor 等)调用。
icbc_mcp/
├── src/
│ ├── index.ts // 入口文件
│ ├── server.ts // HTTP 服务器 + MCP 端点
│ ├── client.ts // MCP 测试客户端
│ └── tools.ts // MCP 工具定义
├── package.json // 依赖与脚本
├── tsconfig.json // TypeScript 配置
└── README.md // 本文件cd E:\work\icbc_mcp
npm installnpm run dev服务器将在 http://localhost:3000 启动。
npm run build # 编译 TypeScript
npm start # 运行编译后的 JShttp://localhost:3000/mcpMCP JSON-RPC 2.0 请求入口,客户端通过此端点调用工具。
http://localhost:3000/mcpSSE(Server-Sent Events)端点,用于服务器主动推送(可选)。
http://localhost:3000/health返回服务器状态。
| 工具名 | 描述 | 参数 |
|---|---|---|
match_openapi_interfaces | OpenAPI 接口匹配器 | match_json (string), openapi_doc (string) |
本示例采用 Streamable HTTP Transport,这是 MCP 协议定义的一种传输方式:
/mcp 发送 initialize 请求,建立会话/mcp 发送 notifications/initialized 通知/mcp 发送 tools/list 获取可用工具/mcp 发送 tools/call 调用具体工具/mcp 提供 SSE 端点,用于服务端主动推送(如资源变更通知)在 Claude Desktop 的 claude_desktop_config.json 中添加:
{
"mcpServers": {
"icbc-mcp-demo": {
"command": "node",
"args": ["E:\\work\\icbc_mcp\\dist\\index.js"],
"env": {
"PORT": "3000"
}
}
}
}# 初始化
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"clientInfo": {
"name": "curl-client",
"version": "1.0.0"
}
}
}'
# 调用 match_openapi_interfaces 工具
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "match_openapi_interfaces",
"arguments": {
"match_json": "{}",
"openapi_doc": "{}"
}
}
}'本项目内置了一个命令行 MCP 客户端,可直接连接本地或远程 MCP 服务端进行测试。
先启动 MCP 服务端:
npm run dev或者:
npm run build
npm start默认服务端地址为 http://localhost:3000/mcp。
使用默认地址连接:
npm run client连接指定地址:
npm run client -- http://localhost:3000/mcp也可以通过环境变量指定地址:
$env:MCP_SERVER_URL="http://localhost:3000/mcp"
npm run client客户端启动后会进入交互模式,支持以下命令:
| 命令 | 说明 |
|---|---|
help | 查看帮助信息 |
tools | 列出服务端当前暴露的所有工具 |
ping | 测试客户端是否成功连通 MCP 服务端 |
call <工具名> <JSON参数> | 调用指定工具 |
exit / quit | 退出客户端 |
示例:
call match_openapi_interfaces {"match_json":"{}","openapi_doc":"{}"}如果只想快速测试,也可以直接使用命令模式。
列出工具:
npm run client -- list调用 match_openapi_interfaces:
npm run client -- call match_openapi_interfaces "{\"match_json\":\"{}\",\"openapi_doc\":\"{}\"}"连接指定服务端后再列出工具:
npm run client -- http://localhost:3000/mcp listcall 命令中的参数必须是合法的 JSON 对象{},不能直接传数组或普通字符串{}正确示例:
npm run client -- call match_openapi_interfaces "{\"match_json\":\"{}\",\"openapi_doc\":\"{}\"}"错误示例:
npm run client -- call match_openapi_interfaces "hello"npm run client -- list,确认客户端能成功连接并拿到工具列表npm run client -- call match_openapi_interfaces "{\"match_json\":\"{}\",\"openapi_doc\":\"{}\"}",确认工具调用正常npm run client 进入交互模式,手工测试不同工具#### 连接失败
请检查:
http://localhost:3000/mcp#### 参数解析失败
请检查:
PowerShell 示例:
npm run client -- call match_openapi_interfaces "{\"match_json\":\"{}\",\"openapi_doc\":\"{}\"}"src/tools.ts 中定义新的工具函数server.tool() 注册如需暴露资源(如文件、数据库查询),可启用 capabilities.resources 并实现相应处理器。
本项目已配置 Dockerfile,支持容器化部署。服务端默认监听 0.0.0.0:3000 以便在容器外访问。
docker build -t icbc-mcp-demo . docker run -d -p 3000:3000 --name mcp-server icbc-mcp-demo容器启动后,在宿主机上使用内置的 MCP Client 连接并测试工具:
# 列出工具
npm run client -- http://localhost:3000/mcp list
# 调用工具
npm run client -- http://localhost:3000/mcp call match_openapi_interfaces "{\"match_json\":\"{}\",\"openapi_doc\":\"{}\"}" docker stop mcp-server
docker rm mcp-servernpm run build 编译内部示例代码,仅供学习参考。
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.