mcp-server-starter

mcp-server-starter

Production-ready TypeScript template for building MCP servers. Works with Claude Code, Cursor, and any MCP client.

Category
Visit Server

README

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

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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured