Enables containerization of the MCP server with Docker support, including build and run configurations and Docker Compose setup for deployment.
Provides code quality checking with ESLint integration, including linting configuration and commands for checking and fixing code quality issues.
Uses Express as the web framework for handling HTTP connections, providing the transport layer for MCP communication with comprehensive middleware support.
Offers code formatting capabilities with Prettier integration, including formatting configuration and commands for checking and applying consistent code style.
Provides full TypeScript support with strict configuration for type safety and tooling integration when building MCP servers.
Utilizes Vite as the build system to compile TypeScript code with ES modules output for fast development and optimized production builds.
MCP TypeScript Template
A TypeScript template for building remote Model Context Protocol (MCP) servers with modern tooling and best practices while leveraging the MCP TypeScript SDK.
Features
This template provides:
TypeScript - Full TypeScript support with strict configuration
Vite - Fast build system with ES modules output
Express - Fast, unopinionated web framework for HTTP server
ESLint + Prettier - Code quality and formatting
Docker - Containerization support
Example Tool - Simple echo tool to demonstrate MCP tool implementation
Getting Started
Clone or use this template
git clone <your-repo-url> cd mcp-typescript-templateInstall dependencies
npm installBuild the project
npm run buildStart the server
npm start
The server will be available at http://localhost:3000
for MCP connections.
Development
Watch mode for development (with hot reloading)
Build the project
Linting
Lint the project
Fix all auto-fixable lint errors
Formatting
Format files in the project
Check formatting
Available Tools
The template includes one example tool:
echo
Echoes back the provided message - a simple example to demonstrate MCP tool implementation.
Parameters:
message
(string) - The message to echo back
Customizing Your MCP Server
Update package.json - Change name, description, and keywords
Modify src/index.ts - Replace the echo tool with your custom tools
Add your logic - Create additional TypeScript files for your business logic
Update README - Document your specific MCP server functionality
Docker
Build and run using Docker:
Build the Docker image
Run the container
Docker Compose
Project Structure
Architecture
This template follows a simple architecture:
HTTP Transport - Uses Express with StreamableHTTPServerTransport for remote MCP connections
Tool Registration - Tools are registered with JSON schemas for input validation
Error Handling - Proper MCP-formatted error responses
Session Management - Handles MCP session initialization and management
Example: Adding a New Tool
Why Express?
This template uses Express for the HTTP server, which provides:
MCP SDK Compatibility - Full compatibility with the MCP TypeScript SDK's StreamableHTTPServerTransport
Mature & Stable - Battle-tested HTTP server with extensive ecosystem
TypeScript Support - Excellent TypeScript support with comprehensive type definitions
Middleware Ecosystem - Rich ecosystem of middleware for common tasks
Documentation - Comprehensive documentation and community support
Reliability - Proven reliability for production applications
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A starter template for building remote Model Context Protocol servers using TypeScript, providing modern tooling and best practices while leveraging the MCP TypeScript SDK.
Related MCP Servers
- AsecurityAlicenseAqualityA production-ready template for creating Model Context Protocol servers with TypeScript, providing tools for efficient testing, development, and deployment.Last updated -13638MIT License
- AsecurityAlicenseAqualityA TypeScript-based template for building Model Context Protocol servers, featuring fast testing, automated version management, and a clean structure for MCP tool implementations.Last updated -1364MIT License
- -securityFlicense-qualityA starter template for creating Model Context Protocol servers using TypeScript, providing basic setup and sample tool implementation for developers to build their own MCP servers.
- -securityFlicense-qualityA template repository for building Model Context Protocol (MCP) servers with TypeScript, featuring full TypeScript support, testing setup, CI/CD pipelines, and modular architecture for easy extension.Last updated -0