mcpkmn对决
](https://pypi.org/project/mcpkmn-showdown/)   
一个MCP服务器,让人工智能助手完全了解竞争性口袋妖怪。
让Claude(或任何兼容MCP的LLM)即时访问口袋妖怪的统计数据、移动、能力、物品和类型匹配-无API密钥,无费率限制,离线工作。
______________________________________________________________________
为什么存在
没有这个MCP服务器,将准确的口袋妖怪战斗数据输入LLM是痛苦的:
- 幻觉之城 --LLMs经常编造统计数据、忘记能力或误判类型匹配
- 无结构化数据 --你被困在从Bulbapedia或Serebii复制粘贴
- 无法构建代理 --人工智能无法通过编程方式查询战斗机制
与mcpkmn对决:
- 零幻觉 --数据直接来自 口袋妖怪对决,竞争标准
- 结构化响应 --工具返回格式化数据,准备进行推理
- 代理就绪 --构建分析回放、建议团队或进行战斗的机器人
______________________________________________________________________
快速入门(5分钟)
1.安装
pip install mcpkmn-showdown2.配置克劳德桌面
添加到您的配置文件中:
| 操作系统 | 路径 |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| 窗户 | %APPDATA%\Claude\claude_desktop_config.json |
{
"mcpServers": {
"pokemon": {
"command": "mcpkmn-showdown"
}
}
}3.重新启动克劳德桌面
4.试试看
问克劳德: _“Garchomp的最佳能力是什么,为什么?”_
______________________________________________________________________
你能做什么
以下是MCP支持的具体工作流程:
| 工作流 | 示例提示 |
|---|---|
| 团队分析 | “分析该团队的类型覆盖范围并提出改进建议” |
| 配对计算器 | “Choice Scarf Garchomp的速度是否足以超过Dragapult?” |
| 设置建筑 | “建造一个可以处理仙女类型的技巧室清洁工” |
| 回放分析 | “这场战斗出了什么问题?\[粘贴重播日志\]” |
| 学习 | “解释恐吓如何影响伤害计算” |
______________________________________________________________________
api参考
工具概述
| 工具 | 目的 | 关键输入 |
|---|---|---|
get_pokemon | 口袋妖怪的属性、类型、能力 | name: string |
get_move | 移动功率、精度、效果 | name: string |
get_ability | 战斗中的能力是什么 | name: string |
get_item | 持有物品效果 | name: string |
get_type_effectiveness | 损伤乘数计算 | attack_type, defend_types |
search_priority_moves | 查找优先移动 | min_priority: int |
search_pokemon_by_ability | 具有特定能力的口袋妖怪 | ability: string |
list_dangerous_abilities | 按类别划分的战斗关键能力 | category: string |
get_smogon_usage | 按使用方式排列的顶级口袋妖怪 | format: string |
get_smogon_sets | 竞争对手(移动、物品、电动汽车) | pokemon, format |
get_pokemon_counters | 什么检查/计数口袋妖怪 | pokemon, format |
get_pokemon_teammates | 共现最佳队友 | pokemon, format |
search_pokemon_by_stat | 按基本统计数据过滤口袋妖怪 | stat, min_value, max_value |
search_moves_by_effect | 按战略类别查找行动 | effect: string |
get_format_info | 格式规则和元特征 | format: string |
______________________________________________________________________
get_pokemon
查找完整的口袋妖怪数据。
架构:
{
"name": "string" // Pokemon name (e.g., "garchomp", "Mega Charizard X")
}例子:
Input: {"name": "garchomp"}
Output:
Garchomp
Types: Ground/Dragon
Stats: HP 108 | Atk 130 | Def 95 | SpA 80 | SpD 85 | Spe 102
Abilities: Sand Veil / Rough Skin (Hidden)
Weight: 95 kg
Tier: OU______________________________________________________________________
get_move
查找移动细节,包括效果和优先级。
架构:
{
"name": "string" // Move name (e.g., "earthquake", "swords-dance")
}例子:
Input: {"name": "earthquake"}
Output:
Earthquake
Type: Ground | Category: Physical
Power: 100 | Accuracy: 100%
PP: 10 | Priority: 0
Effect: Hits all adjacent Pokemon. Double damage on Dig.______________________________________________________________________
get_ability
看看一种能力在战斗中能做什么。
架构:
{
"name": "string" // Ability name (e.g., "levitate", "protean")
}例子:
Input: {"name": "protean"}
Output:
Protean: This Pokemon's type changes to match the type of the move
it is about to use. This effect comes after all effects that change
a move's type.______________________________________________________________________
get_item
查看持有物品的战斗效果。
架构:
{
"name": "string" // Item name (e.g., "choice-scarf", "leftovers")
}例子:
Input: {"name": "choice-scarf"}
Output:
Choice Scarf: Holder's Speed is 1.5x, but it can only use the first
move it selects.______________________________________________________________________
get_type_effectiveness
计算类型匹配倍数。
架构:
{
"attack_type": "string", // Attacking type (e.g., "electric")
"defend_types": ["string"] // Defending types (e.g., ["water", "flying"])
}例子:
Input: {"attack_type": "electric", "defend_types": ["water", "flying"]}
Output: 4x - Super effective!______________________________________________________________________
search_priority_moves
找到在正常速度顺序之前起作用的动作。
架构:
{
"min_priority": 1 // Minimum priority level (default: 1)
}例子:
Input: {"min_priority": 1}
Output:
+1 Priority: Aqua Jet, Bullet Punch, Ice Shard, Mach Punch,
Quick Attack, Shadow Sneak, Sucker Punch...
+2 Priority: Extreme Speed, Feint...
+3 Priority: Fake Out...______________________________________________________________________
search_pokemon_by_ability
找到所有具有特定能力的口袋妖怪。
架构:
{
"ability": "string" // Ability name (e.g., "intimidate")
}例子:
Input: {"ability": "levitate"}
Output: Azelf, Bronzong, Cresselia, Eelektross, Flygon, Gengar,
Hydreigon, Latias, Latios, Mismagius, Rotom, Uxie, Vikavolt...______________________________________________________________________
list_dangerous_abilities
列出对战斗结果有重大影响的能力。
架构:
{
"category": "string" // One of: immunity, defense, reflect, offense,
// priority, contact, or "all"
}类别:
immunity--悬浮液、闪火、吸收电压、吸水等。defense--多尺度、毛皮、蓬松、漫威尺度等。reflect--魔术弹跳offense--巨大力量、纯粹力量、大猩猩战术等。priority--恶作剧者,大风之翼contact--粗糙的皮肤、铁倒钩、火焰体、静电等。
______________________________________________________________________
get_smogon_usage
从Smogon统计数据中以竞争性格式获取最常用的口袋妖怪。
架构:
{
"format": "string", // Format ID (e.g., "gen9ou", "gen9vgc2025")
"top_n": 20 // Number of results (default: 20)
}例子:
Input: {"format": "gen9ou", "top_n": 5}
Output:
1. Great Tusk (usage count: 619,002) — Top moves: Rapid Spin, Headlong Rush, Ice Spinner
2. Darkrai (usage count: 500,000) — Top moves: Dark Void, Dark Pulse
...______________________________________________________________________
get_smogon_sets
为特定的口袋妖怪获取有竞争力的集合:动作、物品、能力、EV传播、Tera类型和队友。
架构:
{
"pokemon": "string", // Pokemon name (e.g., "Great Tusk")
"format": "string" // Format ID (e.g., "gen9ou")
}______________________________________________________________________
get_pokemon_counters
在竞争性游戏中,通过KO和切换率来检查和对抗口袋妖怪。
架构:
{
"pokemon": "string", // Pokemon name
"format": "string" // Format ID
}______________________________________________________________________
get_pokemon_teammates
根据在竞争团队中的共同出现,为口袋妖怪找到最好的队友。
架构:
{
"pokemon": "string", // Pokemon name
"format": "string" // Format ID
}______________________________________________________________________
search_pokemon_by_stat
查找按基本属性范围筛选的口袋妖怪。有助于根据特定的属性要求组建团队(例如,Trick Room的慢口袋妖怪、快速清洁工、笨重的墙壁)。
架构:
{
"stat": "string", // Stat: "hp", "atk", "def", "spa", "spd", "spe"
"min_value": 0, // Minimum value (default: 0)
"max_value": 999, // Maximum value (default: 999)
"types": ["string"], // Optional type filter
"tier": "string" // Optional tier filter (e.g., "OU")
}例子:
Input: {"stat": "spe", "max_value": 30, "types": ["Steel"]}
Output: Ferrothorn (Grass/Steel, Spe: 20), Stakataka (Rock/Steel, Spe: 13), ...______________________________________________________________________
search_moves_by_effect
按战略类别查找团队建设的行动。
架构:
{
"effect": "string", // Category (see below)
"move_type": "string" // Optional type filter
}类别: spread, priority, recovery, setup, hazard, hazard_removal, weather, terrain, screen, pivot, speed_control, redirection, protect
______________________________________________________________________
get_format_info
获取竞争格式的规则、条款、禁令和元特征。
架构:
{
"format": "string" // Format name (e.g., "gen9ou", "gen9vgc2025")
}支持的格式: 九代ou、九代uu、九代ubers、九代vgc2025、九代doublesou、九世代randombattle
______________________________________________________________________
建筑
┌─────────────────┐ ┌─────────────────────┐ ┌──────────────────┐
│ │ │ │ │ │
│ Claude/LLM │────▶│ mcpkmn-showdown │────▶│ Local JSON │
│ │ MCP │ (MCP Server) │ │ Cache │
│ │◀────│ │◀────│ │
└─────────────────┘ └─────────────────────┘ └──────────────────┘
│
│ (manual update)
▼
┌──────────────────┐
│ Pokemon │
│ Showdown │
│ Data Files │
└──────────────────┘为什么选择MCP?
LLMs对口袋妖怪的数据产生了幻觉——错误的统计数据、被遗忘的能力、糟糕的类型计算。MCP工具允许模型查询权威数据,而不是从训练中猜测。
为什么选择本地JSON而不是连接到Pokemon Showdown?
Pokemon Showdown没有REST API。他们的数据作为web客户端的压缩JavaScript提供。实时连接意味着在每个查询上解析JS、网络延迟、速率限制问题,以及在格式更改时中断。
| 方法 | 权衡 |
|---|---|
| 本地JSON | 即时、离线、可靠——但数据可能会过时 |
| 活动连接 | 总是新鲜的,但缓慢、脆弱,需要互联网 |
对于参考数据(统计、移动、能力),本地是正确的选择。数据仅随新游戏/DLC而变化。Smogon使用统计数据在首次请求时实时获取,并缓存30天(统计数据每月更新一次)。
数据来源:
- 口袋妖怪对决 —
pokedex.json,moves_showdown.json,abilities_full.json,items.json,typechart.json - Smogon统计数据 --使用统计数据、移动集、队友、计数器(按需获取,本地缓存)
要刷新静态数据,请执行以下操作: python -m mcpkmn_showdown.data_fetcher
______________________________________________________________________
安全与限制
| 关注 | 如何处理 |
|---|---|
| 费率限制 | 无-所有数据都是本地数据,没有外部API调用 |
| 数据新鲜度 | 拥有最新决战数据的船只;可手动更新 |
| 输入验证 | 在查找之前对名称进行规范化和验证 |
| 错误处理 | 返回有用的“未找到”消息,从不崩溃 |
| 凭证处理 | 无需凭据、无身份验证、无API密钥 |
______________________________________________________________________
路线图
计划功能:
- \[\]实时战斗集成(连接到正在进行的决战)
- \[\]团队导入/导出(粘贴Showdown格式,获取结构化数据)
- \[\]损伤计算器集成
- \[x\] ~~格式化特定的层列表和禁止列表~~(
get_format_info) - \[x\] ~~ Smogon的使用统计数据~~(
get_smogon_usage,get_smogon_sets)
需要帮助——好的第一个问题:
- \[\]添加
search_pokemon_by_type工具 - \[\]改进表单规范化(区域表单、Gigantamax等)
- \[\]添加更多测试覆盖率
- \[\]支持更多格式
get_format_info
看 贡献.md 关于如何开始。
______________________________________________________________________
贡献
看 贡献.md 获取完整指南。快速启动:
git clone https://github.com/drewsungg/mcpkmn-showdown.git
cd mcpkmn-showdown
pip install -e ".[dev]"
pytest # Run tests
npx @modelcontextprotocol/inspector mcpkmn-showdown # Interactive testing______________________________________________________________________
我需要你的反馈!
如果你尝试一下,请告诉我:
- 工具命名/模式对代理来说是否直观? 不同的界限会有所帮助吗?
- 你的用例缺少什么? 团队建设?爬梯子?回放分析?Eval安全带?
- 是否存在任何安全/滥用问题? 任何可能被滥用的东西?
- 它在负载下表现良好吗? 并发请求?长时间会议?
打开问题或联系: @德鲁松格
______________________________________________________________________
相关项目
- 口袋妖怪llm战斗机器人 --使用此MCP的LLM驱动的口袋妖怪战斗机器人
- 口袋妖怪对决 --竞争性战斗模拟器
- 模型上下文协议 --MCP规范
______________________________________________________________________
许可证
MIT许可证——见 许可证 了解详情。
作者
宋
