MCP ExplorerExplorer

Pokemon Vgc Calc Mcp

@jpbullalayaoon 10 months ago
1 MIT
FreeCommunity
AI Systems
A MCP Server for accurate Pokémon damage calculations using @smogon/calc.

Overview

What is Pokemon Vgc Calc Mcp

pokemon-vgc-calc-mcp is a server built using Model-Context Protocol (MCP) that provides a standardized interface for AI agents to perform Pokémon damage calculations using the @smogon/calc package.

Use cases

Use cases include calculating battle damage between Pokémon, integrating with AI agents for strategic decision-making in battles, and providing a resource for developers creating Pokémon-related applications.

How to use

To use pokemon-vgc-calc-mcp, install it globally using npm with the command ‘npm install -g pokemon-vgc-calc-mcp’. Then, configure your MCP client to connect to the server and utilize the ‘calculateDamage’ tool for damage calculations.

Key features

Key features include MCP compliance, accurate damage calculations from the @smogon/calc library, comprehensive input handling for Pokémon stats and moves, error handling for invalid inputs, and Vercel deployment readiness.

Where to use

pokemon-vgc-calc-mcp can be used in gaming applications, particularly in Pokémon battle simulations, AI training for competitive play, and tools for Pokémon enthusiasts.

Content

Pokémon VGC Damage Calculator MCP Server

A server built using Model-Context Protocol (MCP) that provides AI agents a standardized interface for performing Pokémon damage calculations using the @smogon/calc package.

Pokémon VGC Damage Calculator Server MCP server

Features

  • MCP-compliant server with TypeScript and the official MCP SDK
  • Accurate damage calculations powered by the community-vetted @smogon/calc library
  • Comprehensive input handling for Pokémon stats, abilities, items, moves, and field conditions
  • Error handling for invalid Pokémon names, moves, and input validation
  • Vercel deployment ready with zero-config deployment support

Prerequisites

  • Node.js 18+
  • npm

Installation

npm install -g pokemon-vgc-calc-mcp

Development

npm run build  # Build TypeScript
npm run test   # Run test calculation

MCP Client Configuration

Configure your MCP client (Claude Desktop, Cursor, etc.):

Using remote npm package:

{
  "mcpServers": {
    "pokemon-calc": {
      "command": "npx",
      "args": [
        "pokemon-vgc-calc-mcp"
      ],
      "env": {}
    }
  }
}

Local development:

Clone repo locally, build the project and then configure MCP client:

$ git clone [email protected]:jpbullalayao/pokemon-vgc-calc-mcp.git
$ npm install
$ npm run build
{
  "mcpServers": {
    "pokemon-calc": {
      "command": "node",
      "args": [
        "path/to/pokemon-vgc-calc-mcp/dist/index.js"
      ],
      "env": {}
    }
  }
}

Tools Available

The server exposes one primary tool: calculateDamage

Tool: calculateDamage

Calculates battle damage between an attacking and defending Pokémon.

Input Parameters:

  • attacker: Pokémon object with species, level, stats, ability, item, etc.
  • defender: Pokémon object with species, level, stats, ability, item, etc.
  • move: Move object with name and optional critical hit flag
  • field: Field conditions including weather, terrain, and side effects

Output:

  • description: Human-readable calculation result
  • damage: [min, max] damage range
  • koChance: Knock-out probability description
  • fullResult: Complete result object from smogon/calc

Example Usage

When called by an MCP client, the tool accepts parameters like:

{
  "attacker": {
    "species": "Pikachu",
    "level": 50,
    "ability": "Static",
    "item": "Light Ball",
    "nature": "Timid",
    "evs": {
      "spa": 252,
      "spe": 252,
      "hp": 4
    }
  },
  "defender": {
    "species": "Charizard",
    "level": 50,
    "ability": "Blaze"
  },
  "move": {
    "name": "Thunderbolt"
  },
  "field": {
    "gameType": "Singles"
  }
}

Output:

**252 SpA Light Ball Pikachu Thunderbolt vs. 0 HP / 0 SpD Charizard: 198-234 (107 - 126.4%) -- guaranteed OHKO**

Damage: 198-234
KO Chance: guaranteed OHKO

Testing

Local MCP Server Testing

You can test the local MCP server using the MCP Inspector:

npm run build
npx @modelcontextprotocol/inspector node path/to/pokemon-vgc-calc-mcp/dist/index.js

Test Input Example

Use the following input to test the calculateDamage tool:

{
  "attacker": {
    "species": "Chien-Pao",
    "nature": "Jolly",
    "evs": {
      "atk": 252,
      "spe": 252,
      "hp": 4
    },
    "level": 50
  },
  "defender": {
    "species": "Flutter Mane",
    "nature": "Modest",
    "evs": {
      "hp": 164,
      "def": 100
    },
    "level": 50
  },
  "move": {
    "name": "Icicle Crash"
  },
  "field": {}
}

Expected Output

**252 Atk Sword of Ruin Chien-Pao Icicle Crash vs. 164 HP / 100 Def Flutter Mane: 126-148 (83.4 - 98%) -- guaranteed 2HKO**

Damage: 126-148
KO Chance: guaranteed 2HKO

Project Structure

src/
├── index.ts       # Main MCP server implementation
├── calculator.ts  # Damage calculation wrapper
└── types.ts       # TypeScript type definitions

Author’s Note

Interested in the progress of this project? Feel free to follow the repo for live updates!

If you need to get a hold of me regarding this project, feel free to either:

If you’re interested in helping to fund this project, you can support me here. Any and all support is greatly appreciated!

License

MIT

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers