sc-bwapi-mcp
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., "@sc-bwapi-mcp Train a Zerg Drone and gather minerals with it."
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.
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: zandronum-mcp
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 | |
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
Download StarCraft Anthology (free) from the Battle.net client and install it to a path without spaces, e.g.,
C:\Games\StarcraftDownload BWAPI 4.4.0 and install it to a path without spaces, e.g.,
C:\libraries\BWAPI_440Set the environment variable
BWAPI_DIR=C:\libraries\BWAPI_440Copy the contents of
StarCraft\andWindows\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\" /m3. Build the bridge
cd <项目目录>
scripts\build_bridge.batOutput: 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 = OFFUsage
Startup order (important!)
Run Chaoslauncher as administrator → Check "BWAPI Injector 4.4.0 [RELEASE]" → Don't click Start yet
Start the bridge:
scripts\run_bridge.bat(it waits for the BWAPI server)Click Start in Chaoslauncher → Enter StarCraft → Single Player → Expansion → Play Custom → Choose a map → Start
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 |
| None | Reads game state (minerals/gas/supply/all units) |
|
| Train a unit (e.g., |
|
| Build a building (automatically finds a buildable location) |
|
| Move a unit to pixel coordinates |
|
| Attack a target unit |
|
| Gather minerals/gas |
|
| Stop the current action |
|
| Hold position |
|
| 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
getBuildLocationto 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.
Available Tools
9 toolsattackB
让指定单位攻击指定目标单位。
Inputs: unit_id (required), target_id (required).
buildB
让指定 worker 在 (tile_x, tile_y) 建造建筑。
坐标是格子(TilePosition),不是像素。例如:
build(1, "Terran_Supply_Depot", 50, 100)
Inputs: tile_x (required), tile_y (required), worker_id (required), building_type (required).
chatA
在游戏内发送一条聊天/文字。
Inputs: text (required).
gatherB
让 worker 采集指定资源点(矿物/气矿)。
Inputs: worker_id (required), resource_id (required).
get_game_stateA
获取当前游戏状态 (最近一帧)。
返回 self(己方: 矿/气/供给/单位列表)、enemies(可见敌方单位)。
单位字段: id/type/x/y/hp/sh/player/owner。
Inputs: no named parameters.
holdC
让单位原地驻守(hold position)。
Inputs: unit_id (required).
moveB
让指定单位移动到像素坐标 (x, y)。
Inputs: x (required), y (required), unit_id (required).
stopB
让单位停止当前指令。
Inputs: unit_id (required).
trainA
训练单位。例如: train("Terran_SCV")、train("Protoss_Zealot")。
bridge 会找一个能训练该单位的己方建筑下达指令。
Inputs: unit_type (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
每个工具都对应明确且不同的操作:查询状态、训练、建造、移动、攻击、采集、停止、驻守和聊天。即使 stop 与 hold 语义相近,但描述中一个表示停止指令、一个表示原地驻守,不会造成实质混淆。
大多数工具采用简洁的单个动词命名,如 train、build、move、attack、gather,风格统一;但 get_game_state 是唯一的动词+名词 snake_case 形式,与其余工具命名模式略有偏差。整体仍易读可预测。
9 个工具覆盖了 StarCraft 基础控制所需的常见操作,数量适中,没有冗余或明显臃肿。每个工具都有独立用途,规模与服务器定位匹配。
基础的状态查询、建造、训练和单位指令已具备,但缺少一些常见 RTS 操作如巡逻、攻击移动、修理、研究和升级,也没有取消或队列相关指令。这些缺口会限制复杂策略的实现,但核心流程仍可运行。
Maintenance
Related MCP Connectors
Savecraft serves real save game data and expert game knowledge to AI assistants.
Teamfight Tactics data & AI coaching for Claude and ChatGPT — 19 tools, built-in Riot key.
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Connect ChatGPT, Claude, Cursor or VS Code to your Windows PC: files, terminal, browser, apps.
Related MCP Servers
- AlicenseCqualityDmaintenanceAllows AI assistants to connect to and control Minecraft players on remote servers, enabling navigation, building, mining, inventory management, entity interaction, and chat communication through natural language commands.2711 npm13MIT
- AlicenseCqualityBmaintenanceEnables AI assistants to interact with the Zandronum game engine for development, including running commands, spawning actors, and loading maps.5528 npm3MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI models like Claude to control a Minecraft character through natural language commands, supporting movement, inventory, block interactions, and more.Apache 2.0
- AlicenseAqualityBmaintenanceEnables MCP clients like Claude Code, Claude Desktop and Cursor to search a StarCraft II knowledge base, upload replays, and get AI Coach reports on games. Users can also ask follow-up questions about a coached replay, with mineral costs gated behind explicit confirmation.10MIT