mcp-starter-template-ts
TypeScript starter template for building Model Context Protocol (MCP) servers, designed to help developers create secure and robust AI-agent-compatible services.
claude mcp add --transport stdio onamfc-mcp-starter-template-ts node dist/server.js \ --env HOST="Server host address (default localhost)" \ --env PORT="Server port number (default 3000)" \ --env NODE_ENV="Environment (development, production, test) (default development)" \ --env LOG_LEVEL="Logging level (error, warn, info, debug) (default info)" \ --env CORS_ORIGINS="Allowed CORS origins (comma-separated) (default *)" \ --env MAX_REQUEST_SIZE="Maximum request body size (e.g., 10mb) (default 10mb)" \ --env ENABLE_HEALTH_CHECK="Enable health check endpoint (true|false) (default true)"
How to use
This MCP server template provides a TypeScript-based foundation for building MCP servers. It exposes a set of prepared tools (such as calculator, filesystem, text-processing, and weather) that you can use to perform common tasks within the MCP ecosystem, along with resources for configuration, logs, and documentation. After building the project, start the server and interact with the built-in tools through the MCP API or CLI by sending structured tool invocation payloads. The project emphasizes type safety, robust validation, health checks, and observability, making it suitable for production-ready development and extension.
How to install
Prerequisites:
- Node.js 18.0.0 or higher
- npm 8.0.0 or higher (or yarn/pnpm equivalent)
Installation steps:
- Clone the repository git clone https://github.com/onamfc/mcp-starter-template-ts.git
- Navigate into the project cd mcp-starter-template-ts
- Install dependencies
npm install
or: yarn install or pnpm install
- Build the project npm run build
- Start the server (production) npm start
- (Optional) Run in development with hot reload npm run dev
Notes:
- The server is configured via environment variables. You can create a .env file in the project root to customize PORT, HOST, LOG_LEVEL, and other settings before starting in your environment.
Additional notes
Tips and common considerations:
- After building, the entry point is typically dist/server.js; ensure your build outputs are up to date before starting in production.
- Environment variables control health checks, request size, and CORS behavior. Adjust ENABLE_HEALTH_CHECK, MAX_REQUEST_SIZE, and CORS_ORIGINS as needed for your deployment.
- The template includes tooling such as calculator, filesystem, text-processing, and weather. You can extend/add new tools by following the documented patterns and registering them in the setup files.
- Run npm test to execute unit tests and verify coverage before deploying.
- If using Docker or other container setups, ensure the built dist directory is available inside the container image and that the entry point matches dist/server.js.
Related MCP Servers
mcp-openapi-schema-explorer
MCP server providing token-efficient access to OpenAPI/Swagger specs via MCP Resource Templates for client-side exploration.
src-to-kb
Convert source code to LLM ready knowledge base
glasses
Glasses MCP is a simple MCP server that lets your AI agent see and capture the web ๐
MCP-Client -Project-using-NodeJS
A minimal Model Context Protocol (MCP) implementation built with Node.js and TypeScript. This project demonstrates clientโserver communication over stdio, structured message handling, and local data access, developed with VS Code and GitHub Copilot to explore modern AI tool integration workflows.
MCPlex-AI-v1.0
๐ ๐ผ๐ฑ๐ฒ๐น ๐๐ผ๐ป๐๐ฒ๐ ๐ ๐ฃ๐ฟ๐ผ๐๐ผ๐ฐ๐ผ๐น (๐ ๐๐ฃ) ๐๐ฎ๐๐ฒ๐ฑ ๐๐๐ ๐๐ | ๐ง๐ผ๐ผ๐น ๐๐ป๐๐ฒ๐ด๐ฟ๐ฎ๐๐ถ๐ผ๐ป | ๐๐ฒ๐บ๐ถ๐ป๐ถ ๐ฎ.๐ฌ
mcp-github-integration
A TypeScript package for interacting with the GitHub API through an MCP (Model Context Protocol) server integration.