kimtth

๐Ÿ“ MCP Ping-Pong Server by Remote Call

Community kimtth
Updated

๐Ÿ“ An experimental and educational script for Ping-pong server demonstrating remote MCP (Model Context Protocol) calls

๐Ÿ“ 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

MCP Server ยท Populars

MCP Server ยท New

    scumble-app

    Scumble

    Free, open-source desktop editor for AI inpainting: select, prompt, get a colour-matched layer. FLUX 3 Image, FLUX.2, GPT Image, Nano Banana, Seedream and Qwen through your API key or your own ComfyUI. Layers, PSD export, MCP.

    Community scumble-app
    langmail

    caldav-mcp

    ๐Ÿ—“๏ธ A CalDAV Model Context Protocol (MCP) server to expose calendar operations as tools for AI assistants.

    Community langmail
    mozilla

    Firefox MCP

    Model Context Protocol (MCP) server that lets AI agents browse the web and debug web pages with Firefox

    Community mozilla
    maestro-press

    Crow

    Modular, agentic framework and MCP platform you self-host. Build and run your own AI agents, connect Claude Code, Claude Desktop, or Cursor as a native MCP connector, self-host your apps, and share over encrypted P2P โ€” on hardware you own, with local or cloud models. Open source.

    Community maestro-press
    MikhailSagalaev

    openradar

    Open base of job vacancies and freelance orders from every board, RSS and Telegram. Run your own node, share with the hub. No paywalls.

    Community MikhailSagalaev