MCP.so
Sign In
Servers

Poké-Battle

@shreyahhh

Overview

What is Poké-Battle?

Poké-Battle is a Pokemon game built with FastAPI and Python, leveraging Anthropic’s Claude AI through a custom Model Context Protocol (MCP) server and client. It features real-time battles and uses AI for creative battle descriptions, attack recommendations, and generating unique personalities for caught Pokemon.

How to use Poké-Battle?

Clone the repository, create and activate a Python virtual environment, then install dependencies. Set your Anthropic API key in a .env file, run the MCP server on port 8000 (uvicorn mcp_server:app --reload --port 8000), then run the main game server on port 8080 (uvicorn server:app --reload --port 8080). Open http://localhost:8080 in your browser to play.

Key features of Poké-Battle

  • Catch random Pokemon to build your team.
  • Turn-based battles against a random opponent Pokemon.
  • AI‑generated battle descriptions via Claude.
  • AI‑suggested attack moves during battle.
  • Each caught Pokemon gets a unique, AI‑generated personality.
  • Real‑time game state and message updates via WebSocket.
  • Demonstrates a Model Context Protocol for AI model interaction.

Use cases of Poké-Battle

  • Play a Pokemon battle game with AI‑driven narratives.
  • Learn how to integrate Anthropic’s Claude into a web game using MCP.
  • Experiment with real‑time WebSocket updates in a FastAPI application.
  • Showcase creative AI text generation for game commentary.

FAQ from Poké-Battle

What dependencies does Poké-Battle require?

The project requires Python, FastAPI, Uvicorn, Anthropic’s Claude API (via API key), PokeAPI, and libraries such as python-dotenv, httpx, websockets, and Jinja2.

How do I set up the Anthropic API key?

Create a .env file in the root directory and add ANTHROPIC_API_KEY=your_api_key_here. For production, it’s recommended to use environment variables from your hosting environment instead of a .env file.

Do I need to run two servers?

Yes. The MCP server runs on port 8000 (the AI backend), and the main game server runs on port 8080 (handles game logic and serves the frontend). Both must be running simultaneously.

How does Poké-Battle use the MCP?

The MCP server (mcp_server.py) handles communication with the Anthropic API. The main server (server.py) uses an MCP client (mcp_client.py) to send requests to the MCP server, enabling AI features like battle descriptions, attack suggestions, and Pokemon personalities.

What transport does Poké-Battle use?

Game state and messages are updated in real time via WebSocket. The MCP communication between servers uses HTTP (FastAPI endpoints).

More from AI & Agents