mcp-ts-simple-template
A lightweight, ready-to-use TypeScript template for building Model Context Protocol (MCP) servers. This template provides the essential scaffolding to create custom AI tools that can be seamlessly integrated with large language models.
Documentation
MCP TypeScript Simple Template
A simple TypeScript template for building Model Context Protocol (MCP) servers. This project provides a foundation for creating custom MCP tools that can be integrated with AI systems.
Overview
This template implements a basic MCP server with a sample BMI calculator tool. It demonstrates how to:
- Set up an MCP server in TypeScript
- Define and implement MCP tools with input validation using Zod
- Connect the server to standard I/O for communication
Prerequisites
- Node.js (v20 or higher recommended)
- npm or yarn
Installation
1. Clone this repository
2. Install dependencies:
npm installProject Structure
- `index.ts` - Main server implementation with sample tool
- `package.json` - Project dependencies and scripts
- `tsconfig.json` - TypeScript configuration
Usage
Building and Running
Build and start the server:
npm startThis will compile the TypeScript code and start the MCP server.
Development
For development, you can:
1. Modify `index.ts` to add your own tools
2. Run the build command to compile:
npm run buildCreating Custom Tools
To create a new tool, follow this pattern in `index.ts`:
server.tool(
"your-tool-name",
{
// Define input schema using Zod
paramName: z.string(),
// Add more parameters as needed
},
async ({ paramName }) => ({
content: [{
type: "text",
text: "Your tool's response"
}]
})
);Dependencies
- `@modelcontextprotocol/sdk` - Core MCP SDK
- `zod` - Schema validation
- `dotenv` - Environment variable management
- `typescript` - TypeScript compiler
License
ISC
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Frequently asked questions
What is mcp-ts-simple-template?
mcp-ts-simple-template is A lightweight, ready-to-use TypeScript template for building Model Context Protocol (MCP) servers. This template provides the essential scaffolding to create custom AI tools that can be seamlessly integrated with large language models.
How do I install mcp-ts-simple-template?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is mcp-ts-simple-template open source?
Yes — it is hosted on GitHub at https://github.com/ChenReuven/mcp-ts-simple-template and has 4 stars.
Related MCP tools
🍒 Cherry Studio is a desktop client that supports for multiple LLM providers. Built for the Model Context Protocol to enhance AI capabilities.
Enhanced ChatGPT Clone: Features Agents, MCP, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini...
FastGPT is a knowledge-based platform built on the LLMs, offers a comprehensive suite of out-of-the-box capabilities such as data processing, RAG retrieval, ...
Composio equips your AI agents & LLMs with 100+ high-quality integrations via function calling for the Model Context Protocol. Enhance AI assistants with powerf
📦 Repomix is a powerful tool that packs your entire repository into a single, AI-friendly file. Perfect for when you need to feed your codebase to Large Lan...
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Ag...
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP