MCP Server Starter

MCP Server Starter

A minimal, production-ready starter for building Model Context Protocol servers in TypeScript, supporting both stdio and streamable HTTP transports with optional bearer-token auth.

Category
Visit Server

README

MCP Server Starter

A minimal, production-ready starter for building Model Context Protocol servers in TypeScript. One server definition runs two ways: over stdio for local clients, and over streamable HTTP when you deploy it, with optional bearer-token auth.

Features

  • Two transports, one definition. Runs over stdio locally (Claude Code, Claude Desktop) and switches to streamable HTTP when PORT is set. Tools live in one place.
  • Optional auth for HTTP. A shared bearer token, accepted via the Authorization header or a ?token= query param (some hosted clients can only pass a query param).
  • Typed tools. Inputs are validated with zod, so the model gets a clear schema and you get type safety.
  • Deploy-ready. Stateless per request, with a Dockerfile included. Runs on any container host.
  • Small and readable. A handful of files, no framework, easy to fork.

Quick start

git clone https://github.com/Axis-Data-Labs/mcp-server-starter
cd mcp-server-starter
npm install
cp .env.example .env

Run it locally over stdio:

npm run dev

Connect it to Claude Code

claude mcp add my-server -- npx tsx /absolute/path/to/mcp-server-starter/src/index.ts

Or add it to your client's MCP config:

{
  "mcpServers": {
    "my-server": {
      "command": "npx",
      "args": ["tsx", "/absolute/path/to/mcp-server-starter/src/index.ts"]
    }
  }
}

Ask the model to call echo or add to confirm it works.

HTTP mode and deploying

Set PORT to run the streamable HTTP transport instead of stdio:

PORT=3000 MCP_AUTH_TOKEN=your-secret npm start

The server listens on POST /mcp. Point a remote MCP client at https://your-host/mcp and send the token as Authorization: Bearer your-secret (or ?token=your-secret). A Dockerfile is included, and most container platforms set PORT for you, so deploying is usually just pushing the repo.

Adding a tool

  1. Create src/tools/<name>.ts and export a register<Name>Tools(server) function.
  2. Register tools with server.tool(name, description, zodSchema, handler).
  3. Call your register…Tools(server) from src/server.ts.
server.tool(
  "greet",
  "Greet someone by name.",
  { name: z.string().describe("Who to greet") },
  async ({ name }) => ({ content: [{ type: "text", text: `Hello, ${name}` }] }),
);

Project structure

src/
  index.ts        picks the transport (stdio vs HTTP) at startup
  server.ts       builds the server and registers tools
  http.ts         streamable HTTP transport and optional auth
  tools/
    example.ts    example tools, replace with your own

License

MIT. See LICENSE.

Built and maintained by Axis Data Labs.

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