Sample code for Model Context Protocl (MCP) with Server Sent Event (SSE)

by edom18

1 stars
412 downloads
Not rated
GitHub

Description

# Sample code for Model Context Protocl (MCP) with Server Sent Event (SSE) This repository is a sample for using SSE server. This server provides two unhelpful methods but this implementation is very simple and useful for understanding how work the SSE server. This serer…

About

# Sample code for Model Context Protocl (MCP) with Server Sent Event (SSE) This repository is a sample for using SSE server. This server provides two unhelpful methods but this implementation is very simple and useful for understanding how work the SSE server. This serer implementation is based on official sample…

Details

Author
edom18
GitHub stars
1
Downloads
412
Categories
Developer Tools

- Demonstrates SSE transport for MCP servers
- Based on official simple-tool example from the Python SDK
- Provides two simple utility methods (reverse text, uppercase)
- Includes a working client script (client.py)
- Minimal and easy to understand implementation

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 Sample code for Model Context Protocl (MCP) with Server Sent Event (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

Launch the server with the uv command: uv run mcp_server_sample --port 8080 --transport sse. Then run the provided client script: python client.py.

Claude Desktop / Cursor

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

{
    "mcpServers": {
        "sample code for model context protocl (mcp) with server sent event (sse)": {
            "MCP-SSE-Server-Sample": {
                "command": "uv",
                "args": [
                    "run",
                    "mcp_server_sample",
                    "--port",
                    "8080",
                    "--transport",
                    "sse"
                ]
            }
        }
    }
}

McpServers

{
    "MCP-SSE-Server-Sample": {
        "command": "uv",
        "args": [
            "run",
            "mcp_server_sample",
            "--port",
            "8080",
            "--transport",
            "sse"
        ]
    }
}

Sample code for Model Context Protocl (MCP) with Server Sent Event (SSE)

This repository is a sample for using SSE server. This server provides two unhelpful methods but this implementation is very simple and useful for understanding how work the SSE server.

This serer implementation is based on official sample code.

- simple-tool | modelcontextprotocol/python-sdk

How to use

First, you must launch the server with uv command like below. This sample code has standard I/O version but this repository is just showing how to use SSE server then I don't explain the normal version. If you want to know about that please refer to the official code.

$ uv run mcp_server_sample --port 8080 --transport sse

Next, just execute client.py.

$ python client.py

--------------------------------

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.