MTG卡组管理服务器

一个基于模型上下文协议(MCP)的服务器,为AI助手提供全面的《万智牌》卡组管理和分析工具。

  • by typedrat
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 typedrat/model-the-context-protocol

使用说明

魔术:收集MCP服务器

A. 模型上下文协议(MCP) 服务器,为AI助手提供全面的Magic:The Gathering牌组管理和分析工具。

这是什么?

此MCP服务器使AI助手能够:

  • 管理MTG甲板:在内存中创建、编辑和组织魔法牌
  • 解析甲板列表:从Moxfield、EDHRec和文本格式等流行网站导入套牌
  • 搜索卡片:查询Scryfall数据库以获取卡信息
  • 分析甲板:计算法力曲线、一致性度量和绘制概率
  • 模拟游戏玩法:测试举手和绘制场景

快速开始

安装

选项1:直接从GitHub(最简单):

# No installation needed! Run directly with bunx
bunx github:username/model-the-context-protocol

选项2:克隆并在本地运行:

# Clone the repository
git clone <repository-url>
cd model-the-context-protocol

# Install dependencies
bun install

运行服务器

对于Claude Desktop(推荐):

# If using bunx from GitHub:
bunx github:username/model-the-context-protocol

# If cloned locally:
bun run src/index.ts

对于HTTP客户端:

# If using bunx from GitHub:
bunx github:username/model-the-context-protocol http --port 8080

# If cloned locally:
bun run src/index.ts http --port 8080

配置

将此添加到您的Claude Desktop配置文件中:

如果使用GitHub上的bunx:

{
  "mcpServers": {
    "mtg-deck-manager": {
      "command": "bunx",
      "args": ["github:username/model-the-context-protocol"],
      "env": {}
    }
  }
}

如果在本地克隆:

{
  "mcpServers": {
    "mtg-deck-manager": {
      "command": "bun",
      "args": ["run", "/path/to/model-the-context-protocol/src/index.ts"],
      "env": {}
    }
  }
}

核心功能

甲板管理

  • 同时创建和管理多个甲板
  • 通过自动数量处理添加/删除卡片
  • 从URL(Moxfield、EDHRec等)或文本导入套牌
  • 在JSON文件中保存/加载数据包
  • 格式化用于共享的套牌

卡片搜索和数据

  • 使用Scryfall强大的查询语法搜索魔术卡
  • 获取详细的卡信息,包括价格、合法性和元数据
  • 通过可选过滤获取随机卡
  • 卡片名称自动解析与模糊匹配

甲板分析

  • 马纳曲线分析:可视化转换后的法力值成本分布
  • 一致性度量:计算提取钥匙卡的概率
  • 颜色分析:检查法力基础要求和颜色标识
  • 绘图模拟:测试举手和mulligan场景
  • 超几何计算:甲板优化的精确概率计算

示例用法

一旦连接到AI助手,您就可以:

"Create a new deck called 'Burn' and add 4 Lightning Bolts"
"Import this Moxfield deck: https://www.moxfield.com/decks/xyz123"
"What's the mana curve of my Burn deck?"
"What are the odds of drawing a land in my opening hand?"
"Show me 3 sample opening hands from this deck"
"Find all red creatures with power 3 or greater"

支持的甲板来源

  • 莫克斯菲尔德:全甲板进口,带侧板支撑
  • EDHRec:指挥官甲板建议和清单
  • 文本格式:标准MTG甲板列表格式
  • 手动输入:按数量逐一添加卡片

需求

  • 包子:JavaScript运行时(v1.2.16+)
  • Internet连接:用于Scryfall API和甲板进口
  • MCP兼容客户端:Claude Desktop,或自定义MCP客户端

技术细节

  • 协议:用于AI辅助集成的模型上下文协议(MCP)
  • 运行时:带有TypeScript的Bun
  • 应用程序编程接口:Scryfall用于卡片数据,网络抓取用于卡片导入
  • 存储:通过文件导出/导入进行内存组管理
  • 分析:甲板优化的统计计算

许可证

MIT许可证-有关详细信息,请参阅许可证文件。

贡献

这是一个通过AI助手进行MTG甲板管理的专用工具。欢迎PR进行错误修复和功能增强。