- Explore MCP Servers
- mcp_sse_sample
Mcp Sse Sample
What is Mcp Sse Sample
mcp_sse_sample is a sample implementation of the Server-Sent Events (SSE) feature for the MCP Server, demonstrating how to utilize the MCP protocol for real-time data streaming.
Use cases
Use cases include creating interactive web applications that respond to user input in real-time, implementing chat systems that provide immediate feedback, and developing tools that require ongoing status updates for long-running processes.
How to use
To use mcp_sse_sample, you can interact with its various components through defined inputs, such as sending messages to echo back, performing arithmetic operations, or initiating long-running tasks that provide progress notifications.
Key features
Key features include tools for echoing messages, adding numbers, demonstrating long-running operations with progress updates, sampling from a language model, returning images, printing environment variables, and providing annotated messages with metadata.
Where to use
mcp_sse_sample can be used in applications requiring real-time data updates, such as web applications, chatbots, or any system that benefits from live notifications and interactions.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Mcp Sse Sample
mcp_sse_sample is a sample implementation of the Server-Sent Events (SSE) feature for the MCP Server, demonstrating how to utilize the MCP protocol for real-time data streaming.
Use cases
Use cases include creating interactive web applications that respond to user input in real-time, implementing chat systems that provide immediate feedback, and developing tools that require ongoing status updates for long-running processes.
How to use
To use mcp_sse_sample, you can interact with its various components through defined inputs, such as sending messages to echo back, performing arithmetic operations, or initiating long-running tasks that provide progress notifications.
Key features
Key features include tools for echoing messages, adding numbers, demonstrating long-running operations with progress updates, sampling from a language model, returning images, printing environment variables, and providing annotated messages with metadata.
Where to use
mcp_sse_sample can be used in applications requiring real-time data updates, such as web applications, chatbots, or any system that benefits from live notifications and interactions.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
MCP SSE Sample
SSEを使用したMCPサーバーのサンプルです。
MCPプロトコルのSSE実装を示すサンプルプロジェクトです。
オリジナルは以下コードです。
Components
Tools
-
echo- Simple tool to echo back input messages
- Input:
message(string): Message to echo back
- Returns: Text content with echoed message
-
add- Adds two numbers together
- Inputs:
a(number): First numberb(number): Second number
- Returns: Text result of the addition
-
longRunningOperation- Demonstrates progress notifications for long operations
- Inputs:
duration(number, default: 10): Duration in secondssteps(number, default: 5): Number of progress steps
- Returns: Completion message with duration and steps
- Sends progress notifications during execution
-
sampleLLM- Demonstrates LLM sampling capability using MCP sampling feature
- Inputs:
prompt(string): The prompt to send to the LLMmaxTokens(number, default: 100): Maximum tokens to generate
- Returns: Generated LLM response
-
getTinyImage- Returns a small test image
- No inputs required
- Returns: Base64 encoded PNG image data
-
printEnv- Prints all environment variables
- Useful for debugging MCP server configuration
- No inputs required
- Returns: JSON string of all environment variables
-
annotatedMessage- Demonstrates how annotations can be used to provide metadata about content
- Inputs:
messageType(enum: “error” | “success” | “debug”): Type of message to demonstrate different annotation patternsincludeImage(boolean, default: false): Whether to include an example image
- Returns: Content with varying annotations:
- Error messages: High priority (1.0), visible to both user and assistant
- Success messages: Medium priority (0.7), user-focused
- Debug messages: Low priority (0.3), assistant-focused
- Optional image: Medium priority (0.5), user-focused
- Example annotations:
{ "priority": 1, "audience": [ "user", "assistant" ] }
Logging
The server sends random-leveled log messages every 15 seconds, e.g.:
{
"method": "notifications/message",
"params": {
"level": "info",
"data": "Info-level message"
}
}
使用方法
ローカルでの実行
# インストール
npm install
# ビルド
npm run build
# 実行(STDIOモード)
npm run start
# 実行(SSEモード)
npm run start:sse
Claude Desktopでの使用
claude_desktop_config.jsonに以下を追加してください:
{
"mcpServers": {
"sse-sample": {
"command": "npx",
"args": [
"-y",
"mcp_sse_sample"
]
}
}
}
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










