mcp_server_client_impl

parasjain2426/mcp_server_client_impl

3.1

If you are the rightful owner of mcp_server_client_impl and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

This project is a simple Model Context Protocol (MCP) system that includes an MCP Server and an MCP Client, communicating via Server-Sent Events (SSE) using FastAPI.

The Model Context Protocol (MCP) Server-Client Implementation is a lightweight system designed to demonstrate tool invocation using Server-Sent Events (SSE) over HTTP. The architecture consists of an MCP Server and an MCP Client, both built using FastAPI. The server listens on port 8000 and provides tools such as 'upload_claim' and 'get_claim_details'. The client, running on port 5000, communicates with the server through defined endpoints to invoke these tools. The project is structured with separate directories for the client and server, each containing a main.py file to run the respective FastAPI applications. The communication flow involves the client sending SSE HTTP requests to the server, which processes the requests and streams responses back to the client. This setup is ideal for development or educational purposes, with data stored in-memory and reset upon server restart.

Features

  • Lightweight tool invocation using SSE over HTTP
  • Built with FastAPI for both server and client
  • In-memory data storage for simplicity
  • Defined tools: upload_claim and get_claim_details
  • Separate client and server architecture

Usages

usage with local development

python
mcp.run(transport='stdio')  # Tools defined via @mcp.tool() decorator

usage with remote deployment

python
mcp.run(transport='sse', host="0.0.0.0", port=8000)  # Specify SSE endpoint

usage with fastapi client

bash
cd client
pip install -r requirements.txt
python main.py

usage with fastapi server

bash
cd server
pip install -r requirements.txt
python main.py