Sponsored by Deepsite.site

SSE MCP Server

Created By
champierrea year ago
Content

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ライセンス

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
WindsurfThe new purpose-built IDE to harness magic
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
CursorThe AI Code Editor
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Serper MCP ServerA Serper MCP Server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Amap Maps高德地图官方 MCP Server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
DeepChatYour AI Partner on Desktop
Tavily Mcp
ChatWiseThe second fastest AI chatbot™
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Playwright McpPlaywright MCP server
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.