mcp-server-sample

errolseo/mcp-server-sample

3.1

If you are the rightful owner of mcp-server-sample and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Model Context Protocol (MCP) server is designed to facilitate seamless communication and data exchange between clients and servers using the MCP framework.

MCP Server Example (sse-server)

This project is a simple, stateless HTTP streaming server example for the Model-Context Protocol (MCP). The server uses Server-Sent Events (SSE) to communicate with clients.


How to Run

You'll need uv installed to run this server.

Default

Run the server with default settings (port: 8080, log-level: INFO).

uv run sse-server

Custom Port

Use the --port option to specify a custom port.

uv run sse-server --port 8000

Custom Log Level

Set a different logging level, such as DEBUG, using the --log-level option.

uv run sse-server --log-level DEBUG

Claude Desktop Setup

To connect this server to an MCP client like Claude Desktop, you can configure it as follows.

Remember to replace [YOUR_ADDRESS] and [YOUR_PORT] with your server's actual IP address and port number (e.g., http://127.0.0.1:8000/sse).

{
  "mcpServers": {
    "weather": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "http://[YOUR_ADDRESS]:[YOUR_PORT]/sse",
        "--allow-http"
      ]
    }
  }
}

Reference