Skip to main content
Glama
MCP Ping-Pong Server

MCP Ping-Pong Server

by kimtth

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

Related MCP server: SENTRA MCP

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • -
      license
      Not graded
      quality
      Not graded
      maintenance
      A basic MCP server built with FastMCP framework that provides simple utility tools including message echoing and server information retrieval. Supports both stdio and HTTP transports with Docker deployment capabilities.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      A minimal FastAPI-based MCP server that provides basic utility tools like ping and time functions. Designed for easy deployment with Docker support, authentication, and extensible architecture for future tool additions.
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      A demonstration MCP server that exposes basic arithmetic tools (add, subtract, ping) through FastAPI and shows how to integrate them with OpenAI's tool-calling API for LLM orchestration.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      A FastAPI MCP server that uses Server-Sent Events as a transport layer, providing echo functionality through tools, resources, and prompts.
      12
      MIT