Skip to main content
Glama
fix2015

mcp-server-starter

by fix2015

mcp-server-starter

Production-ready TypeScript template for building MCP (Model Context Protocol) servers. Works with Claude Code, Cursor, and any MCP client.

Quick Start

# Clone the template
git clone https://github.com/fix2015/mcp-server-starter.git my-mcp-server
cd my-mcp-server

# Install dependencies
npm install

# Build
npm run build

# Run the server
npm start

Related MCP server: MCP Server Boilerplate

Project Structure

src/
  index.ts                 # Server entry point — registers tools, resources, and prompts
  tools/
    example-tool.ts        # Example tool implementation (process_text)
  resources/
    example-resource.ts    # Example resource implementation (server-info)

How to Add a New Tool

Create a new file in src/tools/:

// src/tools/my-tool.ts
import { z } from "zod";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";

export function registerMyTool(server: McpServer): void {
  server.tool(
    "my_tool_name",
    "Description of what the tool does",
    {
      input: z.string().describe("Input parameter description"),
    },
    async ({ input }) => {
      // Your tool logic here
      return {
        content: [{ type: "text", text: `Result: ${input}` }],
      };
    }
  );
}

Then register it in src/index.ts:

import { registerMyTool } from "./tools/my-tool.js";

registerMyTool(server);

How to Add a New Resource

Create a new file in src/resources/:

// src/resources/my-resource.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";

export function registerMyResource(server: McpServer): void {
  server.resource("my-resource", "custom://my-data", async (uri) => {
    return {
      contents: [
        {
          uri: uri.href,
          mimeType: "application/json",
          text: JSON.stringify({ key: "value" }),
        },
      ],
    };
  });
}

Then register it in src/index.ts:

import { registerMyResource } from "./resources/my-resource.js";

registerMyResource(server);

Configuration

Claude Code

Add to your claude_desktop_config.json:

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

With Environment Variables

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

Development

# Watch mode — recompiles on file changes
npm run dev

# Test with the MCP Inspector
npm run inspect

Included Examples

Type

Name

Description

Tool

process_text

Transforms text with uppercase and word counting

Resource

server-info

Returns server metadata as JSON

Prompt

summarize

Generates a summary prompt for a given topic

Deployment

As a Local Server

Build and point your MCP client config to the built dist/index.js.

As an npm Package

  1. Update name in package.json to your package name

  2. Run npm publish

  3. Users can then run: npx your-package-name

With Docker

FROM node:22-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY dist/ ./dist/
ENTRYPOINT ["node", "dist/index.js"]
docker build -t my-mcp-server .
docker run -i my-mcp-server

Requirements

  • Node.js >= 18

  • TypeScript >= 5.7

License

MIT

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (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.

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/fix2015/mcp-server-starter'

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