Skip to main content
Glama

MCP Server Template

by stevennevins

MCP サーバー テンプレート

前提条件

LLM CLI インストール

このプロジェクトではLLM CLIのインストールが必要です。Homebrewを使ってインストールできます。

brew install llm

インストール後、次のコマンドを実行して、PATH でllmコマンドが使用可能であることを確認します。

llm --version

はじめる

発達

  1. 依存関係をインストールします:
    npm install
  2. ホット リロードで開発サーバーを起動します。
    npm run dev
  3. プロジェクトをビルドします。
    npm run build
  4. テストを実行します:
    npm test
  5. 本番サーバーを起動します。
    npm start

アーキテクトツール

Architect ツール ( src/tools/architect.ts ) は、LLM CLI と対話してアーキテクチャ設計のフィードバックを得るためのインターフェースを提供します。会話コンテキストを維持し、アプリケーションと LLM CLI 間の通信を処理します。

特徴

  • 複数のやり取りにわたって会話のコンテキストを維持する
  • LLM CLI を通じてコマンド実行を処理します
  • エラー処理とログ記録を提供します
  • 新しい会話と継続的な議論の両方をサポートします

要件

  • LLM CLI がインストールされ、PATH で利用可能である必要があります (前提条件セクションを参照)
  • LLM CLIの環境変数は適切に設定されている必要があります

テスト

テンプレートには、ローカル テスト用の組み込み TestClient と視覚的なデバッグ用の MCP Inspector が含まれています。

TestClientの使用

TestClient はツールをテストする簡単な方法を提供します。

import { TestClient } from "./utils/TestClient"; describe("YourTool", () => { const client = new TestClient(); it("should process data correctly", async () => { await client.assertToolCall( "your-tool-name", { input: "test" }, (result) => { expect(result.toolResult.content).toBeDefined(); } ); }); });

MCPインスペクターの使用

テンプレートには、ツールを視覚的にデバッグするための MCP インスペクターが含まれています。

  1. インスペクターを起動します。
    npx @modelcontextprotocol/inspector node dist/index.js
  2. http://localhost:5173でインスペクターUIを開きます。

検査官は以下を提供します:

  • テストツールのビジュアルインターフェース
  • リアルタイムのリクエスト/レスポンス監視
  • ツールメタデータ検査
  • インタラクティブなテスト環境

カーソルを使ったローカルテスト

Cursor を使用して MCP サーバーをローカルでテストするには:

  1. パッケージをビルドしてリンクします。
    npm run build npm run link
  2. バイナリが動作することを確認します。
    npx architect-test-mcp-tool
  3. カーソルにサーバーを追加します。
    • カーソル設定を開く
    • 機能タブに移動します
    • MCPサーバーのセクションまでスクロールします
    • 「サーバーを追加」をクリックします
    • 「コマンド」タイプを選択
    • 名前を付けます(例:「ローカルサンプルツール」)
    • 次のコマンドを入力します: npx architect-test-mcp-tool
    • 確認をクリック
  4. MCP サーバー セクションでサーバーが実行中であることが表示されていることを確認し、カーソルでサーバーが正しく起動していることを確認します。

注意: コードを変更した場合は、必ず再構築して再リンクしてください。

npm run build npm run link

テストが完了したら、パッケージのリンクを解除できます。

npm run unlink

これにより、開発中に作成されたグローバル シンボリック リンクが削除されます。

トラブルシューティング

MCPインスペクターの使用

MCP Inspectorは、MCPサーバーのデバッグと検査に役立つツールです。使い方は以下のとおりです。

  1. まず、プロジェクトをビルドします。
    npm run build
  2. インスペクターを実行します:
    npx @modelcontextprotocol/inspector node dist/index.js

インスペクターは、次の操作を実行できる Web インターフェースを提供します。

  • 利用可能なすべてのツールとそのスキーマを表示する
  • テストツールは対話的に呼び出します
  • リクエスト/レスポンスペイロードを検査する
  • サーバーとクライアント間の通信の問題をデバッグする

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

TypeScript で Model Context Protocol (MCP) サーバーを作成するためのテンプレートです。コンテナベースの依存性注入、サービスベースのアーキテクチャ、自然言語によるアーキテクチャ設計フィードバックのための LLM CLI との統合などの機能を提供します。

  1. 前提条件
    1. LLM CLI インストール
  2. はじめる
    1. 発達
  3. アーキテクトツール
    1. 特徴
    2. 要件
  4. テスト
    1. TestClientの使用
    2. MCPインスペクターの使用
    3. カーソルを使ったローカルテスト
  5. トラブルシューティング
    1. MCPインスペクターの使用

Related MCP Servers

  • A
    security
    F
    license
    A
    quality
    A TypeScript-based template for developing Model Context Protocol servers with features like dependency injection and service-based architecture, facilitating the creation and integration of custom data processing tools.
    Last updated -
    1
    2
    TypeScript
  • A
    security
    A
    license
    A
    quality
    A TypeScript-based template for building Model Context Protocol servers, featuring fast testing, automated version management, and a clean structure for MCP tool implementations.
    Last updated -
    1
    1
    2
    TypeScript
    MIT License
  • -
    security
    -
    license
    -
    quality
    A specialized server that helps users create new Model Context Protocol (MCP) servers by providing tools and templates for scaffolding projects with various capabilities.
    Last updated -
    1
    TypeScript
  • -
    security
    F
    license
    -
    quality
    A TypeScript framework for building Model Context Protocol (MCP) servers with automatic discovery and loading of tools, resources, and prompts.
    Last updated -
    67
    TypeScript
    • 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/stevennevins/architect-mcp-server'

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