MCP over SSE

by kEND

64 stars
240 downloads
Not rated
GitHub

About

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

Details

Author
kEND
GitHub stars
64
Downloads
240
Categories
Other

- 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

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MCP over SSE
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

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.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

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

McpServers

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

MCP over SSE

Releases
Documentation
MCP Specification Version
Downloads
License
CI
Last Commit

This library provides a simple implementation of the Model Context Protocol (MCP) over Server-Sent Events (SSE).

For more information about the Model Context Protocol, visit:
Model Context Protocol Documentation.

Table of Contents

- Features
- Create your own MCP server
- Installation
- For Phoenix Applications
- For Plug Applications with Bandit
- Usage
- With MCP Inspector
- With Cursor
- Configuration
- Port and HTTPS
- Paths
- Keepalive
- Quick Demo
- Other Notes
- Example Client Usage
- Session Management
- MCP Response Formatting
- Contributing

Features

- Full MCP server implementation
- SSE connection management
- JSON-RPC message handling
- Tool registration and execution
- Session management
- Automatic ping/keepalive
- Error handling and validation

Create your own MCP server

You must implement the MCPServer behaviour.

You only need to implement the required callbacks (handle_ping/1 and handle_initialize/2) and any optional callbacks for features you want to support.

The use MCPServer macro provides:
- Built-in message routing
- Protocol version validation
- Default implementations for optional callbacks
- JSON-RPC error handling
- Logging

See DefaultServer for a default implementation of the MCPServer behaviour.

Installation

For Phoenix Applications:

1. Add the required configuration to config/config.exs:

```elixir

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.