MCP Server
概览
Base server for the Model Context Protocol (SDK v2, TypeScript) with stdio and Streamable HTTP transports. One example tool, one resource and one prompt so the wiring can be verified end to end. stdio (used by hosts that spawn the server): Connect, then exercise echo (tools), server://info (resources) and summarize-text (prompts). VS Code example (.vscode/mcp.json is included): See knowledge/02-how-to-add-a-tool.md. Short version: new file in src/tools/, Zod v4 inputSchema, pure logic exported for tests, registration in src/tools/index.ts. - AGENTS.md — entry point for agents working in this repo. - knowledge/ — conventions, architecture, transports. Read in order.
README
MCP Server
Base server for the Model Context Protocol (SDK v2, TypeScript) with stdio and Streamable HTTP transports. One example tool, one resource and one prompt so the wiring can be verified end to end.
Requirements
- Node.js 20+
- npm
Setup
cp .env.example .env
npm install
npm run typecheck
npm test
npm run build
Run
stdio (used by hosts that spawn the server):
npm start
HTTP (local endpoint for many clients):
npm run start:http
Development (no build step):
npm run dev
npm run dev:http
Verify with the Inspector
npm run build
npm run inspect
Connect, then exercise echo (tools), server://info (resources) and
summarize-text (prompts).
Configure a host
VS Code example (.vscode/mcp.json is included):
{
"servers": {
"mcp-server": {
"type": "stdio",
"command": "node",
"args": ["${workspaceFolder}/dist/index.js"]
}
}
}
Add a tool
See knowledge/02-how-to-add-a-tool.md. Short version: new file in
src/tools/, Zod v4 inputSchema, pure logic exported for tests,
registration in src/tools/index.ts.
Permanent instructions
AGENTS.md— entry point for agents working in this repo.knowledge/— conventions, architecture, transports. Read in order.
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →