关于 MTG Assistant
MTG Assistant 是面向 Magic: The Gathering 玩家及其他查牌用户的 MCP 服务。它通过 Scryfall 查询卡牌详情,也可为规则问题的研究提供依据。
主要功能
- 01通过 Scryfall 搜索卡牌详情
- 02按名称或特征查询
- 03将卡牌查询用于规则问题参考
适用场景
- 01查看特定卡牌详情
- 02根据部分信息查找卡牌
- 03为规则问题收集卡牌数据
MCP 相关
该 MCP 服务提供 get_mtg_card_info 工具,接受查询字符串并从 Scryfall 获取 Magic: The Gathering 卡牌详情。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。
工具
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
MCP Server MTG Assistant
一个 Model Context Protocol 服务,通过 Scryfall API 提供万智牌卡牌信息查询功能。
规则问题示例工作流
虽然本服务主要用于查询特定卡牌的详细信息,但也可以作为回答万智牌规则问题的关键第一步。
用户提问:“如果我施放一个 X=10 的 Finale of Devastation,并搜索 Avenger of Zendikar,那些衍生物也会获得 +10/+10 和敏捷吗,还是不会?”
可用工具
get_mtg_card_info- 从 Scryfall 检索特定万智牌的详细信息。query(string, 必填):搜索查询字符串(例如卡牌名称、部分名称或特征)
安装和运行
本项目使用 uv 管理依赖项并运行脚本。
使用 uv(推荐)
确保已安装 uv。你可以直接从项目目录运行服务:
# Navigate to the project root directory first
cd path/to/mcp-servers/mcp-mtg-assistant
# Install dependencies (if needed) and run the server script
uv run mcp-server-mtg-assistant
使用 PIP(用于分发或其他设置方式)
如果该软件包已发布,你可以通过 pip 安装:
pip install mcp-server-mtg-assistant
安装后,你可以将其作为脚本运行:
python -m mcp_server_mtg_assistant
开发时,通常如上所示,使用 uv run 运行。
配置
为 MCP 客户端配置(例如 Claude.app、Inspector)
在客户端的 MCP 服务配置中添加一项。键名(示例中的 "mtg-assistant")可以自行选择。
**重要:**配置需要通过 --directory 参数指定 uv 所指向的正确项目目录。路径格式(/ 或 \)取决于你的操作系统以及运行 uv 的方式。
默认:直接使用 uv(Linux/macOS/WSL)
如果你的 MCP 客户端和服务在同一个 Linux、macOS 或 WSL 环境中运行,这是标准做法。
// Example for mcp.json or Claude settings
"mcpServers": {
"mtg-assistant": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp-servers/mcp-mtg-assistant", // Unix-style path
"run",
"mcp-server-mtg-assistant"
]
}
}
Windows 客户端 + WSL 服务
如果你的 MCP 客户端在 Windows 上运行,但希望服务在 WSL 中执行,建议使用此配置。它会使用 wsl.exe 在 WSL 中调用 uv。
要求:
- 必须在 WSL 发行版内部安装
uv。 - 如果
uv不在 WSL 的PATH中,请调整其在 WSL 中的路径(例如/home/user/.cargo/bin/uv)。 --directory参数请使用可从 WSL 内部访问的/mnt/...格式路径。
// Example for mcp.json or Claude settings on Windows
"mcpServers": {
"mtg-assistant": {
"command": "wsl.exe",
"args": [
"/home/your-user/.cargo/bin/uv", // uv WSL PATH
"--directory",
"/mnt/d/repos/mcp-servers/mcp-mtg-assistant", // WSL-style path to project
"run",
"mcp-server-mtg-assistant"
]
}
}
替代方案:在 Windows 上直接使用 uv
此方案假设 uv 直接安装在 Windows 上,且 MCP 客户端也直接在 Windows 上运行。
--directory参数请使用 Windows 格式路径(D:\...)。- 如果你也使用 WSL,请留意可能出现的
.venv冲突(见下文)。
// Example for mcp.json or Claude settings on Windows
"mcpServers": {
"mtg-assistant": {
"command": "uv",
"args": [
"--directory",
"D:\path\to\mcp-servers\mcp-mtg-assistant", // Windows-style path
"run",
"mcp-server-mtg-assistant"
]
}
}
处理 .venv 冲突(不同环境)
- 问题:
uv run会创建一个与操作系统/环境对应的.venv目录(例如 Linux 与 Windows)。如果你在 Windows 上直接运行服务和通过 WSL(或原生 Linux)运行服务之间切换,现有的.venv可能不兼容。 - **解决方案:**切换环境前,删除
mcp-mtg-assistant项目根目录中的.venv目录。之后,uv run会为你正在使用的环境创建一个兼容的新目录。
调试
你可以在配置中的命令和参数前添加 npx @modelcontextprotocol/inspector,使用 MCP inspector 调试服务。
# Example using the Default (Linux/macOS/WSL) configuration:
npx @modelcontextprotocol/inspector uv --directory /path/to/mcp-servers/mcp-mtg-assistant run mcp-server-mtg-assistant
# Example using the Recommended (Windows Client + WSL Server) configuration:
npx @modelcontextprotocol/inspector wsl.exe /home/your-user/.cargo/bin/uv --directory /mnt/d/repos/mcp-servers/mcp-mtg-assistant run mcp-server-mtg-assistant
# Example using the Alternative (Direct Windows) configuration:
npx @modelcontextprotocol/inspector uv --directory D:\path\to\mcp-servers\mcp-mtg-assistant run mcp-server-mtg-assistant
贡献
欢迎贡献,帮助扩展和改进此 MTG Assistant MCP 服务。无论是添加新功能、增强现有功能,还是改进文档,你的贡献都很有价值。
其他 MCP 服务和实现模式示例,请参阅: https://github.com/modelcontextprotocol/servers
欢迎提交拉取请求!欢迎贡献新想法、错误修复或改进内容。
许可证
mcp-server-mtg-assistant 根据 MIT License 获得许可。这意味着你可以自由使用、修改和分发该软件,但须遵守 MIT License 的条款和条件。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。