MCP.so
ログイン

MCP SSE Client-Server

@flyingcloud-code

MCP SSE Client-Server について

using sse in client and server

基本情報

カテゴリ

その他

ライセンス

MIT

ランタイム

python

トランスポート

stdio

公開者

flyingcloud-code

設定

以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。

{
  "mcpServers": {
    "mcp-sse-client-server": {
      "command": "uv",
      "args": [
        "venv"
      ]
    }
  }
}

ツール

ツールは検出されませんでした

ツールは README から自動的に抽出されます。メンテナーは ## Tools という見出しの下に記載することで、このタブに反映できます。

概要

What is MCP SSE Client-Server?

A Python implementation of an MCP client and server that communicates using Server-Sent Events (SSE). It integrates with MCP platform tools for web search, content retrieval, and date/weather utilities, and is intended for developers building asynchronous AI assistants.

How to use MCP SSE Client-Server?

Clone the repository, create a virtual environment, and install dependencies with uv sync .. Configure API keys in a .env file (OpenAI or OpenRouter). Start the server first with uv run mcp-server-search.py, then run the client with uv run mcp-client-sse.py --server http://localhost:8081/sse --verbose. Use --help for full options.

Key features of MCP SSE Client-Server

  • SSE-based communication between client and server
  • Integration with MCP platform tools (google_search, get_web_content)
  • Asynchronous processing using Python's asyncio
  • Comprehensive logging and error handling
  • OpenAI API integration with fallback to OpenRouter
  • Environment variable configuration support

Use cases of MCP SSE Client-Server

  • Perform web searches via the google_search MCP tool
  • Fetch full content of web pages with get_web_content
  • Retrieve the weekday for a given date
  • Get weather information for a specific date
  • Build real-time streaming AI assistants with MCP

FAQ from MCP SSE Client-Server

What runtime is required?

Python 3.10 or higher. Dependencies include httpx, python-dotenv, openai, and mcp[cli].

How do I configure API keys?

Create a .env file in the project root with either OPENAI_API_KEY or OPENROUTER_API_KEY. Optionally set custom base URLs.

What transport does the server use?

The server uses Server-Sent Events (SSE) over HTTP. The default server URL is http://localhost:8081/sse.

Where are logs stored?

The client writes logs to mcp-client.log with timestamps and detailed information.

Can I use OpenRouter instead of OpenAI?

Yes. If you set OPENROUTER_API_KEY in your .env file, the client will fall back to OpenRouter. You can also specify a custom base URL.

コメント

「その他」の他のコンテンツ