Skip to main content
Glama

MCP TypeScript Simple Template

by ChenReuven

MCP TypeScript シンプルテンプレート

モデルコンテキストプロトコル(MCP)サーバーを構築するためのシンプルなTypeScriptテンプレート。このプロジェクトは、AIシステムに統合できるカスタムMCPツールを作成するための基盤を提供します。

概要

このテンプレートは、サンプルのBMI計算ツールを備えた基本的なMCPサーバーを実装します。以下の操作方法を示します。

  • TypeScriptでMCPサーバーをセットアップする
  • Zodを使用した入力検証を備えたMCPツールの定義と実装
  • 通信のためにサーバーを標準I/Oに接続する

前提条件

  • Node.js (v20以上を推奨)
  • npmまたはyarn

インストール

  1. このリポジトリをクローンする
  2. 依存関係をインストールします:
npm install

プロジェクト構造

  • index.ts - サンプルツールを使用したメインサーバーの実装
  • package.json - プロジェクトの依存関係とスクリプト
  • tsconfig.json - TypeScript 設定

使用法

構築と実行

サーバーをビルドして起動します。

npm start

これにより、TypeScript コードがコンパイルされ、MCP サーバーが起動します。

発達

開発の場合、次のことが可能です。

  1. index.tsを修正して独自のツールを追加する
  2. ビルド コマンドを実行してコンパイルします。
npm run build

カスタムツールの作成

新しいツールを作成するには、 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" }] }) );

依存関係

  • @modelcontextprotocol/sdk - コア MCP SDK
  • zod - スキーマ検証
  • dotenv - 環境変数の管理
  • typescript - TypeScript コンパイラ

ライセンス

ISC

貢献

貢献を歓迎します!お気軽にプルリクエストを送信してください。

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

AI システムと統合できるカスタム モデル コンテキスト プロトコル サーバーを作成するための基盤であり、実装例としてシンプルな BMI 計算ツールを提供します。

  1. 概要
    1. 前提条件
      1. インストール
        1. プロジェクト構造
          1. 使用法
            1. 構築と実行
            2. 発達
          2. カスタムツールの作成
            1. 依存関係
              1. ライセンス
                1. 貢献

                  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

                  MCP directory API

                  We provide all the information about MCP servers via our MCP API.

                  curl -X GET 'https://glama.ai/api/mcp/v1/servers/ChenReuven/mcp-ts-simple-template'

                  If you have feedback or need assistance with the MCP directory API, please join our Discord server