MCP TypeScript Simple Template

by ChenReuven

Integrations

  • Provides the runtime environment for the MCP server, enabling server-side execution of the tools and communication via standard I/O.

  • Supports package management for the MCP server, allowing easy installation of dependencies and execution of build scripts.

  • Serves as the foundation for building custom MCP tools, providing type safety and structure for implementing tools that can be integrated with AI systems.

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 install

Project 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 start

This 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 build

Creating 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.

-
security - not tested
F
license - not found
-
quality - not tested

A foundation for creating custom Model Context Protocol servers that can integrate with AI systems, providing a simple BMI calculator tool as an example implementation.

  1. Overview
    1. Prerequisites
      1. Installation
        1. Project Structure
          1. Usage
            1. Building and Running
            2. Development
          2. Creating Custom Tools
            1. Dependencies
              1. License
                1. Contributing

                  Related MCP Servers

                  • A
                    security
                    F
                    license
                    A
                    quality
                    A starter template for building Model Context Protocol servers that can be integrated with Cursor or Claude Desktop, allowing developers to create custom tools and extensions for AI assistants.
                    Last updated -
                    1
                    6
                    9
                    TypeScript
                    • Apple
                  • -
                    security
                    A
                    license
                    -
                    quality
                    A Model Context Protocol server that provides seamless interaction with Workato's API through custom AI tools, enabling management of recipes, connections, connectors, folders, and activity logs.
                    Last updated -
                    TypeScript
                    MIT License
                    • Apple
                    • Linux
                  • A
                    security
                    F
                    license
                    A
                    quality
                    A Model Context Protocol server that enables AI assistants to interact with Bluesky/ATProtocol, providing authentication, timeline access, post creation, and social features like likes and follows.
                    Last updated -
                    18
                    10
                    TypeScript
                    • Apple
                    • Linux
                  • -
                    security
                    F
                    license
                    -
                    quality
                    A demonstration implementation of the Model Context Protocol server that facilitates communication between AI models and external tools while maintaining context awareness.
                    Last updated -
                    Python
                    • Linux
                    • Apple

                  View all related MCP servers

                  ID: 50o10f60hi