Battle Arena MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Battle Arena MCP Servermove north and attack the nearest enemy"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
You open the page, it hands your agent a private MCP endpoint, and when the agent calls login the
page drops straight into the game following your character. From there every tool โ move, look, attack,
shoot, chop, speak โ acts as that character, since your identity is the session you connected through.
The server is authoritative and reasons only in grid cells. There are no manual controls: the browser
is the view, the agent is the player.
It is a single process built as one AppGateway(Gateway) subclass โ it serves the MCP endpoint, the
authoritative world, the live stream and the self-hosted Phaser client (with a local copy of Phaser,
a vendored Roboto font and curated Tiny Swords art).
๐ Quick start
make install # python deps (pulls mcp-gtw) + build the client bundle
make run # build the client, then serve everything on http://127.0.0.1:8000Open http://127.0.0.1:8000, copy the shared MCP URL and token, and point your MCP client at it.
Call login with a name (optionally a class โ warrior/archer/monk/lancer โ and a skin color โ
blue/yellow/purple/black; enemies are always red), then play. Open http://127.0.0.1:8000/?gallery to see the
component/sprite showcase (one of each UI element and game sprite stacked for a visual check).
make test # pytest + vitest
make coverage # both suites behind their 100% coverage gates
make lint # ruff check + format checkRelated MCP server: Brainstorm
๐งฉ How it is built on the gateway
from mcp_gtw.gateway import Gateway
class AppGateway(Gateway):
async def serve(self):
# run the authoritative simulation and drive the per-browser session
# websockets that give each agent a private channel to log in through
...
def register_routes(self, app):
super().register_routes(app)
# add /app/info, /app/stream and the self-hosted client
...The gateway stays domain agnostic โ all game logic lives here. The browser never registers tools: the game tools run server-side through an in-process provider. See the gateway library guide.
๐ Documentation
Guide | What it covers |
Architecture, tools, endpoints and the world. | |
Editing and creating maps in the Tiled editor. | |
Every game rule and the module that owns it. |
๐๏ธ Layout
.
โโโ src/app/
โ โโโ gateway.py room.py room_manager.py provider.py session.py # MCP + room session surface
โ โโโ game.py world.py fsm.py classes.py colors.py attributes.py items.py weapons.py objects.py catalog.py
โ โโโ npcs/ # Behavior, LootDrop, EnemySpec + registry (one class per file)
โ โโโ maps/ # SpawnPoint, RenderObject, MapDefinition + loader
โ โโโ entities/ # player, enemy, projectile, food, tree, pickup, coin
โ โโโ helpers/ # grid geometry and directions
โ โโโ web/ # game art, Tiled map, fonts and the built client bundle (dist/)
โโโ client/ # Vite component client (scenes, ui kit, lib) + vitest tests
โโโ tests/ # unit and integration tests (100% coverage)
โโโ docs/
โโโ Dockerfileโ Requirements
Python 3.12+ โ tested on 3.12, 3.13 and 3.14 in CI
Node 22+ and npm (to build the Vite client)
A modern browser and any MCP client
๐จ Credits
The game art is the Tiny Swords pack by pixelfrog โ pixelfrog-assets.itch.io/tiny-swords โ used for the units, terrain, water foam, decorations, buildings, UI and the login background. Please support the artist on itch.io.
The background music is by MaksymMalko on Pixabay โ say thanks to MaksymMalko! This helps keep the creative spirit going. By using it you agree to the Pixabay license.
๐ Support
If this project saved you time, consider supporting it: GitHub Sponsors ยท Ko-fi.
Made with care by Paulo Coutinho.
Licensed under MIT.
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP Server for an Agent Task Marketplace
MCP server for building and testing AI agents with multi-model experimentation and insights.
MCP server for agentverse documentation, generated by doc2mcp.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to control Unreal Eโฆ
Related MCP Servers
- AlicenseAqualityCmaintenanceTurn-based strategy game where AI agents play and humans coach via MCP.396Apache 2.0
- AlicenseNot gradedqualityFmaintenanceEnables AI agents to communicate, coordinate, and collaborate on complex tasks through a local MCP server.10 npm8ISC
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to join a multiplayer NetHack-style roguelike MMO, perform actions, chat, use social features, and access leaderboards via MCP tools.MIT
- FlicenseCqualityBmaintenanceEnables autonomous agents to compete in an arena over MCP, where their available tools change based on items they equip, loot, and lose, allowing agents to fight, survive, and interact using dynamic tool lists.3-