Cover image
Try Now
2025-03-11

3 years

Works with Finder

1

Github Watches

1

Github Forks

0

Github Stars

SSE MCP Server

このリポジトリは、Server-Sent Events (SSE) を使用したModel Context Protocol (MCP) サーバーのサンプル実装です。Netlify Edge Functionsを使用してデプロイできるように設計されています。

最新の更新

  • 2025/3/11: Netlify Edge Functionsでの502エラーを修正しました。SSE接続を維持するために定期的なpingメッセージを送信する機能を追加しました。

機能

  • SSEを使用したリアルタイム通信
  • Netlify Edge Functionsでのサーバーサイド実装
  • シンプルなクライアントインターフェース

開発環境のセットアップ

  1. リポジトリをクローン

    git clone https://github.com/yourusername/sse-mcp-server.git
    cd sse-mcp-server
    
  2. 依存関係をインストール

    npm install
    
  3. 開発サーバーを起動

    npm run dev
    

Netlifyへのデプロイ

  1. Netlify CLIをインストール(既にインストール済みの場合はスキップ)

    npm install -g netlify-cli
    
  2. Netlifyにログイン

    netlify login
    
  3. サイトを初期化(初回のみ)

    netlify init
    
  4. デプロイ

    npm run deploy
    

Netlifyデプロイ後の動作確認方法

デプロイが完了したら、以下の手順で動作確認を行うことができます:

  1. デプロイされたサイトのURLにアクセスする

    • デプロイ完了時にコンソールに表示されるURLか、Netlifyダッシュボードから確認できます
    • 例: https://your-site-name.netlify.app
  2. トップページにアクセスすると、「SSE MCP Server is running. Access /sse to connect.」というメッセージが表示されます

    • これはサーバーが正常に動作していることを示しています
  3. デモページを使用してSSE接続をテストする

    • トップページ(index.html)にはSSE接続をテストするためのUIが用意されています
    • 「接続」ボタンをクリックしてSSEサーバーに接続します
    • 接続が成功すると、ステータスが「接続中」に変わり、接続IDが表示されます
  4. メッセージの送受信をテストする

    • テキスト入力欄にメッセージを入力し、「送信」ボタンをクリックします
    • 送信したメッセージがサーバーから返信され、画面に表示されます
  5. 以下の点を確認する

    • 接続状態が正しく表示されるか
    • 定期的なpingメッセージが受信されるか
    • メッセージの送受信が正常に行われるか
    • エラー発生時の処理が適切に行われるか
  6. 必要に応じて、開発者ツール(F12)のネットワークタブでSSE接続の詳細を確認する

    • /sse エンドポイントへのリクエストと、イベントストリームの状態を確認できます
    • /message エンドポイントへのPOSTリクエストが正常に処理されているか確認できます

これらの確認が成功すれば、SSE MCP Serverが正常にNetlifyにデプロイされ、動作していることが確認できます。

ファイル構成

  • everything.ts - MCPサーバーの実装
  • sse.ts - Express.jsを使用したSSEサーバー
  • netlify/edge-functions/sse.ts - Netlify Edge Functionsを使用したSSEサーバー
  • index.html - クライアント側のデモページ

ライセンス

MITライセンス

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Lists Tailwind CSS classes in monospaced font

  • apappascs
  • Discover the most comprehensive and up-to-date collection of MCP servers in the market. This repository serves as a centralized hub, offering an extensive catalog of open-source and proprietary MCP servers, complete with features, documentation links, and contributors.

  • ShrimpingIt
  • Micropython I2C-based manipulation of the MCP series GPIO expander, derived from Adafruit_MCP230xx

  • OffchainLabs
  • Go implementation of Ethereum proof of stake

  • huahuayu
  • A unified API gateway for integrating multiple etherscan-like blockchain explorer APIs with Model Context Protocol (MCP) support for AI assistants.

  • deemkeen
  • control your mbot2 with a power combo: mqtt+mcp+llm

    Reviews

    3 (1)
    Avatar
    user_wBwXCbgd
    2025-04-15

    Webflow MCP is an outstanding tool for web development enthusiasts. Its user-friendly interface, combined with powerful customization options, makes building and managing websites a breeze. The responsive design and seamless integration with various platforms is a game-changer. I highly recommend Webflow MCP for anyone looking to elevate their web development skills and create stunning websites effortlessly.