宝可梦数据与战斗模拟服务器

提供宝可梦数据查询和战斗模拟功能的MCP服务器,支持AI模型或用户查询宝可梦属性和进行战斗模拟。

  • by AdeetyaDubey5
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 adeetyadubey5/pokemon-mcp-server

使用说明

宝可梦MCP服务器

一 MCP(模型上下文协议)服务器 它提供:

  1. 宝可梦数据资源 –公开宝可梦的统计数据、类型、能力、动作和进化信息。
  2. 作战模拟工具 –允许AI模型(或用户)使用类型效果、移动伤害、回合顺序和状态效果等机制模拟任意两个宝可梦之间的战斗。

该项目将人工智能模型与口袋妖怪知识联系起来,既可以查询口袋妖怪数据,也可以运行战斗模拟。


⚡ 特性

宝可梦数据资源

  • 提供全面的口袋妖怪数据:
    • 基础统计数据(生命值、攻击、防御、特殊攻击、特殊防御、速度)
    • 类型(例如,火、水、草)
    • 能力
    • 可用的移动和效果
    • 进化信息
  • 可通过MCP资源查询访问

作战模拟工具

  • 输入:任意两个具有选定动作的口袋妖怪
  • 核心力学:
    • ✅ 类型有效性乘数(例如,水>火)
    • ✅ 基于属性和移动力的伤害计算
    • ✅ 转弯顺序由速度决定
    • ✅ 状态影响: 麻痹、烧伤、中毒
  • 输出:
    • 详细的回合战斗日志
    • 宣告胜负
    • JSON结果格式,便于集成

🛠️ 安装

克隆此存储库:

git clone https://github.com/AdeetyaDubey5/Pokemon-MCP-Server.git
cd Pokemon-MCP-Server bash

安装依赖关系:

pip install -r requirements.txt

启动服务器:

uvicorn main:app --reload

📊 查询示例

1.查询宝可梦数据

请求:

GET /pokemon/pikachu

答复:

{
  "name": "Pikachu",
  "types": ["Electric"],
  "stats": {
    "hp": 35,
    "attack": 55,
    "defense": 40,
    "special-attack": 50,
    "special-defense": 50,
    "speed": 90
  },
  "abilities": [
    {"name": "Static", "is_hidden": false},
    {"name": "Lightning Rod", "is_hidden": true}
  ],
  "moves": ["Thunderbolt", "Quick Attack", "Iron Tail"],
  "evolution_chain": ["Pichu", "Pikachu", "Raichu"]
}

2.模拟一场战斗

请求:

POST /battle/simulate
Content-Type: application/json

{
  "attacker": "Charmander",
  "defender": "Squirtle",
  "attacker_moves": ["seismic-toss","fury-swipes","mud-slap"],
  "defender_moves": ["Water Gun","bubble","rapid-spin"],
  "max_turns": 50,
  "random_seed": 42
}

答复:

{
  "winner": "squirtle",
  "turns": 2,
  "log": [
    "-- Turn 1 --",
    "charmander used seismic-toss (no direct damage in this sim)",
    "squirtle used bubble -> -69 (effectiveness x2.0)",
    "-- Turn 2 --",
    "charmander used seismic-toss (no direct damage in this sim)",
    "squirtle used bubble -> -49 (effectiveness x2.0)"
  ]
}