MCP服务器模板

MCP服务器模板是一个基于 Model Context Protocol 的 TypeScript 服务端模板,内置消息重复和算术运算两个示例工具,通过 stdio 传输与 MCP 客户端集成,供开发者快速搭建和测试 MCP 服务器。

  • by MrBrunoWolff
  • JavaScript
  • 本地部署
  • 更新于
在 GitHub 查看 MrBrunoWolff/minimal-mcp-server

使用说明

Minimal MCP Server

A Model Context Protocol server template with two example tools, stdio transport and TypeScript source you can extend.

Quick start

Use Node.js 20 or later to run the published stdio server:

npm install @mrbrunowolff/minimal-mcp-server
node node_modules/@mrbrunowolff/minimal-mcp-server/dist/index.js

The server communicates over stdio. Configure your MCP client to launch node with the absolute path to the installed dist/index.js; see the client setup.

To develop your own tools, use the Bun version declared in the repository’s package manifest and clone the source:

git clone https://github.com/MrBrunoWolff/minimal-mcp-server.git
cd minimal-mcp-server
bun install --frozen-lockfile
bun run build
node dist/index.js

The checkout includes the source and tests; the npm package ships the built server, client examples and documentation.

Features

  • Example tools for repeating a message and performing arithmetic.
  • ESM and CommonJS builds using the official MCP SDK.
  • Unit tests and a smoke test of the built stdio server.

Scripts

Command Description
bun run dev Rebuild in watch mode
bun run build Type-check and build ESM/CommonJS output
bun run test Run unit tests
bun run test:server Smoke-test the built stdio server
bun run check:ci Run the complete repository validation contract

Development

See adding tools, the development guide, contribution guidance and QUALITY.md. Bun dependency updates retain the three-day minimum release age.

License

MIT — see LICENSE.