toolbox-mcp
Enables AI hosts to call deterministic tools such as echo, add, reverse, read/write files, and a C++-implemented two_sum via the MCP stdio interface.
README
toolbox-mcp
一个工具型 MCP Server(Tools-only),演示「AI Host → MCP 协议 → 多语言后端」的完整调用链。
三层架构:
| 层 | 语言 | 职责 |
|---|---|---|
| 胶水(协议 + 进程桥) | TypeScript / Node | MCP 协议、工具注册、spawn C++ 子进程 |
| 内核(计算) | C++ | 纯计算内核(如 twoSum 两数之和) |
目录结构
toolbox-mcp
├── src/ TS 胶水层
│ ├── server.ts 主入口(serveStdio + 6 个 register)
│ ├── pathGuard.ts 路径守卫(限制读写 data/)
│ └── tools/ 6 个工具
├── native/ C++ 内核
│ ├── 001.cpp twoSum 源码
│ └── 001.exe 编译产物(不提交,见下)
├── data/ 读写文件工具的操作目录
└── TODO.md 开发计划(#8 Web 面板待办)
环境要求
- Node.js ≥ 20
- MinGW
g++(编译 C++ 内核用,仅two_sum工具需要)
安装
npm i
编译 C++ 内核
native/001.exe 是编译产物,不入库。克隆后需自行编译:
g++ -O2 -std=c++20 -static-libgcc -static-libstdc++ native/001.cpp -o native/001.exe
-static-libgcc -static-libstdc++ 让 exe 自带运行时,避免依赖 libstdc++-6.dll。
运行
npm run dev # 开发(tsx watch)
npm start # 运行
npm run typecheck # 类型检查(tsc --noEmit)
工具列表
| 工具 | 说明 | 层 |
|---|---|---|
echo |
回显消息 | TS |
add |
两数相加 | TS |
reverse |
反转字符串 | TS |
read_file |
读取 data/ 内文件 |
TS |
write_file |
写入 data/ 内文件 |
TS |
two_sum |
两数之和(spawn C++ 内核) | TS → C++ |
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.