MCP TypeScript Simple Template logo

MCP TypeScript Simple Template

by ChenReuven

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.

View on GitHub

Last updated: N/A

What is MCP TypeScript Simple Template?

This template implements a basic MCP server with a sample BMI calculator tool, demonstrating how to set up an MCP server in TypeScript, define and implement MCP tools with input validation using Zod, and connect the server to standard I/O for communication.

How to use MCP TypeScript Simple Template?

To use this template, clone the repository, install dependencies with npm install, and then build and start the server using npm start. Modify index.ts to add your own tools, defining input schemas using Zod and implementing the tool's logic.

Key features of MCP TypeScript Simple Template

  • Basic MCP server setup

  • Tool definition with Zod validation

  • Standard I/O communication

  • Sample BMI calculator tool

  • TypeScript implementation

Use cases of MCP TypeScript Simple Template

  • Creating custom MCP tools

  • Integrating tools with AI systems

  • Developing MCP servers

  • Building conversational AI applications

  • Implementing custom AI agents

FAQ from MCP TypeScript Simple Template

What is MCP?

MCP stands for Model Context Protocol, a protocol for communication between AI models and external tools.

What is Zod used for?

Zod is used for schema validation of input parameters for MCP tools.

How do I add a new tool?

Modify index.ts and follow the provided pattern to define your tool with its input schema and implementation.

What are the dependencies?

The main dependencies are @modelcontextprotocol/sdk, zod, dotenv, and typescript.

How do I contribute?

Contributions are welcome! Please feel free to submit a Pull Request.