
pamelafox/mcp-python-demo 是从 https://github.com/pamelafox/mcp-python-demo. 导入的 MCP 服务器候选。
概览
pamelafox/mcp-python-demo 是从 https://github.com/pamelafox/mcp-python-demo. 导入的 MCP 服务器候选。
概述(AI 翻译)
该仓库演示了Model Context Protocol(MCP)SDK for Python的使用。
布置
如果使用开发容器(推荐)
如果你用的是开发容器(带Docker的VS Code),一切都已经为你设置好了!容器里包含Python、uv和所有必要的工具。
如果是本地运行
-
如果还没安装UV,请安装
-
创建虚拟环境:
-
激活虚拟环境:
-
macOS/Linux:
-
在Windows上:
- 从 pyproject.toml 安装依赖:
正在执行开发检查员
运行开发检查员:
安装 Claude
要在 Claude 中安装此 MCP 插件:
-
执行此命令:
-
重启Claude
-
排查:如果出现错误,请在配置中将uv路径修正为绝对路径:
然后用绝对路径更新配置。
在GitHub Copilot中安装
📺 如果你更喜欢通过视频学习,可以看看Burke Holland的这个视频或James Montemagno的这个视频。
如果你已经安装在Claude Desktop里
启用“chat.mcp.discovery”。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
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
-
Install uv if you haven’t already
-
Create a virtual environment:
uv venv -
Activate the virtual environment:
-
On macOS/Linux:
source .venv/bin/activate -
On Windows:
.venv\Scripts\activate
-
-
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:
-
Run this command:
mcp install server.py -
Restart Claude
-
Troubleshooting: If you get an error, fix the uv path in the config to an absolute path:
which uvThen 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.jsonfile 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
- Now that the mcp server is discoverable, open GitHub Copilot and select the
Agentmode (notChatorEdits).
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →