home / mcp / mcp boilerplate server
A fast, TypeScript-first MCP server providing an Express 5.x surface with MCP SDK integration, validation, and observability.
Configuration
View docs{
"mcpServers": {
"jhon2c-mcp-boilerplate": {
"url": "http://localhost:3001/sse",
"headers": {
"PORT": "3000",
"DEBUG": "mcp:*",
"MCP_API_KEY": "YOUR_API_KEY"
}
}
}
}You can quickly bootstrap an MCP (Model Context Protocol) server using this modern, TypeScript-first boilerplate. It provides an Express 5.x server, built-in MCP SDK integration, robust validation, smart logging, and easy environment configuration to connect with MCP clients and Cursor.
You run your MCP server locally and connect MCP clients to it. The server exposes an MCP-compatible endpoint and accepts configuration through environment variables and a simple Cursor setup. To start using it, ensure the server is running and then configure your MCP client to point at the server URL, typically the HTTP endpoint exposed by the server. The MCP client can subscribe to events, query data, and perform actions provided by the serverβs MCP surface.
Prerequisites: you need Bun 1.0+ or Node.js 20+. You will also use a package manager (bun, npm, pnpm, or yarn) to install dependencies.
Step 1: Clone the project and navigate into it.
Step 2: Install dependencies.
Step 3: Start the development server.
# Clone repository
git clone https://github.com/jhon2c/mcp-boilerplate.git
cd mcp-boilerplate
# Install dependencies (with Bun) [Recommended]
bun install
# OR with npm
npm install
# Start development server
bun run devCreate a local environment file to configure runtime values for the MCP server. This enables you to run the server with a custom port and API key for MCP authentication.
PORT=3000
MCP_API_KEY=your_api_key_here
DEBUG=mcp:*If you use Cursor to manage MCP servers, add a new global MCP server entry with the following URL to connect to the running server.
{
"mcpServers": {
"mcp_boilerplate": {
"url": "http://localhost:3001/sse"
}
}
}A modern Express-based HTTP server with TypeScript support to host MCP endpoints.
Robust input validation using Zod schemas to ensure MCP requests conform to expected shapes.
Out-of-the-box integration with @modelcontextprotocol/sdk to interact with MCP clients and resources.
Smart logging setup for request tracing and debugging.