MCP数学沙盒
一个使用(某技术/框架)的小型客户端-服务器演示 模型上下文协议(MCP)。\ 用户在网页用户界面中输入数学查询(例如,“12 / 3”),服务器的本地 SLM路由器 决定在内部运行哪个工具(加/减/乘/除) 沙盒执行它,并返回结果。
特点/特性
- 🔧 通过MCP风格的端点执行工具
/query) - 🧠 轻量级本地“SLM”路由器,用于选择合适的工具(无需外部LLM)
- 🧪 安全沙盒层(默认情况下不启用文件系统/网络)
- 🖥️ 最简浏览器界面
项目结构
脚本
npm run dev – run server and web UI in dev mode
npm run build – build server and web bundle
npm run start – start built server
npm run lint – lint快速入门(本地)
# 1) Install deps
npm install
# 2) Dev server (Node + Vite)
npm run dev
# Server: http://localhost:8787
# Web UI: http://localhost:5173
# 3) Test
curl -X POST http://localhost:8787/query \
-H "Content-Type: application/json" \
-d '{"query":"12 / 3"}