DEV Community

z z
z z

Posted on

I Built 10 MCP Servers in a Weekend — Here's the Template I Wish I Had Starting Out

MCP (Model Context Protocol) is everywhere now. Every week there's a new server for GitHub, for databases, for APIs you've never heard of.

But when I first started, I spent more time reading docs than writing code. The protocol isn't hard — it's just that every tutorial either shows you a toy example or dumps you straight into the full TypeScript SDK without explaining the basics.

So I built a template. Then I built 10 servers off it in one weekend.

Here's what I learned, and the template I now use for every MCP server.

The Core Insight

An MCP server is just a stdio or HTTP server that speaks JSON-RPC. That's it.

# Minimal MCP server in 20 lines
import sys, json

def handle_request(msg):
    if msg.get("method") == "tools/list":
        return {"tools": [{"name": "hello", "description": "Say hello", "inputSchema": {"type": "object", "properties": {}}}]}
    elif msg.get("method") == "tools/call" and msg.get("params", {}).get("name") == "hello":
        return {"content": [{"type": "text", "text": "Hello from MCP!"}]}
    return {"error": "unknown method"}

for line in sys.stdin:
    msg = json.loads(line.strip())
    result = handle_request(msg)
    sys.stdout.write(json.dumps(result) + "\n")
    sys.stdout.flush()
Enter fullscreen mode Exit fullscreen mode

That's a working MCP server. 20 lines.

The Template I Actually Use

After 10 iterations, this is the structure that scales:

mcp-server/
├── server.py        # JSON-RPC handler + tool registry
├── tools/           # One file per tool
│   ├── __init__.py
│   ├── search.py
│   └── transform.py
├── config.py        # Env vars, defaults
└── requirements.txt
Enter fullscreen mode Exit fullscreen mode

Key principles:

  1. One file per tool group — keeps things testable
  2. Tool registry pattern — register tools with a decorator, no routing boilerplate
  3. Stdio first, HTTP later — start with stdio for local dev, add HTTP transport when you need remote access

What I Actually Built

Over the weekend I made:

  • A GitHub issues fetcher
  • A SQL query builder (safe, no injection)
  • A markdown-to-HTML converter
  • A web scraper tool
  • A JSON transformer
  • A code formatter wrapper
  • A weather data server
  • A text summarizer
  • A URL shortener
  • A Docker log parser

Tools that an AI assistant can actually use during development.

The Hardest Part Wasn't the Code

It was packaging and distribution. Getting the server from "works on my machine" to "anyone can install and run it" takes more effort than writing the server itself.

That's why I put everything I learned into a starter kit — the template, the 10 servers, the packaging scripts, and a setup guide so you can go from zero to deployed in 30 minutes.

The Fastest Way to Start

If you want to build MCP servers without the packaging headache:

1. MCP Server Starter Kit — The template, 10 example servers, deployment scripts, and a step-by-step guide. $0 minimum (pay what you want).

2. AI Developer Toolkit — If you're building AI workflows, this has the prompts and patterns I use daily. $9.99.

3. Claude Code Skills Pack — 50 production-tested prompts for Claude Code. $9.99.


I write about MCP, AI tooling, and developer workflows. Follow me for more practical guides — no fluff, just things that actually work.

Top comments (0)