mcp_sse
mcp_sse is a simple library for implementing the Model Context Protocol (MCP) over Server-Sent Events (SSE). This library is based on the MCP specification and facilitates real-time data streaming. Developers can easily create MCP servers and streamline communication with clients.
GitHub Stars
64
User Rating
Not Rated
Favorites
0
Views
31
Forks
17
Issues
2
Installation
Difficulty
IntermediateEstimated Time
10-20 minutes
Requirements
Elixir: 1.12以上Phoenix Framework: 1.5以上(Phoenixアプリケーションの場合)Installation
Installation
Prerequisites
Elixir: 1.12 or higher
Phoenix Framework: 1.5 or higher (for Phoenix applications)
Installation Steps
1. Add Dependencies
Add the following to yourmix.exs:
elixir
def deps do
[
{:mcp_sse, "~> 0.1.0"}
]
end
2. Add Configuration
Add the following to yourconfig/config.exs:
elixir
Configure MIME types for SSE
config :mime, :types, %{
"text/event-stream" => ["sse"]
}
Configure the MCP Server
config :mcp_sse, :mcp_server, YourApp.YourMCPServer
3. Compile the Application
bash
mix deps.get
mix compile
Troubleshooting
Common Issues
Issue: Server won't start Solution: Check Elixir version and reinstall dependencies.Configuration
Configuration
Basic Configuration
Implementing MCP Server
You need to implement theMCPServer behavior. Implement the required callbacks (handle_ping/1 and handle_initialize/2) and any optional callbacks based on the features you want to support.
Example Configuration
elixir
defmodule YourApp.YourMCPServer do
use MCPServer
def handle_ping(state) do
{:ok, state}
end
def handle_initialize(params, state) do
{:ok, state}
end
end
Examples
Examples
Basic Usage of MCP Server
elixir
Start the server
YourApp.YourMCPServer.start_link()
Calling from Client
javascript
// JavaScript example (Node.js)
const { MCPClient } = require('@modelcontextprotocol/client');
const client = new MCPClient();
await client.connect();
// Execute tool
const result = await client.callTool('toolName', {
parameter1: 'value1',
parameter2: 'value2'
});
console.log(result);
Use Cases
Using in applications that require real-time data streaming
Serving as an interface to receive immediate results from AI tools
Building a server to manage requests from multiple clients
Creating a system that retains user-specific data through session management
Additional Resources
Related MCPs
LangBot
13398
🤩 Easy-to-use global IM bot platform designed for the LLM era / 简单易用的大模型即时通信机器人开发平台 ⚡️ Bots for QQ / QQ频道 / Discord / WeChat(微信)/ Telegram / 飞书 / 钉钉 / Slack 🧩 Integrated with ChatGPT(GPT)、DeepSeek、Dify、n8n、Claude、Google Gemini、xAI、PPIO、Ollama、阿里云百炼、SiliconFlow、Qwen、Moonshot(Kimi K2)、SillyTraven、MCP、WeClone etc. LLM & Agent & RAG