- Home
- MCP servers
- MCP Server Research
MCP Server Research
- python
0
GitHub Stars
python
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
MCP enables distributed systems to coordinate actions through a standardized, message-based protocol. This server demo showcases a simple MCP server that tracks connected clients, processes heartbeat and data messages, routes communications, and provides a web dashboard to monitor activity, all with in-memory history for easy testing.
How to use
You can use the MCP server with a client that supports the protocol. Start the server with default settings, then run a client demo to see the flow of messages between the server and a client. You can also customize the server port and enable debugging to aid development.
How to install
Prerequisites: Python 3.8 or newer, Flask, and Requests.
Clone the project, set up a virtual environment, install dependencies, and run the demo.
# Clone the repository
git clone https://github.com/ckz/mcp_server_research.git
cd mcp_server_research
# Set up virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
How to run the demo
Start the MCP server with default settings and then view the dashboard at the port you specify.
cd src/demo
python simple_mcp_server.py
To customize settings, set environment variables before starting the server.
cd src/demo
DEBUG=true PORT=5001 python simple_mcp_server.py
Visit the dashboard in your browser at http://localhost:5001 (or your chosen port).
Run a client demo
Open another terminal to run a client demo that connects to your MCP server and sends messages for a defined duration and interval.
cd src/demo
python client_demo.py --server http://localhost:5001 --duration 30 --interval 2
Available tools
registerClient
Registers and tracks connected clients as they connect to the MCP server.
handleHeartbeat
Processes heartbeat messages to monitor liveness of clients.
routeMessage
Routes messages to the appropriate destinations or clients based on the MCP protocol.
dashboard
Provides a web-based dashboard to monitor system activity and message history.
messageHistory
Maintains an in-memory history of messages exchanged during the session.