Cover image
Try Now
2025-03-16

3 years

Works with Finder

1

Github Watches

1

Github Forks

1

Github Stars

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.

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

Model Context Protocol (MCP) の Server Sent Event (SSE) を利用したサンプルコード

MCP の SSE での動作サンプルを実装したリポジトリです。実装自体はテキストを逆順にしたり upper case にしたりと実用的な動作はしませんが、大まかな動作の理解に役立つように実装したサンプルコードです。

サーバ側の実装は公式のサンプルを元にしています。

使い方

まずサーバサイドを起動します。サンプルでは SSE と標準入出力バージョンがありますが、このサンプルは SSE 向けなので SSE のみを紹介します。それ以外は公式サンプルをご覧ください。

uv コマンドを利用して以下のようにサーバを起動します。

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

続いて、クライアント側を普通に実行します。

$ python client.py

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

    Reviews

    2 (1)
    Avatar
    user_BDxwhhRt
    2025-04-17

    As a loyal user of MCP applications, I found MCP-SSE-Server-Sample to be incredibly useful and well-structured. Developed by edom18, this server sample showcases excellent implementation practices and seamless integration capabilities. It is straightforward to navigate and offers comprehensive welcome information along with a clear starting URL, making the setup process a breeze. Highly recommended for anyone looking to streamline their server solutions! You can explore it further at https://github.com/edom18/MCP-SSE-Server-Sample.