mcp-http-client-example
This MCP HTTP client example demonstrates how to connect to MCP servers over HTTP using Server-Sent Events (SSE). It properly manages the connection lifecycle with async context managers and utilizes the MCP Python SDK to list server capabilities and print them in JSON format.
GitHub Stars
17
User Rating
Not Rated
Favorites
0
Views
17
Forks
1
Issues
0
MCP HTTP Client Example
Simple example client demonstrating how to connect to Model Context Protocol (MCP) servers over HTTP using Server-Sent Events (SSE) transport.
Uses the official MCP Python SDK to handle protocol communication and server interactions.
Features
- Connects to MCP servers over SSE transport
- Lists available tools, resources and prompts
- Properly handles connection lifecycle with async context managers
Requirements
Usage
Clone this repository, then run the example client:
uv run -- main.py <server_url>
For example:
uv run -- main.py http://localhost:8000/sse
The client will:
- Connect to the specified MCP server
- List its available capabilities
- Print them as JSON
Documentation
5
Followers
12
Repositories
2
Gists
0
Total Contributions
🤩 Easy-to-use global IM bot platform designed for the LLM era / 简单易用的大模型即时通信机器人开发平台 ⚡️ Bots for QQ / QQ频道 / Discord / WeChat(微信)/ Telegram / 飞书 / 钉钉 / Slack 🧩 Integrated with ChatGPT(GPT)、DeepSeek、Dify、n8n、Claude、Google Gemini、xAI、PPIO、Ollama、阿里云百炼、SiliconFlow、Qwen、Moonshot(Kimi K2)、SillyTraven、MCP、WeClone etc. LLM & Agent & RAG