MCP.so
ログイン

MCP over SSE

@kEND

MCP over SSE について

An elixir Model Context Protocal (MCP) server library which uses the Server-Sent Events (SSE) transport type

基本情報

カテゴリ

その他

ライセンス

MIT

ランタイム

elixir

トランスポート

stdio

公開者

kEND

設定

以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。

{
  "mcpServers": {
    "mcp_sse": {
      "command": "npx",
      "args": [
        "@modelcontextprotocol/inspector@latest"
      ],
      "env": {
        "MCP_SERVER_URL": "localhost:4000"
      }
    }
  }
}

ツール

ツールは検出されませんでした

ツールは README から自動的に抽出されます。メンテナーは ## Tools という見出しの下に記載することで、このタブに反映できます。

概要

What is MCP over SSE?

MCP over SSE is an Elixir library that provides a simple implementation of the Model Context Protocol (MCP) using Server-Sent Events. It is intended for developers building MCP servers with Phoenix or Plug/Bandit applications.

How to use MCP over SSE?

Add the library as a dependency, configure MIME types and the MCP server module, implement the MCPServer behaviour, and set up routing for the /sse and /message endpoints. Run your application with mix phx.server or mix run --no-halt. Connect clients such as MCP Inspector or Cursor to the SSE endpoint.

Key features of MCP over SSE

  • Full MCP server implementation over SSE
  • JSON-RPC message handling
  • Tool registration and execution
  • Automatic ping/keepalive
  • Session management with auto-generated IDs
  • Error handling and validation

Use cases of MCP over SSE

  • Build custom MCP servers in Elixir for AI tool integration
  • Connect AI assistants like Cursor using SSE
  • Test MCP tools interactively with MCP Inspector
  • Handle multiple client sessions with automatic session ID generation

FAQ from MCP over SSE

What are the dependencies and runtime requirements?

Requires Elixir and either a Phoenix application or a Plug application with Bandit. The library depends on :mime, :mcp_sse, and optionally :plug and :bandit.

How does session management work?

Each connection must have a session ID. If the client does not provide one, the server automatically generates a new session ID and attaches it to query parameters for both the SSE and message endpoints.

What transport does MCP over SSE use?

It uses Server-Sent Events (SSE) for server-to-client messages and HTTP POST for client-to-server JSON-RPC requests, both over configurable paths.

Can I customize the endpoints and keepalive interval?

Yes. You can configure sse_path, message_path, and sse_keepalive_timeout (in milliseconds) in your application config. Setting the timeout to :infinity disables keepalive pings.

How should MCP tool responses be formatted?

Responses must follow the MCP specification. Supported content types are text, image, and resource. For structured data, convert it to a formatted JSON string using a JSON encoder.

コメント

「その他」の他のコンテンツ