MT

mcpdotdirect/template-mcp-server

Developer tools公式

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

76 stars 37 forks 品質 72 トレンド 14MIT

mcpdotdirect/template-mcp-server は [https://github.com/mcpdotdirect/template-mcp-server.] からインポートされた MCP サーバーの候補です

概要

mcpdotdirect/template-mcp-server は [https://github.com/mcpdotdirect/template-mcp-server.] からインポートされた MCP サーバーの候補です

概要(AI 翻訳)

FastMCP を使用した MCP (Model Context Protocol) サーバを素早く構築する CLI ツール

利用方法

どのようなものが含まれています

テンプレートには以下が含まれます:

  • FastMCP を使用した stdio および HTTP トランスポートオプションのベーシックなサーバー設定
  • MCPツール、リソース、およびプロンプトを定義するための構造
  • TypeScript の設定
  • 開発スクリプトと構成

✨ 機能

  • FastMCP: FastMCPフレームワークを使用して、よりシンプルな実装 -Dual Transport Support: stdioまたはHTTP上でMCPサーバーを実行
  • TypeScript:タイプ安全のためのフルTypeScriptサポート
  • 拡張可能:カスタムツール、リソース、およびプロンプトを簡単に追加できます

OST 始める

プロジェクトを作成した後:

  1. ご希望のパッケージマネージャを使用して依存関係をインストールします。

  2. サーバーを始めて下さい:

  3. オートリロードの開発のため:

Note:package.json のデフォルトスクリプトは、Ban をランタイム([[T0])として使用します。 異なるパッケージマネージャやランタイムを使用するのが好きなら、これらのスクリプトをpackage.jsonファイルで変更して、Node.jsまたは選択した別のランタイムを使うことができます。

447 詳細使用

輸送方法

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

@mcpdotdirect/template-mcp-server

A CLI tool to quickly get started building your very own MCP (Model Context Protocol) server using FastMCP

📋 Usage

# with npx
npx @mcpdotdirect/create-mcp-server

# Or with npm
npm init @mcpdotdirect/mcp-server

🔭 What’s Included

The template includes:

  • Basic server setup with both stdio and HTTP transport options using FastMCP
  • Structure for defining MCP tools, resources, and prompts
  • TypeScript configuration
  • Development scripts and configuration

✨ Features

  • FastMCP: Built using the FastMCP framework for simpler implementation
  • Dual Transport Support: Run your MCP server over stdio or HTTP
  • TypeScript: Full TypeScript support for type safety
  • Extensible: Easy to add custom tools, resources, and prompts

🚀 Getting Started

After creating your project:

  1. Install dependencies using your preferred package manager:

    # Using npm
    npm install
    
    # Using yarn
    yarn
    
    # Using pnpm
    pnpm install
    
    # Using bun
    bun install
    
  2. Start the server:

    # Start the stdio server
    npm start
    
    # Or start the HTTP server
    npm run start:http
    
  3. For development with auto-reload:

    # Development mode with stdio
    npm run dev
    
    # Development mode with HTTP
    npm run dev:http
    

Note: The default scripts in package.json use Bun as the runtime (e.g., bun run src/index.ts). If you prefer to use a different package manager or runtime, you can modify these scripts in your package.json file to use Node.js or another runtime of your choice.

📖 Detailed Usage

Transport Methods

The MCP server supports two transport methods:

  1. stdio Transport (Command Line Mode):

    • Runs on your local machine
    • Managed automatically by Cursor
    • Communicates directly via stdout
    • Only accessible by you locally
    • Ideal for personal development and tools
  2. SSE Transport (HTTP Web Mode):

    • Can run locally or remotely
    • Managed and run by you
    • Communicates over the network
    • Can be shared across machines
    • Ideal for team collaboration and shared tools

Running the Server Locally

stdio Transport (CLI Mode)

Start the server in stdio mode for CLI tools:

# Start the stdio server
npm start
# or with other package managers
yarn start
pnpm start
bun start

# Start the server in development mode with auto-reload
npm run dev
# or
yarn dev
pnpm dev
bun dev

HTTP Transport (Web Mode)

Start the server in HTTP mode for web applications:

# Start the HTTP server
npm run start:http
# or
yarn start:http
pnpm start:http
bun start:http

# Start the HTTP server in development mode with auto-reload
npm run dev:http
# or
yarn dev:http
pnpm dev:http
bun dev:http
GitHub で README 全文を見る

インストール

npx @mcpdotdirect/create-mcp-server
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "my-mcp-stdio": { "command": "npm", "args": [ "start" ], "env": { "NODE_ENV": "development" } }, "my-mcp-sse": { "url": "http://localhost:3001/sse" } } }