MCP SSE Sample

by iuill

1 stars
218 downloads
Not rated
GitHub

About

A sample MCP server that uses SSE (Server-Sent Events) transport to demonstrate an MCP protocol SSE implementation. It is based on the official “everything” server and provides a set of tools for testing and demonstration purposes.

Details

Author
iuill
GitHub stars
1
Downloads
218
Categories
Other

- Echo tool returns the input message unchanged
- Add tool adds two numbers together
- LongRunningOperation with progress notifications
- SampleLLM demonstrates MCP LLM sampling capability
- GetTinyImage returns a base64‑encoded PNG test image
- PrintEnv prints all environment variables for debugging
- AnnotatedMessage shows priority and audience annotations
- Random‑leveled log messages sent every 15 seconds

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 SSE Sample
    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

Install dependencies with npm install, build with npm run build, then run in STDIO mode (npm run start) or SSE mode (npm run start:sse). For Claude Desktop, add the server configuration to claude_desktop_config.json as shown in the README.

Claude Desktop / Cursor

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

{
    "mcpServers": {
        "mcp sse sample": {
            "sse-sample": {
                "command": "npx",
                "args": [
                    "-y",
                    "mcp_sse_sample"
                ]
            }
        }
    }
}

McpServers

{
    "sse-sample": {
        "command": "npx",
        "args": [
            "-y",
            "mcp_sse_sample"
        ]
    }
}

MCP SSE Sample

SSEを使用したMCPサーバーのサンプルです。
MCPプロトコルのSSE実装を示すサンプルプロジェクトです。

オリジナルは以下コードです。
- https://github.com/modelcontextprotocol/servers/tree/main/src/everything

Components

Tools

1. echo
- Simple tool to echo back input messages
- Input:
- message (string): Message to echo back
- Returns: Text content with echoed message

2. add
- Adds two numbers together
- Inputs:
- a (number): First number
- b (number): Second number
- Returns: Text result of the addition

3. longRunningOperation
- Demonstrates progress notifications for long operations
- Inputs:
- duration (number, default: 10): Duration in seconds
- steps (number, default: 5): Number of progress steps
- Returns: Completion message with duration and steps
- Sends progress notifications during execution

4. sampleLLM
- Demonstrates LLM sampling capability using MCP sampling feature
- Inputs:
- prompt (string): The prompt to send to the LLM
- maxTokens (number, default: 100): Maximum tokens to generate
- Returns: Generated LLM response

5. getTinyImage
- Returns a small test image
- No inputs required
- Returns: Base64 encoded PNG image data

6. printEnv
- Prints all environment variables
- Useful for debugging MCP server configuration
- No inputs required
- Returns: JSON string of all environment variables

7. 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 patterns
- includeImage (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.0,
"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"
  }
}

使用方法

ローカルでの実行

```bash

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.