Skip to main content
Glama

toolbox-mcp

A tool-type MCP Server (Tools) demonstrating the complete call chain of "AI Host → MCP Protocol → Multi-language Backend".

Three-layer architecture:

Layer

Language

Responsibility

Glue (protocol + process bridge)

TypeScript / Node

MCP protocol, tool registration, spawn C++ subprocess

Kernel (computation)

C++

Pure computation kernel (e.g., twoSum sum of two numbers)

Directory Structure

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 面板待办)

Related MCP server: MPC-PoC-1-EchoServerToolsbasicas

Environment Requirements

  • Node.js ≥ 20

  • MinGW g++ (for compiling the C++ kernel, only needed for the two_sum tool)

Installation

npm i

Compile the C++ Kernel

native/001.exe is a build artifact and is not committed. You need to compile it yourself after cloning:

g++ -O2 -std=c++20 -static-libgcc -static-libstdc++ native/001.cpp -o native/001.exe

-static-libgcc -static-libstdc++ makes the exe bundle its own runtime, avoiding dependency on libstdc++-6.dll.

Running

npm run dev    # 开发(tsx watch)
npm start      # 运行
npm run typecheck   # 类型检查(tsc --noEmit)

Tool List

Tool

Description

Layer

echo

Echo message

TS

add

Add two numbers

TS

reverse

Reverse string

TS

read_file

Read file in data/

TS

write_file

Write file in data/

TS

two_sum

Sum of two numbers (spawn C++ kernel)

TS → C++

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    A model-agnostic MCP server exposing example tools (add1, multiply2, greet) for learning purposes, working with any LLM through stdio transport.
    -
  • F
    license
    A
    quality
    C
    maintenance
    A learning-oriented MCP server that exposes basic tools (echo, add, reverse) over stdio transport to validate MCP handshake and tool calls.
    3
    -
  • A
    license
    A
    quality
    C
    maintenance
    Exposes a verified tool registry (calculator, sandboxed file read, web fetch) over MCP stdio, enabling any MCP-capable client to reuse the same tools from the inspectable ReAct loop.
    3
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables local tool calling over Model Context Protocol via stdio, providing deterministic tools such as calc.add, text.word_count, and text.summarize_naive after JSON-RPC handshake and discovery.
    MIT