# MCP Server Template

> MCP Server Template is an open-source MCP server for developer tools. Starter template for building production-style MCP servers in TypeScript and Node.js. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted
- **Repository:** https://github.com/qmmughal/mcp-server-template
- **MCP Registry name:** io.github.qmmughal/mcp-server-template
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-18

## About

The README describes this repository as a scaffold for writing Model Context Protocol servers in TypeScript on Node.js, so developers begin with tooling, folder layout and build steps already in place rather than assembling them from scratch. It separates tools, resources, prompts and services into their own directories, and keeps protocol handlers thin so business logic can be tested on its own.

The project is wired for a typical workflow: a watch-mode dev command, a Vitest test suite, a typecheck script, and an esbuild step that bundles the server into a single dist/index.js file. Logging goes through pino to stderr so that stdout stays clean for JSON-RPC traffic. Input validation for tools and environment variables uses Zod.

The README includes setup snippets for connecting the built server to Claude Desktop and Cursor over stdio. It also covers a GitHub Actions workflow that publishes to npm and the MCP Registry when a v* tag is pushed, which requires an NPM_TOKEN repository secret. It is aimed at developers who want to build their own MCP server.

## Features

- **Strict TypeScript setup:** Ships with a TypeScript configuration targeting modern ECMAScript with strict type checking and a typecheck script.
- **Runtime input validation:** Uses Zod schemas to validate tool inputs and environment variables at runtime.
- **Single-file bundling:** esbuild compiles the server into one dist/index.js so node_modules need not be deployed.
- **Stderr-safe logging:** A pino logger writes to stderr so stdout remains usable for the JSON-RPC stdio transport.
- **Modular project layout:** Separate folders for tools, resources, prompts, services and error utilities.
- **Automated registry publishing:** A GitHub workflow publishes to npm and the MCP Registry when a version tag is pushed.

## Good for

- Starting a new custom MCP server in TypeScript without writing boilerplate
- Exposing internal APIs or data to Claude Desktop or Cursor through MCP tools
- Publishing a scoped MCP server package to npm and the MCP Registry from a tagged release

## Install

### Claude Code (Terminal)

```sh
claude mcp add mcp-server-template -- npx -y @qmmughal/mcp-server-template
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "mcp-server-template": {
      "command": "npx",
      "args": [
        "-y",
        "@qmmughal/mcp-server-template"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "mcp-server-template": {
      "command": "npx",
      "args": [
        "-y",
        "@qmmughal/mcp-server-template"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "mcp-server-template": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@qmmughal/mcp-server-template"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "mcp-server-template": {
      "command": "npx",
      "args": [
        "-y",
        "@qmmughal/mcp-server-template"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "mcp-server-template": {
      "command": "npx",
      "args": [
        "-y",
        "@qmmughal/mcp-server-template"
      ]
    }
  }
}
```

## FAQ

### Which transport does the template use?

The registry entry lists stdio as the transport, and the README's stdio connection setup is used by the entrypoint.

### What is needed to publish automatically?

The README says the publish workflow needs an NPM_TOKEN repository secret with publish rights to the @qmmughal scope; MCP Registry auth uses GitHub OIDC.

### Which clients does the README show how to connect to?

It gives setup instructions for Claude Desktop and Cursor.

### Is MCP Server Template free?

Yes. MCP Server Template is open source, so you can use and self-host it for free.

### How do I add MCP Server Template to Claude Code?

Run this command in your terminal: claude mcp add mcp-server-template -- npx -y @qmmughal/mcp-server-template

### What are the best alternatives to MCP Server Template?

The closest alternatives to MCP Server Template are Srecode Template MCP, Makefile MCP, Swapi MCP, Velocity Template Language MCP and Skybridge Example MCP App.

## Where this comes from

- Description: written from the project's README and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Srecode Template MCP](https://ai-powered.com/mcp/srecode-template-mcp): Srecode Template MCP is an open-source MCP server for developer tools.
- [Makefile MCP](https://ai-powered.com/mcp/makefile-mcp-2): Makefile MCP is an open-source MCP server for developer tools.
- [Swapi MCP](https://ai-powered.com/mcp/swapi-mcp): Swapi MCP is an open-source MCP server for developer tools.
- [Velocity Template Language MCP](https://ai-powered.com/mcp/velocity-template-language-mcp): Velocity Template Language MCP is an open-source MCP server for developer tools.
- [Skybridge Example MCP App](https://ai-powered.com/mcp/skybridge-example-mcp-app): Skybridge Example MCP App is an open-source MCP server for productivity.
- [Crimson Crab MCP Template](https://ai-powered.com/mcp/crimson-crab-mcp-template): Crimson Crab MCP Template is an open-source MCP server for ai models and llm tooling.
- [Template](https://ai-powered.com/mcp/template-8): Template is an MCP server for developer tools.
- [Test Shape MCP](https://ai-powered.com/mcp/test-shape-mcp): Test Shape MCP is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/mcp-server-template
