Skip to main content
Glama

MCP SSE Server

by aihes

MCP SSE サーバーとクライアントの例

このリポジトリには、SSE (Server-Sent Events) ベースの MCP (Model Context Protocol) サーバーおよびクライアントの完全なサンプル実装が含まれています。

概要

モデルコンテキストプロトコル(MCP)は、AIシステム向けに設計された通信プロトコルです。この実装では、サーバー送信イベント(SSE)を使用してクライアントとのリアルタイム通信を行うMCPサーバーの作成方法を示します。

特徴

  • SSEベースのMCPサーバー:Express.jsとMCP SDKのSSEServerTransportを使用してサーバーを実装します。
  • インタラクティブMCPクライアント:SSEサーバーに接続するクライアント実装を提供します
  • ツールの実装: 適切な説明が付いたサンプルツール(加算、乗算)が含まれています
  • 動的リソース: URIパターンを使用した動的リソーステンプレートのデモンストレーション
  • デバッグサポート: 詳細なログ記録とデバッグ構成が含まれています

コンポーネント

  • server.js - StdioServerTransport を使用した基本的な MCP サーバー
  • sse-server.js - Express.js で SSEServerTransport を使用する MCP サーバー
  • client.js - 基本サーバーのクライアント
  • sse-client.js - SSEサーバーのクライアント

はじめる

  1. 依存関係をインストールします:
    npm install
  2. SSE サーバーを起動します。
    npm run sse-server
  3. 別のターミナルで、SSE クライアントを実行します。
    npm run sse-client

サーバー機能

SSE サーバーは以下を提供します。

  • 加算と乗算のツールエンドポイント
  • テンプレートをサポートする動的な挨拶リソース
  • 複数のクライアントに対する適切なセッション管理
  • デバッグのための詳細なログ

クライアントの機能

SSE クライアントは次のことを実証します。

  • SSEサーバーへの接続
  • 利用可能なツールとリソースの一覧
  • パラメータを使用してツールを呼び出す
  • 動的パラメータを使用したリソースの読み取り

URI テンプレート

サーバーは、URI テンプレートをクライアントに公開して、リソース URI を動的に構築する方法をクライアントが理解できるようにする方法を示します。

greeting://{name} - Replace {name} with any name to get a personalized greeting

ライセンス

マサチューセッツ工科大学

You must be authenticated.

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

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Tools

リアルタイム通信用の Server-Sent Events (SSE) を使用した Model Context Protocol (MCP) サーバーの実装。計算および動的リソース テンプレート用のツールを提供します。

  1. 概要
    1. 特徴
      1. コンポーネント
        1. はじめる
          1. サーバー機能
            1. クライアントの機能
              1. URI テンプレート
                1. ライセンス

                  Related MCP Servers

                  • -
                    security
                    A
                    license
                    -
                    quality
                    MCP Server simplifies the implementation of the Model Context Protocol by providing a user-friendly API to create custom tools and manage server workflows efficiently.
                    Last updated -
                    4
                    3
                    TypeScript
                    MIT License
                  • -
                    security
                    A
                    license
                    -
                    quality
                    This server implements the Model Context Protocol (MCP) to handle asynchronous tasks with real-time status tracking, robust error handling, and automatic resource management.
                    Last updated -
                    2
                    1
                    JavaScript
                    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
                  • A
                    security
                    F
                    license
                    A
                    quality
                    A Model Context Protocol (MCP) server that interacts with system APIs, allowing users to check connections, search employees, register breakfast, and update chemical information by shifts.
                    Last updated -
                    21
                    42
                    JavaScript

                  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/aihes/mcp-sse-server'

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