Simple MCP Demo
A Python-based demonstration server showcasing multiple Model Context Protocol transport mechanisms, including stdio, SSE, and HTTP. It provides a functional reference for tool discovery and execution using a sample number addition tool.
README
🚀 Simple MCP Demo
A comprehensive demonstration of a Model Context Protocol (MCP) server implemented in Python. This project showcases how to build a unified server that supports multiple transport mechanisms: Standard I/O (stdio), Server-Sent Events (SSE), and Streamable HTTP.
🛠️ Features
- Multi-Transport Server: One server, three ways to connect.
add_numbersTool: A functional example of a tool discovery and execution flow.- Reference Clients: Dedicated Python scripts for each transport type.
- Inspector Ready: Fully compatible with the official MCP Inspector.
📂 Project Structure
server.py: The core MCP server containing tool logic and transport routing.client_stdio.py: Client for local subprocess communication (pipes).client_sse.py: Client for web-based event streaming.client_http.py: Client for stateful session-based HTTP streaming.DOCUMENTATION.md: Detailed functional and technical specifications.requirements.txt: Project dependencies.
🚀 Getting Started
1. Installation
Clone the repo and install the required packages:
pip install -r requirements.txt
2. Run with MCP Inspector (Recommended)
The easiest way to test the server is using the official tool inspector:
npx @modelcontextprotocol/inspector python server.py
3. Run Reference Clients
Standard I/O (stdio)
python client_stdio.py
Server-Sent Events (SSE)
Terminal 1 (Start Server):
python server.py --transport sse
Terminal 2 (Run Client):
python client_sse.py
Streamable HTTP
Terminal 1 (Start Server):
python server.py --transport http
Terminal 2 (Run Client):
python client_http.py
📈 Protocol Flow
- Initialize: Client and Server exchange capabilities.
- List Tools: Client discovers the
add_numberstool. - Call Tool: Client sends parameters (
a,b) and receives the sum.
📝 Technical Details
For a deeper dive into the architecture, flow diagrams, and transport implementation details, see DOCUMENTATION.md.
Built with ❤️ using the Model Context Protocol
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.