MCP.so
Sign In

MCP over SSE

@kEND

Basic information

Category

Other

License

MIT

Transports

stdio

Author

kEND

About MCP over SSE

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

MCP over SSE config

Add this server to your MCP-compatible client using the configuration below.

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

MCP over SSE tools

Tool list not available yet

This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.

Fetch the live tool list by running this server in a temporary sandbox using the button above.

Overview

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

Frequently asked questions

1

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`.

2

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.

3

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.

4

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.

5

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.

Comments

More Other MCP servers