Skip to main content
Glama

sc-bwapi-mcp

Eine BWAPI-Brücke, die es KI-Assistenten (wie Trae/Claude) über MCP (Model Context Protocol) ermöglicht, StarCraft 1 zu steuern.

Architektur

星际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

Voraussetzungen

Komponente

Version

Beschreibung

StarCraft

1.16.1

Normale Version (nicht Remastered), Anthology über den Battle.net-Client kostenlos herunterladbar

BWAPI

4.4.0

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

Visual Studio

2022 Community

Bei der Installation „Desktopentwicklung mit C++" anhaken

uv

0.12+

Python-Paketmanager https://astral.sh/uv

Chaoslauncher

(in BWAPI enthalten)

Injiziert BWAPI.dll in den StarCraft-Prozess

Installationsschritte

1. StarCraft 1 + BWAPI installieren

  1. StarCraft Anthology über den Battle.net-Client herunterladen (kostenlos), in einen Pfad ohne Leerzeichen installieren, z. B. C:\Games\Starcraft

  2. BWAPI 4.4.0 herunterladen, in einen Pfad ohne Leerzeichen installieren, z. B. C:\libraries\BWAPI_440

  3. Umgebungsvariable BWAPI_DIR = C:\libraries\BWAPI_440 setzen

  4. Den Inhalt von StarCraft\ und Windows\ aus dem BWAPI-Installationsverzeichnis in das StarCraft-Verzeichnis kopieren

2. BWAPI-Bibliothek kompilieren (beim ersten Mal erforderlich)

Die .lib-Dateien von BWAPI 4.4.0 müssen mit VS2022 kompiliert werden:

$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. Bridge kompilieren

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

Ausgabe: cpp\build\Release\bwapi_bridge.exe

4. bwapi.ini konfigurieren

Stelle sicher, dass bwapi-data\bwapi.ini im StarCraft-Verzeichnis Folgendes enthält:

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

Verwendung

Startreihenfolge (wichtig!)

  1. Chaoslauncher als Administrator ausführen → „BWAPI Injector 4.4.0 [RELEASE]" aktivieren → noch nicht auf Start klicken

  2. Bridge starten: scripts\run_bridge.bat (wartet auf den BWAPI-Server)

  3. In Chaoslauncher auf Start klicken → StarCraft öffnen → Single Player → Expansion → Play Custom → Karte wählen → Starten

  4. Sobald das Spiel läuft, verbindet sich die Bridge automatisch und sendet den Status

MCP-Client konfigurieren

In der MCP-Konfiguration von Trae Folgendes hinzufügen:

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

Trae neu starten; dann können die Tools aufgerufen werden.

MCP-Tools

Tool

Parameter

Funktion

get_game_state

Keine

Liest den Spielstatus (Mineralien/Gas/Versorgung/alle Einheiten)

train

unit_type

Trainiert eine Einheit (z. B. Zerg_Drone)

build

worker_id, building_type, tile_x, tile_y

Baut ein Gebäude (findet automatisch eine bebaubare Position)

move

unit_id, x, y

Bewegt eine Einheit zu Pixelkoordinaten

attack

unit_id, target_id

Greift eine Zieleinheit an

gather

worker_id, resource_id

Sammelt Mineralien/Gas

stop

unit_id

Stoppt die aktuelle Aktion

hold

unit_id

Hält die Position

chat

text

Sendet eine Nachricht im Spiel

Fehlerbehebung

  • Bridge bleibt bei „Game table mapping not found" hängen: StarCraft ist nicht gestartet – das Warten ist normal

  • Bridge kann keine Verbindung zur Pipe herstellen: Spiel beenden und neu starten (die Bridge wurde zuvor gewaltsam beendet; das connected-Flag von BWAPI hängt fest)

  • build schlägt fehl: Die Bridge verwendet getBuildLocation, um automatisch eine Position zu finden. Stelle sicher, dass sich im Creep-Bereich freies Gelände befindet

  • 0 FPS: Die Hardware reicht nicht aus; auf 1v1 umstellen und im Spiel F5 drücken, um die Geschwindigkeit zu reduzieren

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