Github repository here

Introduction

Model Context Protocol (MCP) is an open standard that allows large language models like Claude to interact with external tools and data sources. This project implements an MCP server that connects Claude to live Pokémon data via PokéAPI and real-world animal facts via Wikipedia's REST API — enabling Claude to answer questions about Pokémon stats, simulate battles, and explain the real-world inspirations behind Pokémon designs.

Technical Stack

The server is built with two core libraries:

  • FastMCP: A high-level Python framework for building MCP servers with minimal boilerplate
  • httpx: An async HTTP client used for all API calls to PokéAPI and Wikipedia
  • The server runs via stdio transport, which makes it directly compatible with Claude Desktop and other MCP-capable hosts. Once configured in claude_desktop_config.json, Claude can call any of the server's tools mid-conversation.

    Tools Implemented

    get_pokemon_info

    Fetches a Pokémon's base stats, types, and abilities from PokéAPI by name. A shared async helper function fetch_pokemon_data() handles all PokéAPI requests and is reused across tools to avoid redundant HTTP logic.

    find_pokemon_by_type

    Accepts a type name (e.g. fire, psychic, dragon) and returns the top 5 Pokémon of that type along with their HP, Attack, Speed, and total base stat sum — useful for quickly identifying strong options in a given type category.

    battle_simulator

    Simulates a 1v1 matchup between any two Pokémon using a stat-based formula. The simulator estimates damage output by comparing average attack vs. average defense, calculates how many hits it would take to knock out each opponent, and applies a 10% speed advantage to the faster Pokémon. The result includes a full stat breakdown and a winner with reasoning.

    create_tournament_squad

    Assembles a competitive 6-Pokémon team from a curated list of tournament-viable Pokémon (Charizard, Garchomp, Lucario, Dragonite, Metagross, Gardevoir), verifying each one's data is available via the API before returning the squad.

    pokemon_real_animal

    This is the most distinctive tool in the server. It maps 60+ Pokémon to their real-world animal inspirations using a hardcoded dictionary, then fetches a Wikipedia summary about the corresponding animal. The response pairs the Pokémon's in-game stats with biological context about its real-world counterpart — for example, Garchomp maps to the Hammerhead Shark, and Slowpoke maps to the Axolotl.

    A few example mappings:

  • Pikachu → Mouse
  • Gyarados → Oarfish
  • Heracross → Hercules Beetle
  • Absol → Wolf
  • Emolga → Japanese Dwarf Flying Squirrel
  • How MCP Works in This Context

    Each tool is registered using FastMCP's @mcp.tool() decorator. The function's name, parameters, and docstring are automatically exposed to the LLM as a callable tool. Claude decides when to invoke a tool based on the conversation context and uses the return value directly in its response — no additional parsing or routing is needed.

    The server entry point simply calls mcp.run(transport="stdio"), which starts the MCP loop and handles all protocol communication with the host automatically.

    Key Takeaways

  • FastMCP makes it straightforward to expose Python async functions as LLM-accessible tools with minimal setup
  • Combining multiple public APIs (PokéAPI + Wikipedia) within a single MCP server creates richer, more contextual responses than either API alone
  • Stat-based game simulations are a natural fit for MCP tools — they encode domain logic that would otherwise require the LLM to reason from scratch
  • The real animal mapping highlights how domain knowledge encoded as structured data (a dictionary) can meaningfully extend what an LLM can explain
  • Github repository here