A collection of demo files for MCP servers and clients, illustrating various transport protocols and server capabilities using Python.
This folder contains practical examples for the "Beyond the Basics: Unlocking the Power of MCP" presentation at the 10x Developers Meetup.
macOS/Linux:
cd /Users/davidhague/source/mcp-talk
chmod +x setup.sh
./setup.sh
Windows:
cd \Users\davidhague\source\mcp-talk
setup.bat
cd /Users/davidhague/source/mcp-talk
# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install --upgrade pip
pip install -r requirements.txt
# Test setup
python test_setup.py
01_python_client_demo.py
Simple MCP Python Client
To run:
source venv/bin/activate # Activate venv first!
# Terminal 1 - Start MCP server
npx -y @modelcontextprotocol/server-filesystem /tmp
# Terminal 2 - Run client
python 01_python_client_demo.py
02_system_monitor_server.py
Complete MCP Server from Scratch
To run:
source venv/bin/activate
python 02_system_monitor_server.py
To connect with Claude Desktop:
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json
):
{
"mcpServers": {
"system-monitor": {
"command": "python",
"args": ["/Users/davidhague/source/mcp-talk/02_system_monitor_server.py"],
"env": {
"PATH": "/Users/davidhague/source/mcp-talk/venv/bin:/usr/bin:/bin"
}
}
}
}
03_sse_server_complete.py
MCP with Server-Sent Events (SSE) - Pseudocode Reference
Note: This is pseudocode for understanding SSE concepts.
For working implementations, use 04_https_streamable.py
04_https_streamable.py
Next-Generation Streamable HTTP MCP
To run:
source venv/bin/activate
python 04_https_streamable.py
05_http_client_demo.py
HTTP MCP Client Demo
To run:
source venv/bin/activate
# Terminal 1 - Start HTTP MCP server
python 04_https_streamable.py
# Terminal 2 - Run HTTP client
python 05_http_client_demo.py
āāāāāāāāāāāāāāā MCP Protocol āāāāāāāāāāāāāāā
ā Client ā āāāāāāāāāāāāāāāāāāāŗ ā Server ā
ā (Claude, ā ā (Your App) ā
ā Cursor, ā ⢠Tools ā ā
ā Custom) ā ⢠Resources ā ā
āāāāāāāāāāāāāāā ⢠Prompts āāāāāāāāāāāāāāā
Why use a virtual environment?
Managing the venv:
# Activate (do this before running demos)
source venv/bin/activate
# Check it's working
which python # Should show venv/bin/python
# Install additional packages if needed
pip install some-package
# Deactivate when done
deactivate
If you see import errors:
source venv/bin/activate
)python test_setup.py
to verify setuppip install -r requirements.txt
Common Issues:
source venv/bin/activate
)chmod +x setup.sh
These demos show practical, working examples of MCP's power beyond basic tutorials.
Create and manage end-to-end tests using the Octomind platform.
Generate images using Google's Gemini API.
An agentic communication framework for multi-agent collaboration using MCP.
Interact with various build systems including Gradle, Maven, NPM/Yarn, Cargo, Python, Makefile, and CMake.
Enable AI Agents to fix build failures from CircleCI.
Generates true random numbers using atmospheric noise from random.org.
Extracts images from files, URLs, or base64 strings and converts them to base64 for LLM analysis.
Interact with the Moralis Web3 API to access blockchain data across multiple networks through a structured interface.
MCP server for TeamCity, integrates with Claude Desktop and Cursor.
Single tool to control all 100+ API integrations, and UI components