ishitaakolkar/Pokemon-MCP-Battle-Simulation
If you are the rightful owner of Pokemon-MCP-Battle-Simulation and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
This project implements a Model Context Protocol (MCP) server for Pokémon data retrieval and battle simulation.
Pokémon MCP Server & Animated Frontend
Overview
This project implements a Model Context Protocol (MCP) server with two primary capabilities:
- Pokémon Data Resource: Provides comprehensive Pokémon data from the public PokéAPI, including base stats, types, abilities, moves, and evolution chains.
- Battle Simulation Tool: Simulates battles between any two Pokémon, implementing type effectiveness, damage calculation logic, turn order, and status effects.
An optional HTML/CSS/JavaScript frontend is provided for demonstration purposes, allowing users to view Pokémon details and run animated battle simulations.
Features
Backend (Node.js, Express)
- Pokémon data retrieval from PokéAPI
- Base stats, types, abilities, moves, evolution chains
- Battle simulation with:
- Type effectiveness multipliers
- Simplified damage calculation including STAB
- Speed-based turn order
- Status effects: Burn, Poison, Paralysis
- Comprehensive battle log generation
- JSON-based API responses for easy integration with other systems or LLMs
Frontend
- Search Pokémon and display:
- Official sprite
- Base stats in table format
- Type badges with color coding
- Abilities, evolution chain, move list
- Initiate battle simulations with:
- Animated HP bar updates
- Card shake for hit effects
- Step-by-step battle logs with delayed reveal
- Winner display
Folder Structure
(see each folder's README for detailed file explanations)
Pokemon-Battle-Simulation/ ├── ├── ├── ├── └──
Getting Started
Prerequisites
- Node.js v16+
- Internet connection (PokéAPI live fetch)
Install dependencies
npm install
Running Backend Only
node app.js
Backend starts at http://localhost:3000
API Endpoints
Pokémon Data
GET /mcp/resource/pokemon/:name
Battle Simulation
POST /mcp/tool/battle
{
"pokemonA": "pikachu",
"pokemonB": "charizard"
}
Running Frontend UI
- Start backend with
node app.js - Open
/frontend/index.htmlin browser
Tests
npm install --save-dev jest supertest
npm test
Technical Stack
- Backend: Node.js, Express, Axios
- Frontend: HTML5, CSS3, JavaScript
- Data Source: PokéAPI
- Testing: Jest, Supertest (optional)
Notes
Additional details, system behavior notes, and known limitations are documented in .
License
MIT License