Cover image
Try Now
2025-03-23

Una plantilla TypeScript liviana y lista para usar para la creación de servidores del Protocolo de contexto del modelo (MCP). Esta plantilla proporciona el andamio esencial para crear herramientas de IA personalizadas que pueden integrarse perfectamente con modelos de idiomas grandes.

3 years

Works with Finder

1

Github Watches

2

Github Forks

3

Github Stars

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.

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Yasir Eryilmaz
  • AI scriptwriting assistant for short, engaging video content.

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • J. DE HARO OLLE
  • Especialista en juegos de palabras en varios idiomas.

  • Daren White
  • A supportive coach for mastering all Spanish tenses.

  • albert tan
  • Japanese education, creating tailored learning experiences.

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • huahuayu
  • Una puerta de enlace de API unificada para integrar múltiples API de explorador de blockchain similar a Esterscan con soporte de protocolo de contexto modelo (MCP) para asistentes de IA.

  • deemkeen
  • Controle su MBOT2 con un combo de potencia: MQTT+MCP+LLM

  • zhaoyunxing92
  • 本项目是一个钉钉 MCP (Protocolo del conector de mensajes )服务 , 提供了与钉钉企业应用交互的 API 接口。项目基于 Go 语言开发 支持员工信息查询和消息发送等功能。 支持员工信息查询和消息发送等功能。

  • pontusab
  • La comunidad de cursor y windsurf, encontrar reglas y MCP

    Reviews

    1 (1)
    Avatar
    user_83dhyPBh
    2025-04-16

    I recently started using the mcp-ts-simple-template by ChenReuven and I'm thoroughly impressed! The template is straightforward and easy to use, making TypeScript project setup a breeze. The comprehensive welcome information ensures a smooth start, and the provided starting URL is incredibly helpful for swift project initialization. A must-have for any TypeScript developer looking for simplicity and efficiency. Highly recommended!