mcp-server-template
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-server-template Show me the current time and generate a UUID"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-server-template
A model context protocol server that already does the boring parts: typed tools, resources, prompts, stderr logging, graceful shutdown, integration tests, and a Docker image. Replace three files, ship your server.
$ npx mcp-server-template
[info] mcp-server-template 1.0.0 ready on stdioWorks with Claude Desktop, Claude Code, Cursor, VS Code, and any MCP client that speaks stdio.
Why not start from the SDK example
Concern | SDK example | This template |
Tool input validation | optional | zod, enforced at the boundary |
stdout safety | not enforced | logger writes to stderr only, a test guards it |
Graceful shutdown | none | SIGINT and SIGTERM close the transport |
Error shape | thrown strings |
|
Tests | none | unit plus a real stdio round trip |
Docker | none | multi-stage, non-root, 60 MB |
CI | none | Node 20, 22, 24 |
Related MCP server: ToolForge MCP Server
Quickstart
git clone https://github.com/ayushrajdev-dev/mcp-server-template
cd mcp-server-template
npm ci
npm run build
node dist/index.js # speaks JSON-RPC on stdioOr run the published package:
npx mcp-server-templateClaude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows:
{
"mcpServers": {
"template": {
"command": "node",
"args": ["/absolute/path/to/mcp-server-template/dist/index.js"],
"env": { "MCP_LOG_LEVEL": "info" }
}
}
}Restart the app. Three tools appear: echo, now, uuid.
Claude Code
claude mcp add template -- node /absolute/path/to/dist/index.jsCursor
.cursor/mcp.json in the project root:
{
"mcpServers": {
"template": {
"command": "node",
"args": ["dist/index.js"]
}
}
}Docker
docker build -t mcp-template .
docker run -i --rm mcp-templateThe -i flag matters: stdio transport needs an open stdin.
Add your own tool
Edit src/tools/index.ts. Ten lines, no boilerplate:
server.registerTool(
"reverse",
{
title: "Reverse text",
description: "Reverse a string. Use when the user asks to flip text.",
inputSchema: {
text: z.string().min(1).describe("Text to reverse"),
},
},
async ({ text }) => ({
content: [{ type: "text", text: [...text].reverse().join("") }],
}),
);Rules that keep the server usable:
descriptionis the model's only instruction. Say what it does and when to call it..describe()on every field. The schema is shown to the model verbatim.Return
isError: truefor expected failures. Throw only for bugs.Never
console.log. stdout is the protocol.
Layout
src/
index.ts server wiring, transport, shutdown
tools/index.ts echo, now, uuid
resources/index.ts config://manifest
prompts/index.ts review-diff
lib/logger.ts stderr-only logger
test/
server.test.js unit tests plus a live stdio round tripTools
Functions the model can call. Input is a zod schema; output is { content: [...] }.
Resources
Read-only data addressed by URI. This template exposes config://manifest with the package name, version, license, Node version, and MCP SDK version.
Prompts
Reusable templates the client surfaces as slash commands. review-diff takes a diff and a language, and asks for correctness findings only.
Environment
Variable | Default | Purpose |
|
|
|
Logs go to stderr at every level. There is no configuration file and no network access.
Tests
npm test # builds, then runs unit and stdio integration tests
npm run typecheckThe integration test spawns dist/index.js, connects a real MCP client, lists tools, calls echo, and asserts that an invalid time zone returns isError: true. If the transport breaks, CI fails.
Deploy
The image is a standard stdio MCP server, so it runs anywhere a container runs. For a hosted deployment, wrap the transport: the SDK ships StreamableHTTPServerTransport and SSEServerTransport, and the tool, resource, and prompt registrations stay unchanged.
License
MIT. See LICENSE.
Available Tools
3 toolsTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: connectivity check, current time retrieval, and UUID generation. There is no plausible scenario where an agent would confuse one for another.
All three names are single lowercase words following the same terse style, so the set is internally predictable. It deviates from a verb_noun convention, but consistency is high with no mixed casing or styles.
Three tools is thin for a functional server, though defensible for a template/starter server whose purpose is minimal demonstration. It borders on under-scoped relative to a general utility server.
Each tool is self-contained with no lifecycle gaps (nothing to create/update/delete), but the surface is notably minimal—no timezone conversion, formatting, or typical utility operations beyond these three primitives.
Related MCP Connectors
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Email inboxes, webhook URLs, mock APIs and 170+ tools for coding agents over one MCP connection.
One MCP endpoint for Claude, GPT & Gemini: 100+ tools + no-code connectors + agent workers.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Node.js/TypeScript MCP server template with sample tools (ping and system_info) that demonstrates how to build custom tools for Claude Desktop using stdio transport.MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to securely discover, execute, and observe tools with role-based access control and audit logging. Serves tools over MCP stdio and HTTP for integration with Claude Desktop, Cursor, and other clients.1-
- AlicenseCqualityBmaintenanceProvides a ready-to-use starter kit for building custom MCP servers, enabling developers to scaffold and register tools with type-safe Zod schemas, run over stdio with auto-bootstrapping, and connect to AI clients like Claude Desktop, Google Antigravity, Cursor, and VS Code.31MIT
- AlicenseNot gradedqualityCmaintenanceProvides a runnable local stdio Python server scaffold that coding agents extend into custom tool integrations by describing an idea and letting the agent investigate, build, test, and install it. Ships with no prebuilt tools, so it enables guided, agent-assisted creation of MCP tools connected to external APIs, databases, or websites while writes stay disabled until explicitly agreed.1MIT