Build Your Own MCP Server in 5 Minutes — TypeScript Starter Template

typescript dev.to

I've been building MCP servers for my own projects, and I realized something: everyone keeps reimplementing the same boilerplate. File reads, directory listings, grep — you write them once, then again in the next server.

So I put together a minimal MCP Server Starter in TypeScript. Three tools to get you started:

// Example from src/index.ts
server.setRequestHandler(ListToolsRequestSchema, async () => ({
  tools: [
    {
      name: "read_file",
      description: "Read contents of a text file",
      inputSchema: {
        type: "object",
        properties: {
          path: { type: "string", description: "Absolute path to the file" }
        }
      }
    },
    // list_directory, grep_search — same pattern
  ]
}));
Enter fullscreen mode Exit fullscreen mode

Quick Start

npm install
npm run build
npm start
Enter fullscreen mode Exit fullscreen mode

Then add to Claude Desktop config:

{"mcpServers":{"my-server":{"command":"node","args":["/path/to/mcp-server-starter/dist/index.js"]}}}
Enter fullscreen mode Exit fullscreen mode

Why MCP?

MCP (Model Context Protocol) is Anthropic's open protocol that lets LLMs talk to external tools. Write your server once and any MCP-aware client can use it — Claude Desktop, Cursor, VS Code, and more.

Instead of writing a custom integration for every LLM, you write your MCP server once and it works everywhere. Standard I/O transport — no HTTP server, no open ports, no Docker required.

What's Inside (Free Version)

Tool What it does
read_file Read any text file
list_directory List files in a folder with sizes
grep_search Search for text across your codebase

All TypeScript with the official MCP SDK. Compiles to a single Node entry point. MIT licensed.

Pro Version ($9.99)

The Pro Kit adds:

  • File metadata operations — stat, permissions, timestamps
  • API integration — fetch any URL with timeout handling
  • Web search — DuckDuckGo integration with LLM-optimized formatting
  • Dockerfile — containerized deployment
  • VPS deploy script — one-command deployment with systemd + rsync
  • Commercial license

Get Started


Also check out git-copilot — AI-free conventional commit message generator, and Claude Code Skills — battle-tested skills for developers.

Source: dev.to

arrow_back Back to Tutorials