- Home
- MCP servers
- MCP TypeScript Template
MCP TypeScript Template
- typescript
0
GitHub Stars
typescript
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You are building an MCP server using a TypeScript-based template designed to run an HTTP MCP server with Express, validated tools, and modern tooling. This setup helps you ship a robust, type-safe MCP server quickly, with a clear path to add your own tools and business logic while keeping code quality high through linting and formatting.
How to use
Run your MCP server locally and connect clients to the standard HTTP transport. Your server exposes an MCP endpoint over HTTP and accepts registered tools with strict input validation. You can start by using the provided example tool as a reference, then replace it with your own tools and business logic. The default base URL where clients connect is http://localhost:3000.
How to install
# Prerequisites
- Node.js (version 14+ recommended)
- npm (comes with Node.js)
- Docker (optional, for containerized runs)
# 1. Clone or start from your template
# Replace with your actual repository URL when cloning
# 2. Install dependencies
npm install
# 3. Build the project
npm run build
# 4. Start the server
npm start
Configuration and usage notes
The server runs on port 3000 by default. You can customize port usage through environment configuration when running in containers or in development, such as PORT=3000.
Docker and containerized deployment are supported. Build the container image and run it, or use docker-compose to manage the service with the port mapped to 3000.
Development and tooling tips
Development supports hot reloading in watch mode. Use the development script to run in watch mode and observe changes without a full rebuild.
Linting and formatting help keep code quality high. Run lint, fix lint issues automatically, and format the codebase to maintain a consistent style.
Examples to start from
Begin with the example echo tool to understand the MCP tool registration flow, then implement your own tools by following the pattern shown for registering a tool with a title, description, and input schema.
Available tools
echo
Echoes back the provided message - a simple example to demonstrate MCP tool implementation.
my_tool
My Custom Tool registered with a descriptive title and input schema. This demonstrates extending the server with domain-specific functionality.