๐ MCP Ping-Pong Server by Remote Call
LocalAbout ๐ MCP Ping-Pong Server by Remote Call
An experimental educational project that demonstrates remote MCP calls through a Ping-Pong example. It is intended for developers exploring FastAPI, FastMCP, API endpoints, and SSE communication.
Key features
- 01FastAPI and FastMCP backend
- 02Remote calls through API endpoints
- 03SSE transport example
- 04Thread-safe session management
Use cases
- 01Learn remote MCP call patterns
- 02Try MCP tools through HTTP endpoints
- 03Explore MCP communication over SSE
MCP support
Demonstrates remote MCP calls through API endpoints and SSE, with ping, pong, and count commands.
Configuration
Local server config is the same for every client. Copy it into your clientโs MCP config file.
We havenโt collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project README๐ MCP Ping-Pong Server by Remote Call
An experimental and educational Ping-Pong server demonstrating MCP (Model Context Protocol) calls via FastAPI.
Features
- โ FastAPI/FastMCP backend for remote MCP calls through API endpoints or SSE
- ๐ MCP integration for command handling
- ๐ Thread-safe session management
Quick Start
Installation
To install the dependencies, run:
poetry install
1. Call MCP Tool through API
Run the Server
Start the FastAPI server with:
python mcp-api-server.py
The server will start at http://localhost:8080.
UI
Open mcp-api-client.html in a browser to interact with the UI.
API Endpoints
GET /ping-pong?prompt_name=<prompt_name>: Retrieves the specified prompt.POST /ping-pong: Invokes MCP tool commands (ping,pong,count).
2. Call MCP Tool through SSE transport
The following example demonstrates using Server-Sent Events (SSE) for communication with the MCP server.
Run the SSE Server
python mcp-sse-server.py
Run the SSE Client
python mcp-sse-client.py
Sample Output
Type a command (e.g., 'ping', 'pong', 'count') or 'exit' to quit:
>>> ping
Sending command: ping
Result: pong
>>> pong
Sending command: pong
Result: ping
>>> count
Sending command: count
Result: 2
References
๐ License
MIT
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.