mcp-sse-client-server
using sse in client and server
Documentation
MCP SSE Client-Server
A Simple Python implementation of a MCP client and Server with Server-Sent Events (SSE).
Features
- SSE-based communication between client and server
- Integration with MCP platform tools (google_search, get_web_content)
- Asynchronous processing of queries using Python's asyncio
- Comprehensive logging and error handling
- OpenAI API integration with fallback to OpenRouter
- Environment variable configuration support
Requirements
- Python 3.10+
- Dependencies listed in pyproject.toml:
- httpx for HTTP requests
- python-dotenv for environment variables
- openai for LLM integration
- mcp[cli] for MCP platform integration
Installation
1. Clone this repository
2. Create and activate a virtual environment:
uv venv
# On Windows
.venv\Scripts\activate
# On Unix/macOS
source .venv/bin/activate3. Install dependencies:
uv sync .Configuration
Create a `.env` file in the project root with your API keys:
# Required - use either OPENAI_API_KEY or OPENROUTER_API_KEY
OPENAI_API_KEY=your_api_key
OPENROUTER_API_KEY=your_api_key
# Optional - specify custom base URL
OPENAI_BASE_URL=https://your-custom-url
OPENROUTER_BASE_URL=https://your-custom-urlUsage
start mcp server firstly, which run on 8081 port.
then start mcp client.
MCP Server Setup
uv run mcp-server-search.pyMCP Client Usage
uv run mcp-client-sse.py --help
usage: mcp-client-sse.py [-h] [--server SERVER] [--verbose] [--quiet]
Run MCP SSE-based client
options:
-h, --help show this help message and exit
--server SERVER MCP SSE server URL (default: http://localhost:8081/sse)
--verbose Enable verbose logging mode (DEBUG level)
--quiet Set logging to WARNING level (overrides --verbose)
uv run mcp-client-sse.py --server URL_ADDRESS-server-url:8081/sse --verboseAvailable MCP Tools
The client supports these MCP tools:
- google_search: Perform web searches
- get_web_content: Fetch full web page content
- get_weekday_from_date: Date utilities
- get_weather_for_date: Weather information
Development
Logging
The client generates logs in `mcp-client.log` with timestamps and detailed information.
Testing
To be implemented...
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss proposed changes.
License
Frequently asked questions
What is mcp-sse-client-server?
mcp-sse-client-server is using sse in client and server
How do I install mcp-sse-client-server?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is mcp-sse-client-server open source?
Yes — it is hosted on GitHub at https://github.com/flyingcloud-code/mcp-sse-client-server.
Related MCP tools
AWS MCP Servers — helping you get the most out of AWS, wherever you use MCP. Python-based implementation. Trusted by 6900+ developers.
A simple, secure MCP-to-OpenAPI proxy server Python-based implementation. Trusted by 3500+ developers. Trusted by 3500+ developers.
MCP server that interacts with Obsidian via the Obsidian rest API community plugin Python-based implementation. Trusted by 2300+ developers.
Default Configuration: MCP CLI defaults to using Ollama with the gpt-oss reasoning model for local, privacy-focused operation without requiring API keys.
Official MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
MCP server for long term agent memory with Mem0. Also useful as a template to get you started building your own MCP server with Python!
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP