MCP TypeScript Simple Template
MCP TypeScript シンプルテンプレート
モデルコンテキストプロトコル(MCP)サーバーを構築するためのシンプルなTypeScriptテンプレート。このプロジェクトは、AIシステムに統合できるカスタムMCPツールを作成するための基盤を提供します。
概要
このテンプレートは、サンプルのBMI計算ツールを備えた基本的なMCPサーバーを実装します。以下の操作方法を示します。
TypeScriptでMCPサーバーをセットアップする
Zodを使用した入力検証を備えたMCPツールの定義と実装
通信のためにサーバーを標準I/Oに接続する
Related MCP server: MCP Server Python Template
前提条件
Node.js (v20以上を推奨)
npmまたはyarn
インストール
このリポジトリをクローンする
依存関係をインストールします:
npm installプロジェクト構造
index.ts- サンプルツールを使用したメインサーバーの実装package.json- プロジェクトの依存関係とスクリプトtsconfig.json- TypeScript 設定
使用法
構築と実行
サーバーをビルドして起動します。
npm startこれにより、TypeScript コードがコンパイルされ、MCP サーバーが起動します。
発達
開発の場合、次のことが可能です。
index.tsを修正して独自のツールを追加するビルド コマンドを実行してコンパイルします。
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 SDKzod- スキーマ検証dotenv- 環境変数の管理typescript- TypeScript コンパイラ
ライセンス
ISC
貢献
貢献を歓迎します!お気軽にプルリクエストを送信してください。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA demonstration implementation of the Model Context Protocol server that facilitates communication between AI models and external tools while maintaining context awareness.
- -licenseNot gradedqualityNot gradedmaintenanceA streamlined foundation for building Model Context Protocol servers in Python, designed to make AI-assisted development of MCP tools easier and more efficient.12
- AlicenseDqualityDmaintenanceA foundation for building custom local Model Context Protocol (MCP) servers that provide tools accessible to AI assistants like Cursor or Claude Desktop.137MIT
- -licenseNot gradedqualityDmaintenanceA standardized foundation for building Model Context Protocol servers that integrate with VS Code, using Python with stdio transport for seamless AI tool integration.
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to control Unreal E…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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