This repository demonstrates how to create and use a Model Context Protocol (MCP) server. The workshop includes both a server implementation and a client application to interact with it.
The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to Large Language Models (LLMs). MCP enables LLMs to securely access tools, data sources, and services through a consistent interface.
Visit modelcontextprotocol.io to learn more about the protocol, its specifications, and available SDKs.
mcp_workshop/
├── server/
│ └── server.py # MCP server implementation
├── client/
│ └── app.py # Client application
├── pyproject.toml # Project configuration
├── requirements.txt # Python dependencies
└── README.md # This file
- Python 3.10 or higher
- Either UV or pip package manager
UV is a fast Python package installer and resolver.
-
Install UV (if not already installed):
# On Windows (PowerShell) powershell -c "irm https://astral.sh/uv/install.ps1 | iex" # On macOS/Linux curl -LsSf https://astral.sh/uv/install.sh | sh
-
Install dependencies:
uv sync
This automatically creates a virtual environment and installs all dependencies. You can also use
uv runto execute scripts directly without manually activating the environment.
-
Create a virtual environment:
python -m venv .venv
-
Activate the virtual environment:
# On Windows (PowerShell) .venv\Scripts\Activate.ps1 # On macOS/Linux source .venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
Start the MCP server:
# With UV
uv run server/server.py
# Or with activated virtual environment
python server/server.pyIn a separate terminal, start the client application:
# With UV
uv run client/app.py
# Or with activated virtual environment
python client/app.pyThe MCP Inspector is a developer tool for testing and debugging MCP servers. It provides a visual interface to interact with your server and see the available tools, resources, and prompts.
npx @modelcontextprotocol/inspectorThen configure it to connect to your MCP server using the appropriate connection settings.
For more information on using the MCP Inspector, visit the official documentation.
MIT License - see LICENSE file for details.