Skip to main content
Glama

sc-bwapi-mcp

Enable AI assistants (e.g., Trae/Claude) to control StarCraft 1 through the BWAPI bridge via MCP (Model Context Protocol).

Architecture

星际1 (1.16.1) ← BWAPI 4.4.0 注入 (Chaoslauncher)
      ↕ 共享内存 + 命名管道
bwapi_bridge.exe (C++, TCP 12345)
      ↕ JSON over TCP
sc-bwapi-mcp (Python MCP server)
      ↕ MCP stdio
Trae / Claude / 任意 MCP 客户端

Related MCP server: defcon-mcp-server

Prerequisites

Component

Version

Description

StarCraft

1.16.1

Standard edition (not Remastered); free download of Anthology from the Battle.net client

BWAPI

4.4.0

https://github.com/bwapi/bwapi/releases/tag/v4.4.0

Visual Studio

2022 Community

Check "Desktop development with C++" during installation

uv

0.12+

Python package manager https://astral.sh/uv

Chaoslauncher

(bundled with BWAPI)

Injects BWAPI.dll into the StarCraft process

Installation

1. Install StarCraft 1 + BWAPI

  1. Download StarCraft Anthology (free) from the Battle.net client and install it to a path without spaces, e.g., C:\Games\Starcraft

  2. Download BWAPI 4.4.0 and install it to a path without spaces, e.g., C:\libraries\BWAPI_440

  3. Set the environment variable BWAPI_DIR = C:\libraries\BWAPI_440

  4. Copy the contents of StarCraft\ and Windows\ from the BWAPI installation directory into the StarCraft directory

2. Build the BWAPI library (required on first run)

The .lib files for BWAPI 4.4.0 need to be built with VS2022:

$msbuild = "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe"
$env:BWAPI_DIR = "C:\libraries\BWAPI_440"

# 编译 BWAPILIB + BWAPIClient (Release x86)
& $msbuild "$env:BWAPI_DIR\BWAPILIB\BWAPILIB.vcxproj" /p:Configuration=Release /p:Platform=Win32 /m
& $msbuild "$env:BWAPI_DIR\BWAPIClient\BWAPIClient.vcxproj" /p:Configuration=Release /p:Platform=Win32 /m

# 编译 ExampleAIModule.dll (BWAPI 4.4.0 需要一个 AI 模块才能触发 onStart)
& $msbuild "$env:BWAPI_DIR\ExampleAIModule\ExampleAIModule.vcxproj" /p:Configuration=Release /p:Platform=Win32 /p:OutDir="<星际目录>\bwapi-data\AI\" /m

3. Build the bridge

cd <项目目录>
scripts\build_bridge.bat

Output: cpp\build\Release\bwapi_bridge.exe

4. Configure bwapi.ini

In the StarCraft directory, ensure bwapi-data\bwapi.ini has:

[ai]
ai = bwapi-data/AI/ExampleAIModule.dll
[auto_menu]
auto_menu = OFF

Usage

Startup order (important!)

  1. Run Chaoslauncher as administrator → Check "BWAPI Injector 4.4.0 [RELEASE]" → Don't click Start yet

  2. Start the bridge: scripts\run_bridge.bat (it waits for the BWAPI server)

  3. Click Start in Chaoslauncher → Enter StarCraft → Single Player → Expansion → Play Custom → Choose a map → Start

  4. After entering the game screen, the bridge automatically connects and pushes status

Configure MCP client

Add the following to Trae's MCP configuration:

{
  "mcpServers": {
    "sc-bwapi": {
      "command": "C:\\Users\\<你>\\.local\\bin\\uv.exe",
      "args": ["run", "--directory", "<项目路径>", "sc-bwapi-mcp"]
    }
  }
}

Restart Trae, and you can call the tools.

MCP tools

Tool

Parameters

Description

get_game_state

None

Reads game state (minerals/gas/supply/all units)

train

unit_type

Train a unit (e.g., Zerg_Drone)

build

worker_id, building_type, tile_x, tile_y

Build a building (automatically finds a buildable location)

move

unit_id, x, y

Move a unit to pixel coordinates

attack

unit_id, target_id

Attack a target unit

gather

worker_id, resource_id

Gather minerals/gas

stop

unit_id

Stop the current action

hold

unit_id

Hold position

chat

text

Send a message in game

Troubleshooting

  • Bridge stuck at "Game table mapping not found": StarCraft is not launched; it is waiting normally.

  • Bridge cannot connect to the pipe: Exit the game and re-enter (the previous bridge was force-killed, and BWAPI's connected flag is stuck).

  • build failed: The bridge uses getBuildLocation to find a location automatically; make sure there is empty space within the creep range.

  • 0 FPS: The computer configuration is insufficient; switch to 1v1 and press F5 in game to reduce speed.

Install Server
F
license - not found
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer

  • Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to control Unreal E…

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ainaxiya/sc-bwapi-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server