mcp-server-starter
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-server-starter How do I add a custom tool to this server?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Server Starter (TypeScript)
A small TypeScript template for building Model Context Protocol (MCP) servers that you can run in production. It follows the pattern used in my LinkedIn, Twitter, Medium and Kaggle MCP servers:
@modelcontextprotocol/sdk1.x with the high-levelMcpServerAPIstdio transport, so it works with Claude Desktop, Cursor and any MCP client
Logs go only to stderr. stdout is left for the protocol (see why).
zod input validation on every tool
Reads the API key safely from an env var: the key is never logged, and if it's missing you get a clear error instead of a crash
Error handling that turns failures into MCP tool errors (
isError: true) instead of crashing the serverGitHub Actions CI that installs, typechecks, lints and builds on Node 20 and 22
MIT licensed
Quick start
Requires Node.js 20 or newer.
# use this repo as a template (or clone it)
git clone https://github.com/Dishant27/mcp-server-starter.git my-mcp-server
cd my-mcp-server
npm install
npm run build
# try it in the MCP Inspector
EXAMPLE_API_KEY=your-key npm run inspectScripts:
Script | What it does |
| Compile |
| Recompile on every change |
| Run the server on stdio |
| Type-check without emitting |
| ESLint (it also blocks |
| Open the server in the MCP Inspector |
Related MCP server: MCP Server Boilerplate
Project layout
src/
index.ts # entry point: creates the server, registers tools, connects stdio
logger.ts # stderr-only logger (LOG_LEVEL=debug|info|warn|error)
config.ts # env var access (API key, base URL) and secret masking
errors.ts # runTool() wrapper and ok() helper for tool results
tools/
index.ts # registers every tool
exampleSearch.ts # example tool: zod inputs, API key, fetch, error handlingConfiguration
Variable | Required | Description |
| for | API key for the upstream service |
| no | Override the upstream base URL (default |
| no |
|
Set these in the env block of your MCP client config (below). For local experiments, copy .env.example to .env. It's in .gitignore, so never commit real keys.
Use it with Claude Desktop or Cursor
Build first (npm run build), then point your client at dist/index.js using an absolute path.
Claude Desktop (claude_desktop_config.json; on macOS it's at ~/Library/Application Support/Claude/, and on Windows at %APPDATA%\Claude\):
{
"mcpServers": {
"mcp-server-starter": {
"command": "node",
"args": ["/absolute/path/to/mcp-server-starter/dist/index.js"],
"env": {
"EXAMPLE_API_KEY": "your-key-here"
}
}
}
}Cursor (~/.cursor/mcp.json for all projects, or .cursor/mcp.json in one project) uses the same shape:
{
"mcpServers": {
"mcp-server-starter": {
"command": "node",
"args": ["/absolute/path/to/mcp-server-starter/dist/index.js"],
"env": {
"EXAMPLE_API_KEY": "your-key-here"
}
}
}
}Restart the client after editing the config. The server's stderr shows up in the client's MCP logs.
How to add a tool
Create
src/tools/myTool.ts:import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import { z } from 'zod'; import { ok, runTool } from '../errors.js'; export function registerMyTool(server: McpServer): void { server.registerTool( 'my-tool', { title: 'My tool', description: 'One clear sentence the model can use to decide when to call this.', inputSchema: { id: z.string().min(1).describe('ID of the thing to fetch') } }, async ({ id }) => runTool('my-tool', async () => { // inputs are already validated by zod here const result = { id, status: 'ok' }; return ok(result); }) ); }Register it in
src/tools/index.ts:import { registerMyTool } from './myTool.js'; // ... registerMyTool(server);Rebuild with
npm run buildand restart your MCP client.
Tips:
Write
descriptionand each.describe()for the model, since that's how it picks tools and fills in arguments.Throw inside
runTool(). It logs the details to stderr and gives the model a shortisErrormessage, so one failed call never takes the server down.Keep secrets in
config.ts. Read them lazily and never log them (usemaskSecret()if you need to show that a key is set).Use relative imports ending in
.js('./myTool.js'). This is ESM withNodeNextresolution.
Why logs go to stderr
With the stdio transport, stdout is the protocol: every byte on it must be a JSON-RPC message for the client. A single console.log('starting...') puts non-JSON into that stream. Depending on the client, you'll see parse errors, a server that "connects" but shows no tools, or a connection that drops without explanation. It's the most common reason a new MCP server doesn't work.
This template guards against that in three ways:
src/logger.tswrites everything withconsole.error(stderr), which clients capture as logs.ESLint's
no-consolerule allows onlyconsole.error, so a strayconsole.logfailsnpm run lintand CI.The secret is never printed. Startup logs show only a masked form like
sk-t…7890.
My other MCP servers
linkedin-mcp-server: LinkedIn API integration
twitter-mcp: Twitter/X, with CRUD-style operations through the Twitter API
medium-mcp-server: read your Medium profile and publications, and publish drafts
kaggle-MCP: work with Kaggle competitions
License
MIT © 2026 Dishant Kumar
Available Tools
1 toolexample-searchExample searchC
Search the example API and return matching items. Replace this with a real tool for your service.
Inputs: query (required), limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only a single tool there is no possibility of overlap or misselection between tools. However, the tool itself is a generic placeholder ('example-search') with no concrete resource or service identified, so the purpose is only nominally clear.
The lone name 'example-search' uses a readable kebab-case verb_noun-ish pattern, but a single sample gives no real convention to assess. It reads as a template stub rather than a settled naming scheme.
A single placeholder tool is far too thin for any stated purpose; the server is explicitly a starter scaffold rather than a functional surface. One tool that tells the user to replace it does not earn its place as a set.
There is no identifiable domain beyond a generic 'example API', so CRUD/lifecycle coverage cannot be assessed and is clearly absent. No create, get, update, or delete counterparts exist, making the surface severely incomplete for any real workflow.
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Kickstart development with a customizable TypeScript template featuring sample tools for greeting,…
A simple Typescript MCP server built using the official MCP Typescript SDK and smithery/cli. This…
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Related MCP Servers
- FlicenseCqualityDmaintenanceA starter template for building MCP (Model Context Protocol) servers that integrate with Claude, Cursor, or other MCP-compatible AI assistants. Provides a clean foundation with TypeScript support, example tool implementation, and installation scripts for quick customization.2-
- FlicenseCqualityDmaintenanceA starter template for building custom MCP (Model Context Protocol) servers that can integrate with Claude, Cursor, or other MCP-compatible AI assistants. Provides a clean foundation with TypeScript support, example implementations, and installation scripts for quickly creating custom tools, resources, and prompts.2-
- -licenseNot gradedqualityNot gradedmaintenanceA production-ready starter template for building Model Context Protocol (MCP) servers with TypeScript. Includes automated tooling for creating new MCP tools, testing, and deployment to Claude Desktop.177 npm-
- AlicenseNot gradedqualityDmaintenanceA TypeScript template for building Model Context Protocol (MCP) servers that enables developers to quickly create custom tools and integrate them with AI platforms like Claude, Cursor, Windsurf, and Cline.34MIT