Skip to main content

MCP Python Demo

This repository demonstrates the use of Model Context Protocol (MCP) SDK for Python.

Setup

If using Dev Container (Recommended)

If you're using the dev container (VS Code with Docker), everything is already set up for you! The container includes Python, uv, and all necessary tools.

If running locally

  1. Install uv if you haven't already

  2. Create a virtual environment:

    uv venv
    
  3. Activate the virtual environment:

    • On macOS/Linux:

      source .venv/bin/activate
      
    • On Windows:

      .venv\Scripts\activate
      
  4. Install dependencies from pyproject.toml:

    uv sync --dev
    

Running Development Inspector

To run the development inspector:

mcp dev server.py

Installing in Claude

To install this MCP plugin in Claude:

  1. Run this command:

    mcp install server.py
    
  2. Restart Claude

  3. Troubleshooting: If you get an error, fix the uv path in the config to an absolute path:

    which uv
    

    Then update the configuration with the absolute path.

Installing in GitHub Copilot

📺 If you prefer learning from videos, watch this video from Burke Holland or this video from James Montemagno.

If you already installed in Claude Desktop

Enable chat.mcp.discovery.enabled: true in your settings and VS Code will discover existing MCP server lists, and proceed to use the tool in GitHub Copilot Agent mode.

If you did not install in Claude Desktop

  • If you want to associate the MCP server only with a particular repo, create a .vscode/mcp.json file with this content:

    {
    "inputs": [
    ],
    "servers": {
          "pamelas-mcp": {
             "command": "PATH/TO/uv",
             "args": [
                "--directory",
                "/PATH/TO/mcp-python-demo",
                "run",
                "server.py"
             ]
          }
    }
    }
    
  • Alternatively, if you want to associate the MCP server with all repos, add to your VS Code User Settings JSON:

    {
    "mcp": {
       "inputs": [],
       "servers": {
          "pamelas-mcp": {
          "command": "/PATH/TO/uv",
          "args": [
             "--directory",
             "/PATH/TO/mcp-python-demo",
             "run",
             "server.py"
          ]
          }
       }
    }
    }
    

    Another way to update settings is to run this command in the terminal:

    code-insiders --add-mcp "{\"name\":\"pamelas-mcp\",\"command\":\"/PATH/TO/uv\",\"args\":[\"--directory\",\"/PATH/TO/mcp-python-demo\",\"run\",\"server.py\"]}"
    

Using tools in Copilot

  1. Now that the mcp server is discoverable, open GitHub Copilot and select the Agent mode (not Chat or Edits).
  2. Select the "refresh" button in the top right corner of the Copilot chat text field to refresh the server list.
  3. Select the "🛠️" button to see all the possible tools, including the ones from this repo.
  4. Put a question in the chat that would naturally invoke one of the tools, for example: "What is the current weather in Seattle?".

Metadata

Release files for iflow-mcp_pamelafox-mcp-python-demo 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iflow-mcp_pamelafox-mcp-python-demo 0.1.2
File Size Uploaded
iflow_mcp_pamelafox_mcp_python_demo-0.1.2.tar.gz 5.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iflow-mcp_pamelafox-mcp-python-demo 0.1.2
File Interpreter ABI Platform
iflow_mcp_pamelafox_mcp_python_demo-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 11.8 kB

Release files / iflow_mcp_pamelafox_mcp_python_demo-0.1.2.tar.gz

Download URL iflow_mcp_pamelafox_mcp_python_demo-0.1.2.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
095cda7f107ed32837326ab64f4e7dbdc221f24be5d3f96a5a4578d681f38601
BLAKE2b-256 checksum
How to use checksums
6e6b907218aac69914a5999a09c0a7b864739d343f2655423853f7f896dfe786
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / iflow_mcp_pamelafox_mcp_python_demo-0.1.2-py3-none-any.whl

Download URL iflow_mcp_pamelafox_mcp_python_demo-0.1.2-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a55448e102fa33acddc67cd6f4b1eb9c9c24fb2b39d6669f4ba661c4a1a0794
BLAKE2b-256 checksum
How to use checksums
94f5ca622795a87c2aec944a5d6f1f47d5b5c6f04b33af59d1580730a9deb497
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page