Skip to main content
Glama
srmcguirt

MCP Server Starter Kit

by srmcguirt

šŸš€ MCP Server Starter Kit

Production-ready Model Context Protocol (MCP) server boilerplate.
Ship your first MCP server in minutes, not days.

CI License: MIT TypeScript Node MCP

šŸ’Ž Premium edition with Python (FastMCP) version, Railway/Render deploy configs, auth patterns, and 1-on-1 setup support → Get it on Gumroad →


What's included

Feature

Status

TypeScript with strict mode

āœ…

Proper stderr logging (won't break MCP stdio)

āœ…

Token-bucket rate limiter

āœ…

Environment variable validation (Zod)

āœ…

Centralized error handling

āœ…

2 example tools (echo + fetch_url)

āœ…

Docker + docker-compose

āœ…

Claude Desktop auto-config script

āœ…

Unit test setup (Vitest)

āœ…

Python/FastMCP version

šŸ’Ž Premium

Railway one-click deploy

šŸ’Ž Premium

API key auth middleware

šŸ’Ž Premium

OAuth 2.0 integration pattern

šŸ’Ž Premium

Webhook receiver tool

šŸ’Ž Premium

Database connection pattern

šŸ’Ž Premium


Related MCP server: TypeScript MCP Server Boilerplate

Why this starter kit?

Every MCP server tutorial shows you a 30-line "hello world." Then you try to build something real and discover:

  • Logging to stdout breaks MCP — the protocol uses stdout for communication; your console.log corrupts it

  • No rate limiting — a runaway AI agent can hammer your APIs

  • No input validation — AI can send malformed arguments and crash your server

  • No error handling — unhandled exceptions crash the whole server

  • No deploy story — how do you actually run this in production?

This starter kit solves all of that from day one.


Quick start

Option 1: Use as a template

# Clone and rename
git clone https://github.com/srmcguirt/mcp-server-starter-kit my-mcp-server
cd my-mcp-server

# Install dependencies
npm install

# Copy env file and fill in your values
cp .env.example .env

# Start in dev mode (hot reload)
npm run dev

Option 2: Scaffold with npx

npx @wireforge/mcp-server-starter init my-server-name
cd my-server-name
npm install && npm run dev

Option 3: Install as a library

npm install @wireforge/mcp-server-starter

Add your first tool

Open src/tools/ and create a new file:

// src/tools/my-tool.ts
import { z } from 'zod';
import { toolResult } from '../lib/error-handler.js';
import type { MCPTool } from '../types.js';

const MyInputSchema = z.object({
  query: z.string().min(1).max(500),
  limit: z.number().int().positive().max(100).default(10),
});

export const myTool: MCPTool = {
  name: 'my_tool',
  description: 'Search for something and return results. Be specific about what this does — the AI reads this description.',
  inputSchema: {
    type: 'object',
    properties: {
      query: { type: 'string', description: 'The search query' },
      limit: { type: 'number', description: 'Max results to return', default: 10 },
    },
    required: ['query'],
  },
  async execute(args) {
    const { query, limit } = MyInputSchema.parse(args);

    // Your implementation here
    const results = await myApi.search(query, { limit });

    return toolResult(JSON.stringify(results, null, 2));
  },
};

Then register it in src/tools/index.ts:

import { myTool } from './my-tool.js';

export const tools: MCPTool[] = [
  echoTool,
  fetchUrlTool,
  myTool, // šŸ‘ˆ Add here
];

Connect to Claude Desktop

# Build and add to Claude Desktop config automatically
chmod +x scripts/add-to-claude.sh
./scripts/add-to-claude.sh my-server-name

# Then restart Claude Desktop

Or manually add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "my-server-name": {
      "command": "node",
      "args": ["/absolute/path/to/my-mcp-server/dist/index.js"],
      "env": {
        "MY_API_KEY": "your-key-here"
      }
    }
  }
}

Connect to Cursor / Cline / Windsurf

Add to your editor's MCP settings:

{
  "mcp": {
    "servers": {
      "my-server-name": {
        "command": "node",
        "args": ["/absolute/path/to/my-mcp-server/dist/index.js"]
      }
    }
  }
}

Deploy with Docker

# Build and run with docker-compose
cd docker && docker-compose up --build

# Or build manually
docker build -f docker/Dockerfile -t my-mcp-server .
docker run -it --env-file .env my-mcp-server

Project structure

mcp-server-starter/
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ index.ts              # Server entry point — wire everything together here
│   ā”œā”€ā”€ types.ts              # MCPTool interface and shared types
│   ā”œā”€ā”€ lib/
│   │   ā”œā”€ā”€ logger.ts         # Winston logger — always logs to stderr
│   │   ā”œā”€ā”€ rate-limiter.ts   # Token-bucket rate limiter
│   │   ā”œā”€ā”€ env.ts            # Environment variable validation (Zod)
│   │   └── error-handler.ts  # Centralized error handling + toolResult helpers
│   └── tools/
│       ā”œā”€ā”€ index.ts          # Tool registry — add your tools here
│       ā”œā”€ā”€ echo.ts           # Example: simple string echo
│       └── fetch-url.ts      # Example: HTTP fetch with timeout + size limit
ā”œā”€ā”€ docker/
│   ā”œā”€ā”€ Dockerfile            # Multi-stage production build
│   └── docker-compose.yml    # Local development + production compose
ā”œā”€ā”€ scripts/
│   └── add-to-claude.sh      # Auto-add to Claude Desktop config
ā”œā”€ā”€ .env.example              # Required environment variables
ā”œā”€ā”€ tsconfig.json             # Strict TypeScript config
└── package.json

Key patterns

āœ… Always log to stderr

// āŒ WRONG — corrupts MCP protocol
console.log('something happened');

// āœ… CORRECT — logs to stderr, leaves stdout clean
logger.info('something happened');

āœ… Validate all input with Zod

// āŒ WRONG — trusting AI-provided args
const { query } = args as { query: string };

// āœ… CORRECT — parse and validate
const { query } = MySchema.parse(args); // throws McpError on invalid input

āœ… Use withErrorHandling for every tool

// āŒ WRONG — unhandled exceptions crash the server
async execute(args) {
  return await riskyOperation(args);
}

// āœ… CORRECT — errors logged + safe message returned to AI
return withErrorHandling('my_tool', () => riskyOperation(args));

šŸ’Ž Premium Edition — $49

The open source version is a solid foundation. The Gumroad premium download adds:

  • āœ… Python/FastMCP version (same patterns, same quality)

  • āœ… API key authentication middleware

  • āœ… OAuth 2.0 integration pattern (GitHub, Google, etc.)

  • āœ… Railway + Render one-click deploy configs

  • āœ… Database connection patterns (Postgres, SQLite, Redis)

  • āœ… Webhook receiver tool template

  • āœ… Streaming responses pattern

  • āœ… MCP resources and prompts examples

  • āœ… 30-min video walkthrough: building a real production MCP server

  • āœ… 6 real-world example servers (GitHub, Notion, Slack, Postgres, filesystem, web search)

  • āœ… Commercial license (use in client work and products)

Get the premium edition →


FAQ

Q: Why TypeScript and not JavaScript?
A: MCP tool schemas need to match your implementation exactly. TypeScript catches mismatches at build time, not at 2am when an AI passes unexpected input.

Q: Why log to stderr?
A: MCP uses stdio transport — stdout carries the JSON-RPC protocol. Anything you write to stdout that isn't valid MCP JSON will corrupt the connection. The logger in this kit always writes to stderr.

Q: Can I use this with Python?
A: The Python/FastMCP version is in the premium edition. The patterns are identical — just in Python.

Q: Is this compatible with all MCP clients?
A: Yes. Uses the official @modelcontextprotocol/sdk. Tested with Claude Desktop, Cursor, Cline, and Windsurf.


Contributing

PRs welcome. See CONTRIBUTING.md.


License

MIT — free for personal and open source use.
Commercial license (client work, products, resale) included in the Premium Edition on Gumroad.


šŸ“¬ Stay Updated

Get a free sample prompt + updates when new tools ship:

→ srmcguirt.github.io

F
license - not found
-
quality - not tested
B
maintenance

Maintenance

–Maintainers
–Response time
–Release cycle
1Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    -
    quality
    D
    maintenance
    A boilerplate project for quickly developing MCP servers using TypeScript SDK, featuring example tools (calculator, greeting) and resources with Zod schema validation.
  • F
    license
    -
    quality
    D
    maintenance
    A boilerplate project for quickly developing MCP servers using TypeScript, featuring example implementations of tools (calculator, greetings) and resources (server info) with Zod schema validation.
  • F
    license
    -
    quality
    D
    maintenance
    A boilerplate project for quickly developing Model Context Protocol (MCP) servers using TypeScript SDK, with example implementations of tools (calculator, greetings) and resources (server info) using Zod schema validation.
    112

View all related MCP servers

Related MCP Connectors

  • An MCP server for Arcjet - the runtime security platform that ships with your AI code.

  • Markdown-first MCP server for Notion API with 8 composite tools and 39 actions.

  • MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/srmcguirt/mcp-server-starter-kit'

If you have feedback or need assistance with the MCP directory API, please join our Discord server