MCP Directory
ServersClientsBlog

xASO - App Store Optimization

AI-powered App Store Optimization platform for mobile apps

Go to xASO
MCP Directory

Model Context Protocol Directory

MKSF LTD
Suite 8805 5 Brayford Square
London, E1 0SG

MCP Directory

  • About
  • Blog
  • Documentation
  • Contact

Menu

  • Servers
  • Clients

© 2025 model-context-protocol.com

The Model Context Protocol (MCP) is an open standard for AI model communication.
Powered by Mert KoseogluSoftware Forge
  1. Home
  2. Servers
  3. mcp-http-client-example

mcp-http-client-example

GitHub

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.

17
0

MCP HTTP Client Example

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.

Features

  • Establishes connections to MCP servers using SSE transport.
  • Retrieves and lists available tools, resources, and prompts offered by the server.
  • Implements proper connection lifecycle management using asynchronous context managers for efficient resource handling.

Requirements

  • uv

Usage

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.

Documentation

  • MCP Specification
  • MCP Python SDK

Repository

SL
slavashvets

slavashvets/mcp-http-client-example

Created

January 7, 2025

Updated

March 28, 2025

Language

Python

Category

AI