MCP Remote Call Ping Pong

Visit Repo
1
An experimental and educational app for Ping-pong server demonstrating remote MCP (Model Context Protocol) calls
Author:@kimtth
Updated at:

Other Tools and Integrations

πŸ“ 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.

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:
&gt;&gt;&gt; ping
Sending command: ping
Result: pong
&gt;&gt;&gt; pong
Sending command: pong
Result: ping
&gt;&gt;&gt; count
Sending command: count
Result: 2

References

πŸ“„ License

MIT

</prompt_name>

MCP Index is your go-to directory for Model Context Protocol servers. Discover and integrate powerful MCP solutions to enhance AI applications like Claude, Cursor, and Cline. Find official and community servers with integration guides and compatibility details.
Copyright Β© 2025