A damage and status calculator for Pokemon Generation 3.
ポケモン第三世代(ルビー・サファイア・エメラルド・ファイアレッド・リーフグリーン)のステータスとダメージ計算を行う MCP(Model Context Protocol)サーバーです。
このプロジェクトは、LLM がポケモンの計算を正確に行うための外部ツールとして機能します。MCP サーバーとして実装されており、Claude Desktop などの MCP クライアントから利用できます。
ステータス計算 (calculate_status
): 種族値、個体値、努力値、せいかくを考慮した正確な実数値計算
ダメージ計算 (calculate_damage
): 以下の要素を考慮した総合的なダメージ計算
攻撃側努力値総当たり計算 (calculate_damage_matrix_varying_attack
):
防御側努力値総当たり計算 (calculate_damage_matrix_varying_defense
):
# リポジトリのクローン
git clone https://github.com/ptrst102/pokemon-gen3-calc-mcp.git
cd pokemon-gen3-calc-mcp
# 依存関係のインストール
npm install
npm run build
{
"mcpServers": {
"pokemon-gen3-calc": {
"command": "node",
"args": ["path/to/pokemon-gen3-calc-mcp/dist/index.js"]
}
}
}
この MCP サーバーは以下の特殊な技の処理に対応しています:
npm run schemagen
このプロジェクトでは、Zod スキーマから MCP(Model Context Protocol)用の JSON スキーマを自動生成する仕組みを採用しています。
src/tools/*/handlers/schemas/
内の Zod スキーマを変更したのち、
npm run schemagen
を実行すると
src/tools/*/generated/inputSchema.ts
が自動生成されます。
npm run dev
開発サーバーが正しく動作しているか確認するために、結合テストスクリプトを用意しています:
# MCPサーバーへの実際のリクエストをテスト
npm run test:integration
結合テストでは以下を検証します:
calculate_status
ツールによるステータス計算calculate_damage
ツールによるダメージ計算calculate_damage_matrix_varying_attack
ツールによる攻撃側努力値総当たり計算calculate_damage_matrix_varying_defense
ツールによる防御側努力値総当たり計算このプロジェクトの開発には以下のツールの利用を推奨します:
GitHub との連携を効率化するため、GitHub CLI の導入を強く推奨します。
公式のインストール手順を参考にしてください。
AI 支援開発ツール Claude Code の活用を推奨します。このプロジェクトは CLAUDE.md による開発ガイドラインが整備されているため、Claude Code を使用することでコード生成が容易になります。
# 型チェック
npm run typecheck
# テスト実行
npm run test # 全テスト実行
npm run test -- --watch # ウォッチモードでテスト実行
npm run test -- src/tools/calculateDamage # 特定ディレクトリのテスト
npm run test -- src/utils/adjustSpecialMoves/adjustSpecialMoves.spec.ts # 特定ファイルのテスト
# テストカバレッジ測定
npm run test:coverage # カバレッジ付きでテスト実行
# カバレッジレポート:
# - コンソールに概要が表示されます
# - HTMLレポートは coverage/index.html で確認できます
# リント・フォーマット
npm run lint # チェックのみ
npm run format # 自動修正
# 全チェック(型チェック + リント + テスト)
npm run check
# 結合テスト(MCPサーバーへの実際のリクエストをテスト)
npm run test:integration
# スキーマ生成(ZodスキーマからMCP用JSONスキーマを生成)
# src/tools/*/handlers/schemas/ 内のZodスキーマを変更した後に実行
npm run schemagen
# ビルド(dist/ディレクトリに出力)
npm run build
主要なディレクトリ構成:
src/
├── data/ # ポケモンデータ(種族値、わざ、もちもの等)
├── tools/ # MCPツール定義とハンドラ
│ ├── calculateStatus/
│ ├── calculateDamage/
│ ├── calculateDamageMatrixVaryingAttack/
│ └── calculateDamageMatrixVaryingDefense/
├── types/ # 共通型定義
└── utils/ # 共通ユーティリティ
├── adjustSpecialMoves/ # 特殊な技の処理
├── calculateDamageCore/ # ダメージ計算コアロジック
└── error/ # エラーハンドリング
MIT
Multimodal MCP server for generating images, audio, and text with no authentication required
A collection of Model Context Protocol (MCP) servers for various tasks and integrations, supporting both Python and Node.js environments.
AI-powered theatrical lighting design for the LacyLights system.
An MCP server for accessing UPS shipping and logistics services.
Generates O'RLY? (O'Reilly parody) book covers.
Provides weather-related tools using the US National Weather Service API.
Perform bulk BNB and BEP20 token transfers on the BNB Smart Chain (BSC).
An MCP server for accessing Bazi (Chinese astrology) data, requiring an API key.
Provides real-time prices for assets like precious metals and cryptocurrencies.
An MCP server for programmatic control of smartscreen.tv displays via HTTP and MCP commands, with YouTube integration.