Skip to main content
Glama
mekabu0551

Pokemon Champions Battle Assistant

by mekabu0551
README.md
# Pokemon Champions Battle Assistant - MCP Server

This project is a Model Context Protocol (MCP) server for the Pokemon Champions Battle Assistant, built using [@hono/mcp](https://github.com/honojs/middleware/tree/main/packages/mcp) and the `@modelcontextprotocol/sdk`.

It allows LLMs (like Claude) to query live battle statistics and perform damage calculations directly on your local system or remote host.

---

## ๐Ÿ›  Setup & Installation

### 1. Requirements

- Node.js v20+
- The repository [PokemonChampions_Battle-assistant-tool](file:///home/mekabu0551/poke-api-poc/PokemonChampions_Battle-assistant-tool) cloned and populated with databases.

### 2. Install dependencies

In the root directory, run:

```bash
npm install
```

### 3. Build & Start the Server

To compile the TypeScript code and start the Hono server:

```bash
# Start in development mode (with hot-reloading)
npm run dev

# Or build and run the production server
npm run build
npm start
```

The server will start listening on **`http://localhost:8787`**.

---

## ๐Ÿ”Œ Connecting to an MCP Client (e.g., Claude Desktop)

To connect Claude Desktop to your local Hono MCP server, add the following configuration to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "pokemon-champions": {
      "url": "http://localhost:8787/mcp"
    }
  }
}
```

---

## ๐Ÿงฐ Available Tools

Once connected, the following tools will be made available to your LLM:

### 1. `get_pokemon_metadata`

- **Description**: Returns base stats, types, English name, and ID of a given Pokemon.
- **Parameters**:
  - `pokemon_name` (string, required): Japanese or English name of the Pokemon (e.g., `"ใ‚ฌใƒ–ใƒชใ‚ขใ‚น"`, `"garchomp"`).

### 2. `get_battle_statistics`

- **Description**: Returns popularity statistics of moves, items, natures, ev spreads, and abilities for a specific Pokemon in the current environment.
- **Parameters**:
  - `pokemon_name` (string, required)
  - `format` (`"Singles"` | `"Doubles"`, default: `"Doubles"`)
  - `season` (string, optional)

### 3. `calculate_damage`

- **Description**: Performs a precise Level 50 damage calculation between two Pokemon, factoring in nature, stats, items (like `ใ“ใ ใ‚ใ‚Šใƒใƒใƒžใ‚ญ`, `ใจใคใ’ใใƒใƒงใƒƒใ‚ญ`), ranks, weather, and terrain.
- **Parameters**:
  - `attacker` (object, required): Attacker details (`name`, `evs`, `nature`, `ranks`, `item`, `teratype`).
  - `defender` (object, required): Defender details (`name`, `evs`, `nature`, `ranks`, `item`, `teratype`).
  - `move` (string, required): Move name (e.g., `"ใ˜ใ—ใ‚“"`).
  - `environment` (object, optional): Weather and Terrain settings.

---

## ๐Ÿ“ Key Code Files

- [package.json](file:///home/mekabu0551/poke-api-poc/package.json) โ€” Project configuration and dependencies.
- [tsconfig.json](file:///home/mekabu0551/poke-api-poc/tsconfig.json) โ€” TypeScript settings.
- [src/index.ts](file:///home/mekabu0551/poke-api-poc/src/index.ts) โ€” The MCP server implementation.