Skip to main content
Glama

Battle Arena MCP Server

An MCP (Model Context Protocol) server that connects AI agents to the Battle Arena - AI Strategy Competition game. Run battles, tournaments, and analyze strategies programmatically.

What is this?

This MCP server wraps the Battle Arena REST API, giving any MCP-compatible AI agent (like Manus) direct access to:

  • List strategies — See all available student and example fighters

  • Get strategy code — Read the source code of any strategy

  • Run battles — Pit two strategies against each other with configurable HP

  • Run tournaments — Round-robin competition with leaderboard

  • Get game rules — All damage values, ranges, and mechanics

Related MCP server: Agent Arcade MCP Server

Quick Start

Option 1: Use with Manus (Custom MCP Connector)

  1. In your Manus project, go to Settings → Connectors → Custom MCP

  2. Add this server with the command:

    npx battle-arena-mcp
  3. Set the environment variable (optional, defaults to the hosted arena):

    BATTLE_ARENA_URL=https://battle-arena.manus.space

Option 2: Run Locally

# Clone and install
git clone https://github.com/Oscarlight/battle-arena-mcp.git
cd battle-arena-mcp
npm install
npm run build

# Run
node dist/index.js

Option 3: npx (no install)

npx battle-arena-mcp

Environment Variables

Variable

Default

Description

BATTLE_ARENA_URL

https://battle-arena.manus.space

Base URL of the Battle Arena API

Available Tools

list_strategies

Lists all available strategies with their IDs, names, and fighting styles.

Example response:

{
  "strategies": [
    { "id": "jayden", "name": "Jayden", "style": "Balanced adaptive", "source": "student" },
    { "id": "rushdown_rex", "name": "Rushdown Rex", "style": "Aggressive pressure", "source": "example" }
  ],
  "total": 23
}

get_strategy_code

Returns the JavaScript source code of a strategy.

Parameters:

  • id (required): Strategy ID from list_strategies

run_battle

Runs a 1v1 battle. Provide strategies by ID or custom code.

Parameters:

  • strategyIdA / strategyA: Strategy A (by ID or code)

  • strategyIdB / strategyB: Strategy B (by ID or code)

  • hp (optional): HP value, 50-1000. Default: 100. Tournament: 250.

  • includeTurnLog (optional): Include full turn-by-turn data

Example response:

{
  "winner": "Jayden",
  "winnerSide": "A",
  "nameA": "Jayden",
  "nameB": "80 Year Old Grandpa",
  "finalHpA": 48,
  "finalHpB": 0,
  "totalTurns": 55,
  "hp": 250
}

run_tournament

Runs a round-robin tournament between 2-20 strategies.

Parameters:

  • strategyIds (optional): Array of strategy IDs

  • strategies (optional): Array of custom strategies with code and optional id

  • hp (optional): HP for all matches

Example response:

{
  "hp": 250,
  "totalMatches": 6,
  "leaderboard": [
    { "id": "jayden", "name": "Jayden", "wins": 2, "losses": 1, "winRate": 67 }
  ],
  "matches": [...]
}

get_game_rules

Returns all game constants (damage, ranges, stamina, etc.).

Writing Custom Strategies

A strategy is a JavaScript function that receives game state and returns an action:

// Strategy Name: My Fighter
// Strategy Style: Aggressive rushdown

function strategy(state) {
  // Available state:
  // state.myHp, state.enemyHp, state.distanceToEnemy
  // state.myStamina, state.isInLightRange, state.isInHeavyRange
  // state.turn, state.myIsRecovering, state.enemyIsRecovering
  // state.mustAttackSoon, state.mustMoveSoon
  
  // Available actions:
  // "move_up", "move_down", "move_left", "move_right"
  // "dash_toward", "dash_away"
  // "light_attack", "heavy_attack"
  // "block", "grab", "special"
  
  if (state.distanceToEnemy > 2) return "dash_toward";
  if (state.isInHeavyRange) return "heavy_attack";
  return "light_attack";
}

REST API (Direct Access)

The MCP server wraps these public endpoints:

Method

Endpoint

Description

GET

/api/strategies

List all strategies

GET

/api/strategies/:id/code

Get strategy source code

POST

/api/simulate

Run a single battle

POST

/api/tournament

Run a round-robin tournament

GET

/api/rules

Get game constants

No authentication required. Rate limited to 30 requests/minute.

License

MIT

Available Tools

5 tools
get_game_rulesA

Get the game rules and constants (damage values, ranges, stamina costs, grid size, etc.). Useful for understanding the game mechanics when designing strategies.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description is the sole source. States the tool returns data and lists example contents, but does not explicitly state it's read-only or side-effect free. Adequate for a simple getter.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with key information, no wasted words. Perfect conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a parameterless, no-output-schema tool, the description fully covers what the tool does and why it's useful. Complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters; schema coverage is 100%. Description does not need to add parameter info. Baseline for zero parameters is 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states 'Get the game rules and constants' with examples like damage values, ranges, stamina costs. Differentiates from siblings such as get_strategy_code and list_strategies.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says 'Useful for understanding the game mechanics when designing strategies,' providing clear context. Does not name alternatives but the sibling list makes differentiation implicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_strategy_codeA

Get the source code of a specific strategy by its ID. Useful for analyzing how a strategy works.

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesThe strategy ID (e.g., 'jayden', 'max', 'rushdown_rex')

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries burden. States it's for getting source code (read operation) but doesn't disclose any behavioral traits like side effects or authentication. Adequate for a simple read tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences with no wasted words. Directly states purpose and usage context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With one simple parameter and no output schema, the description is mostly complete. However, it does not describe the return format (e.g., source code as a string), which could aid usability.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% with examples for the 'id' parameter. Description does not add additional meaning beyond what the schema already provides, meeting the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states 'Get the source code of a specific strategy by its ID', specifying verb and resource. Distinguishes from siblings like list_strategies (which lists strategies) and run_battle (which runs battles).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states 'useful for analyzing how a strategy works', indicating when to use. However, no explicit exclusions or mentions of alternatives like list_strategies for finding IDs.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_strategiesA

List all available battle strategies (both student-created and example strategies). Returns strategy IDs, names, fighting styles, and sources.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description is adequate for a simple read-only listing operation, but with no annotations, it could provide more detail about side effects (none), rate limits, or response size. The lack of any behavioral caveats beyond listing is acceptable but minimal.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence that efficiently conveys purpose and return data. No extraneous information. Perfectly concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter list tool with no output schema, the description covers the main purpose and return fields. It could mention that it returns a list or array, but the verb 'returns' implies that. Completeness is good but not flawless.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist, so the schema coverage is effectively 100%. The description adds no additional parameter information, which is appropriate given zero parameters. Baseline 4 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses specific verb 'list', resource 'battle strategies', and explicitly mentions returned fields (IDs, names, fighting styles, sources). It clearly distinguishes from sibling tools like get_strategy_code or run_battle.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly indicates when to use this tool (to list available strategies), but does not explicitly state when not to use it or suggest alternatives. However, context from sibling tools makes usage boundaries clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

run_battleA

Run a 1v1 battle between two strategies. You can specify strategies by ID (from the available list) or provide custom strategy code. Returns the winner, final HP, and total turns.

ParametersJSON Schema
NameRequiredDescriptionDefault
hpNoHP for the battle (50-1000). Default: 100. Tournament mode uses 250.
strategyANoCustom JavaScript code for strategy A. Must include '// Strategy Name: ...' comment and a 'function strategy(state) { ... }' function.
strategyBNoCustom JavaScript code for strategy B. Must include '// Strategy Name: ...' comment and a 'function strategy(state) { ... }' function.
strategyIdANoID of strategy A (from list_strategies). Use this OR strategyA code.
strategyIdBNoID of strategy B (from list_strategies). Use this OR strategyB code.
includeTurnLogNoIf true, includes the full turn-by-turn log. Default: false (for shorter responses).

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden. It explains the action (run battle), optional turn log, and return values. It does not mention side effects, auth requirements, or error handling, but the behavior is clearly a simulation with no persistent state changes.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three sentences, front-loaded with the main purpose and key options. It is compact, readable, and contains no unnecessary information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description adequately explains the return values (winner, HP, turns) and optional includeTurnLog. It does not cover error conditions or rate limits, but for a simulation tool with no required params, it is sufficiently complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents parameters well. The description adds overall context (returns winner, HP, turns) and the includeTurnLog option, but does not add significant meaning beyond the schema descriptions. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool runs a 1v1 battle between strategies, specifying the options (by ID or custom code) and the return values (winner, HP, turns). This distinguishes it from sibling tools like run_tournament, which runs multiple battles.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions using list_strategies to get IDs and provides an alternative of custom code. It implicitly suggests when to use this tool (single battle) vs run_tournament (multiple battles). However, it does not explicitly state when not to use it or provide exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

run_tournamentA

Run a round-robin tournament between multiple strategies. All strategies fight each other once. Returns a leaderboard with wins/losses and all match results.

ParametersJSON Schema
NameRequiredDescriptionDefault
hpNoHP for all matches (50-1000). Default: 100. Tournament mode uses 250.
strategiesNoArray of custom strategies to include (each with 'code' and optional 'id').
strategyIdsNoArray of strategy IDs to include in the tournament (from list_strategies).

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It only describes basic mechanics and output, but omits important behavioral traits like side effects, permissions, computational cost, or state changes. This is insufficient for a tool that likely executes user-provided code.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three sentences with no redundancy: first states action and type, second clarifies round-robin format, third describes output. Every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description adequately mentions return structure (leaderboard, wins/losses, match results). However, it lacks context on minimum number of strategies, handling of both strategy inputs simultaneously, and performance implications. Coverage is basic but not thorough.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 100% coverage with descriptions for all parameters. The description adds no extra semantic value beyond the schema, such as interaction between parameters or constraints. Baseline score of 3 is appropriate since schema already documents parameters well.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states the tool runs a round-robin tournament, explains it's between multiple strategies, and specifies the output (leaderboard with wins/losses and match results). Distinguishes from siblings like run_battle (single match) and list_strategies.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for round-robin tournaments but does not explicitly state when to use vs alternatives (e.g., run_battle for single matches, or other tournament formats). No when-not-to-use guidance is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updatesv1.0.0
    • First observedget_game_rules
    • First observedget_strategy_code
    • First observedlist_strategies
    • First observedrun_battle
    • First observedrun_tournament

TDQS

A4.1/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: rules, strategy code retrieval, listing strategies, single battle, and tournament. No ambiguity.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern (get_game_rules, get_strategy_code, list_strategies, run_battle, run_tournament).

Tool Count5/5

5 tools is well-scoped for a battle arena server, covering essential actions without unnecessary bloat.

Completeness4/5

Core battle lifecycle is covered, but missing strategy creation/modification tools and persistent result storage are missing, assuming strategies are externally defined.

Maintenance

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers