MCP cover image
See in Github
2025-03-11

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.

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

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

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

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

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

  • Contraband Interactive
  • Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.

  • rustassistant.com
  • Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.

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

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

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • Mintplex-Labs
  • La aplicación AI de escritorio todo en uno y Docker con trapo incorporado, agentes de IA, creador de agentes sin código, compatibilidad de MCP y más.

  • modelcontextprotocol
  • Servidores de protocolo de contexto modelo

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • OffchainLabs
  • Implementación de la prueba de estaca Ethereum

  • n8n-io
  • Plataforma de automatización de flujo de trabajo de código justo con capacidades de IA nativas. Combine el edificio visual con código personalizado, auto-anfitrión o nube, más de 400 integraciones.

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 llM 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Resumen de los mejores recursos del mundo.

    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.