An experimental and educational Ping-Pong server demonstrating MCP (Model Context Protocol) calls via FastAPI. - ✅ FastAPI/FastMCP backend for remote MCP calls through API endpoints or SSE - 🔄 MCP integration for command handling - 🔐 Thread-safe session management To install the dependencies, run: Start the FastAPI server with: The server will start at http://localhost:8080. Open mcp-api-client.
Add this skill
npx mdskills install kimtth/mcp-remote-call-ping-pongEducational ping-pong demo with clear FastAPI and SSE examples but limited practical utility
1# 🏓 MCP Ping-Pong Server by Remote Call23An experimental and educational Ping-Pong server demonstrating MCP (Model Context Protocol) calls via FastAPI.45## Features67- ✅ FastAPI/FastMCP backend for remote MCP calls through API endpoints or SSE8- 🔄 MCP integration for command handling9- 🔐 Thread-safe session management1011## Quick Start1213### Installation1415To install the dependencies, run:1617```bash18poetry install19```2021### 1. Call MCP Tool through API2223#### Run the Server2425Start the FastAPI server with:2627```bash28python mcp-api-server.py29```3031The server will start at `http://localhost:8080`.3233#### UI3435Open `mcp-api-client.html` in a browser to interact with the UI.3637<img alt="ui" src="doc/pingpong-ui.png" width="400"/>3839#### API Endpoints4041- `GET /ping-pong?prompt_name=<prompt_name>`: Retrieves the specified prompt.42- `POST /ping-pong`: Invokes MCP tool commands (`ping`, `pong`, `count`).4344### 2. Call MCP Tool through SSE transport4546The following example demonstrates using Server-Sent Events (SSE) for communication with the MCP server.4748#### Run the SSE Server4950```bash51python mcp-sse-server.py52```5354#### Run the SSE Client5556```bash57python mcp-sse-client.py58```5960#### Sample Output6162```bash63Type a command (e.g., 'ping', 'pong', 'count') or 'exit' to quit:64>>> ping65Sending command: ping66Result: pong67>>> pong68Sending command: pong69Result: ping70>>> count71Sending command: count72Result: 273```7475## References7677- [FastAPI SSE MCP](https://github.com/ragieai/fastapi-sse-mcp)78- [MCP Weather SSE](https://github.com/justjoehere/mcp-weather-sse)79- [MCP Chinese Getting Started Guide](https://github.com/liaokongVFX/MCP-Chinese-Getting-Started-Guide)8081## 📄 License8283MIT8485
Full transparency — inspect the skill content before installing.