MCP Server Boilerplate GeneratorTypeScript and Python templates, ready to run
Paste a list of CLI commands, pick a language, get a working @modelcontextprotocol/sdk scaffold in 30 seconds. The output is a real server file, a real manifest, a real README, and a ~/.claude.json snippet - not a tutorial.
Updated May 26, 2026 - By Jim Liu(Jim Liu has shipped MCP servers wrapping git, kubectl and internal CLIs in production)
TL;DR - what this scaffold tool gives you
- A runnable server file - either TypeScript (
McpServer+StdioServerTransport) or Python (FastMCP), with realexecFileorasyncio.subprocesswrappers around each command. - A correct manifest -
package.jsonwith pinned SDK version andtsconfig.json, orrequirements.txt+pyproject.toml. - A Claude config snippet - drop it into
~/.claude.jsonand the server shows up in Claude Code after a restart. - Safety rails - shell-metacharacter detection, 30-second timeout, stderr fallback, and a warning when you cross the 20-tool best-practice ceiling.
MCP server boilerplate generator
Configure your server below and get a ready-to-run scaffold in TypeScript or Python.
Parsed: 4 tools
Curated presets — click to load
Tip: presets load real CLI wrappers from production MCP servers in the community. Edit the definitions and regenerate.
Next step
You have a working server. The fastest way to verify it before wiring it into Claude Code is to run MCP Inspector against it locally.
Why use this MCP server boilerplate generator
The first MCP server you write takes an afternoon. Not because the protocol is hard - it is one of the smaller specs in the AI tooling space - but because the SDK has multiple transport classes, a registerTool API that subtly differs between SDK versions, and a handful of opinionated patterns (stderr fallback, timeout wrapping, JSON-RPC error shape) that are easy to miss when you copy a snippet from a blog post.
The generator above produces the same scaffold that experienced agent builders write by hand. Pick a language, paste the commands you want exposed, and the output includes: correct SDK imports for the version you are actually pulling, a real execFile or asyncio.subprocess call with a 30-second timeout and a stderr fallback, JSON-Schema input objects derived from each command's flags, and a ~/.claude.json snippet wired to the build output.
The fastest path from "I want Claude to be able to run my CLI" to a server that boots cleanly under MCP Inspector is to use the boilerplate generator, not to scaffold it by hand. The generated server compiles on first run because the dependencies and the SDK API are version-matched, and the README has the exact Inspector command embedded.
How to scaffold an MCP server in 30 seconds
- 1.Pick a language. TypeScript uses
@modelcontextprotocol/sdkandMcpServer. Python uses the officialmcppackage andFastMCP. - 2.Name the server. The name gets baked into
McpServer({ name })and the~/.claude.jsonkey. Keep it kebab-case. - 3.List your tools. One per line:
name: description / run: command. The generator parses each line, derives a JSON-Schema input from the flags it spots, and produces a registered tool handler. - 4.Pick a transport. Stdio is the default and what Claude Code uses. HTTP/SSE is for shared, persistent servers (one process, many clients).
- 5.Generate and run. Copy the files into a fresh directory.
npm install && npm run build && npm startfor TypeScript.uv pip install -r requirements.txt && python server.pyfor Python. - 6.Verify with MCP Inspector. The README has the exact command. Inspector opens at
http://localhost:5173and lets you call each tool by hand. - 7.Wire to Claude. Paste the
~/.claude.jsonsnippet, restart Claude Code, the tools show up in the picker.
Wrapping CLI tools with MCP
The most useful MCP servers are thin wrappers around existing command-line tools. The boilerplate the generator emits is designed for exactly that pattern: each tool you declare becomes a registered MCP tool whose handler shells out via execFile (TypeScript) or asyncio.create_subprocess_exec (Python). Output is captured, stderr is folded in as a fallback, and a 30-second timeout prevents a hung command from killing the whole server.
For commands with pipes or redirects - cat foo.json | jq ., grep -r ERROR > out, anything with $() or backticks - the generator flags the line and keeps shell=false by default. The right pattern there is to put the pipeline in a small wrapper script you control and have the MCP server invoke that instead of the raw shell expression. Trusting an LLM to compose pipes against your shell is how you end up with prompt-injection issues.
JSON-Schema input objects come from a heuristic: the generator scans each command for --flag and -f tokens and exposes them as optional string inputs the LLM can override. It is not a full parser - if your CLI uses positional args or complex types, you will want to tighten the schema by hand. The generator stamps everything as optional so a tool call with no arguments still works.
TypeScript vs Python: which template to pick
| Aspect | TypeScript | Python |
|---|---|---|
| Package | @modelcontextprotocol/sdk | mcp (PyPI) |
| API style | McpServer().registerTool() with zod schemas | FastMCP().tool() decorator with type hints |
| Runtime | Node 20+ or Node 22+, ESM | Python 3.10+, uv recommended |
| Subprocess | execFile from node:child_process | asyncio.create_subprocess_exec or subprocess.run |
| Best fit | Claude Code / Claude Desktop integrations, web-stack teams | Python tooling, data pipelines, internal scripts |
| Type safety | Strict TypeScript, zod runtime checks | Pyright / mypy optional, FastMCP infers schema from type hints |
| Inspector test cmd | npx @modelcontextprotocol/inspector node dist/server.js | npx @modelcontextprotocol/inspector uv run python server.py |
Both templates are first-party - the SDKs are maintained inside the modelcontextprotocol GitHub org and ship the same protocol version. There is no functional reason to pick one over the other for a basic CLI wrapper; pick the language your team already runs.
Testing your generated server with MCP Inspector
MCP Inspector is the official debugging UI. It speaks the same JSON-RPC protocol Claude Code does, but instead of an LLM picking tools, you click them. That makes it the right tool for two things: verifying a fresh server boots and answers listTools, and reproducing a tool failure you cannot trigger reliably through Claude.
The generated README includes the Inspector command tailored to your language. For TypeScript it is npx @modelcontextprotocol/inspector node dist/server.js; for Python it is npx @modelcontextprotocol/inspector uv run python server.py. Inspector opens at http://localhost:5173. Click a tool, fill in arguments, see the raw response and the JSON-RPC frame.
Three sanity checks Inspector catches early
- Server starts but listTools is empty. You forgot to call
registerToolor the decorator did not fire - check the import path. - Tool runs but returns no output. The wrapped CLI wrote to stderr only - the generator already folds stderr in, but a hand-edited handler may have lost that.
- Tool hangs. Subprocess never exited. The 30-second timeout the generator emits will kill it - watch for the
timed out after 30sresponse.
Connecting the server to Claude Code
The fourth tab in the generator output is the exact JSON to drop into ~/.claude.json (or claude_desktop_config.json for the desktop app). It is a mcpServers map keyed by server name, with type, command, and args for stdio, or type: "http" and a URL for HTTP.
Two things to remember when you paste it. First, the args path is a placeholder - replace /absolute/path/to/{server-name}/dist/server.js with the real path on your machine. Second, restart Claude Code after editing the config; the file is read at startup, not watched.
If you are already maintaining a mcpServers block (e.g. you have a sibling tool like a Claude Code MCP config), merge the new entry in instead of replacing the whole map. Claude Code crashes on a malformed JSON file - keep a backup.
What real MCP server authors say
“My first MCP server took an afternoon - 80% of that was figuring out which transport to import. Once I copied a working stdio scaffold from the SDK examples it was a 30-minute job.”
“The hardest part of writing an MCP server is not the protocol, it is wrapping the actual subprocess with proper timeouts and stderr handling. Most blog post examples skip that and crash on the first real command.”
“I keep one MCP server per domain - git, kubectl, internal API. About 6-8 tools each. Anything more and Claude starts picking the wrong tool.”
Frequently asked questions
- What does an MCP server boilerplate generator do?
- It takes a list of CLI commands you want exposed to an LLM and emits a runnable MCP server in TypeScript or Python. The generated server uses the official @modelcontextprotocol/sdk (TypeScript) or the mcp Python package with FastMCP, plus a package.json or requirements.txt, a README, and a ~/.claude.json snippet for connecting the server to Claude Code or Claude Desktop.
- Does the generated MCP server actually run?
- Yes. The TypeScript output imports McpServer and StdioServerTransport from @modelcontextprotocol/sdk and registers tools with registerTool(). The Python output uses FastMCP with @mcp.tool() decorators. Both use real subprocess execution (execFile in Node, asyncio.create_subprocess_exec in Python) with a 30-second timeout and stderr fallback.
- How do I test the generated MCP server before connecting it to Claude?
- Use MCP Inspector. The generated README includes the exact command. Inspector opens an interactive UI at http://localhost:5173 where you can list tools, call each one manually, and see the raw JSON-RPC traffic.
- TypeScript or Python - which should I pick?
- TypeScript ships first - the official SDK has slightly more mature streaming support and lines up with most Claude Code workflows. Python wins if your CLI tooling is already Python or if you want FastMCP decorator ergonomics. Both are first-party and feature-equivalent for the basics; pick the one your stack already uses.
- Can I expose unsafe shell commands like "ls | grep foo"?
- The generator detects shell metacharacters and warns. The Python template keeps shell=False by default; the TypeScript template sets shell:true when needed and emits a warning comment. For production, always validate user input and prefer a wrapper script that you control.
- How many tools should a single MCP server expose?
- The MCP best-practice ceiling is around 20 tools per server. Beyond that, the LLM struggles to pick the right tool, and listTools latency grows. Split by domain (one server for git, one for docker, one for kubectl) and load multiple servers via the same ~/.claude.json.
- Does the generator support MCP resources and prompts?
- Yes - both are opt-in checkboxes. Resources add a sample config://current handler that returns server metadata as JSON. Prompts add a sample summarize-output prompt. Both are stubs you replace with your own business logic.
- How do I connect the generated MCP server to Claude Code?
- Copy the ~/.claude.json snippet from the generator. It adds an mcpServers entry with type "stdio", a command (node or uv), and the absolute path to the built server file. Restart Claude Code and the new tools appear in the tool picker.
Related tools and guides on OpenAI Tools Hub
MCP vs A2A Protocol — Decision Tool
3-question guide to picking MCP, A2A, or both for your agent architecture.
CLI to MCP Converter Guide
Sibling deep dive — when to wrap a CLI, when not to, and the edge cases the generator does not solve.
Claude Code MCP Persistence Plugin
Implementation notes for a persistent MCP server that survives Claude Code restarts.
Claude Code Multi-Agent Tutorial
Build a multi-agent workflow where each subagent loads its own MCP toolset.
AI Model Comparison Tool
Pick the right model for your MCP-driven agent — context window, tool-use quality, pricing.
WebMCP — Chrome AI Agents
How browser-side MCP servers complement the local stdio scaffolds this generator produces.