Python语言,基于 mcp 库实现的一个 MCP-Server。
预测明天的天气。
- 如果未安装 uv工具,先执行一键安装脚本安装
# 在 macOS 上安装
# 推荐使用 Homebrew 安装:
brew install uv
# 或者使用官方安装脚本:
curl -LsSf https://astral.sh/uv/install.sh | sh
# 在 Linux 上安装
curl -LsSf https://astral.sh/uv/install.sh | sh
# 在 Windows 上安装
# 使用 Winget:
winget install uv
# 或者使用官方安装脚本(PowerShell):
irm https://astral.sh/uv/install.ps1 | iex
# 安装完成后,验证是否成功:
uv --version- 添加如下 mcpServers 配置
{
"mcpServers": {
"weather": {
"autoApprove": [],
"disabled": false,
"timeout": 60,
"type": "stdio",
"command": "uvx",
"args": [
"darcycui-mcp"
]
}
}
}- clone项目到本地 path
- 添加如下配置
- 注意 path 替换为你的本地路径
- 注意 路径分隔符,Linux/Mac 使用/分隔符, Windows 使用\分隔符
{
"mcpServers": {
"weather": {
"autoApprove": [],
"disabled": true,
"timeout": 60,
"type": "stdio",
"command": "uv",
"args": [
"--directory",
"path\\src\\darcycui_mcp",
"run",
"weather.py"
]
}
}
}