init-mcp-server
v1.0.0
Published
Scaffold a new MCP (Model Context Protocol) server in seconds
Maintainers
Readme
init-mcp-server

Scaffold a new Model Context Protocol server in seconds.
npx init-mcp-serverWhat you get
- TypeScript project with the MCP SDK wired up
- Stdio transport ready to go
- Optional example tools (hello, calculator, notes, summarise)
- Dev mode with auto-reload via
tsx --watch - Ready-to-use config snippets for Claude Code and Claude Desktop
Usage
Run the CLI and follow the prompts:
npx init-mcp-serverOr pass a project name directly:
npx init-mcp-server my-serverYou'll be asked to pick which example tools to include:
| Tool | What it demonstrates | |------|---------------------| | hello | Minimal tool with no parameters | | calculator | Zod input validation (add, multiply) | | notes | Stateful tool (create and list notes) | | summarise | Text processing with optional parameters |
After scaffolding
cd my-server
npm run dev # Start with auto-reload
npm run build # Compile TypeScript
npm start # Run compiled serverAdding your own tools
Create a file in src/tools/ and register it in src/index.ts:
import { z } from "zod";
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
export function registerMyTool(server: McpServer) {
server.tool(
"my-tool",
"What it does",
{ input: z.string().describe("The input") },
async ({ input }) => ({
content: [{ type: "text", text: `Result: ${input}` }],
})
);
}Licence
MIT
