This repository provides a simple example client for connecting to Model Context Protocol (MCP) servers over HTTP using Server-Sent Events, leveraging the official MCP Python SDK for protocol handling and server interaction.
This is a basic example client demonstrating how to connect to Model Context Protocol (MCP) servers over HTTP, utilizing Server-Sent Events (SSE) for transport. It leverages the official MCP Python SDK to manage protocol communication and interactions with the server.
To use the client, clone the repository and execute the main.py
script, providing the server URL as an argument:
uv run -- main.py <server_url>
For instance:
uv run -- main.py http://localhost:8000/sse
The client will then connect to the specified MCP server, retrieve its capabilities, and display them in JSON format.
slavashvets/mcp-http-client-example
January 7, 2025
March 28, 2025
Python