Skip to content

bcperry/mcp_workshop

Repository files navigation

MCP Workshop

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.

What is MCP?

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.

Project Structure

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

Setup Instructions

Prerequisites

  • Python 3.10 or higher
  • Either UV or pip package manager

Option 1: Setup with UV (Recommended)

UV is a fast Python package installer and resolver.

  1. 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
  2. Install dependencies:

    uv sync

    This automatically creates a virtual environment and installs all dependencies. You can also use uv run to execute scripts directly without manually activating the environment.

Option 2: Setup with pip

  1. Create a virtual environment:

    python -m venv .venv
  2. Activate the virtual environment:

    # On Windows (PowerShell)
    .venv\Scripts\Activate.ps1
    
    # On macOS/Linux
    source .venv/bin/activate
  3. Install dependencies:

    pip install -r requirements.txt

Running the MCP Server

Start the MCP server:

# With UV
uv run server/server.py

# Or with activated virtual environment
python server/server.py

Running the Client

In a separate terminal, start the client application:

# With UV
uv run client/app.py

# Or with activated virtual environment
python client/app.py

Using the MCP Inspector

The 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.

Running the Inspector

npx @modelcontextprotocol/inspector

Then 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.

Resources

License

MIT License - see LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages