Skip to main content
Glama

sc-bwapi-mcp

Puente de BWAPI que permite a asistentes de IA (como Trae/Claude) operar StarCraft 1 mediante MCP (Model Context Protocol).

Arquitectura

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

Requisitos previos

Componente

Versión

Descripción

StarCraft

1.16.1

Versión normal (no remasterizada), descargar Anthology gratis desde el cliente de Battle.net

BWAPI

4.4.0

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

Visual Studio

2022 Community

Al instalarlo, marcar "Desarrollo de escritorio con C++"

uv

0.12+

Gestor de paquetes de Python https://astral.sh/uv

Chaoslauncher

(BWAPI 自带)

Inyecta BWAPI.dll en el proceso de StarCraft

Pasos de instalación

1. Instalar StarCraft 1 + BWAPI

  1. Descargar StarCraft Anthology desde el cliente de Battle.net (gratis) e instalarlo en una ruta sin espacios, como C:\Games\Starcraft

  2. Descargar BWAPI 4.4.0 e instalarlo en una ruta sin espacios, como C:\libraries\BWAPI_440

  3. Configurar la variable de entorno BWAPI_DIR = C:\libraries\BWAPI_440

  4. Copiar el contenido de StarCraft\ y Windows\ del directorio de instalación de BWAPI al directorio de StarCraft

2. Compilar la biblioteca de BWAPI (obligatorio la primera vez)

Los archivos .lib de BWAPI 4.4.0 deben generarse compilando con 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. Compilar el bridge

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

Salida: cpp\build\Release\bwapi_bridge.exe

4. Configurar bwapi.ini

En el directorio de StarCraft, asegurar que bwapi-data\bwapi.ini contenga:

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

Instrucciones de uso

Orden de inicio (¡importante!)

  1. Ejecutar Chaoslauncher como administrador → marcar "BWAPI Injector 4.4.0 [RELEASE]" → no hacer clic en Start todavía

  2. Iniciar el bridge: scripts\run_bridge.bat (espera al servidor de BWAPI)

  3. Hacer clic en Start en Chaoslauncher → entrar en StarCraft → Single Player → Expansion → Play Custom → elegir mapa → comenzar

  4. Una vez en la pantalla del juego, el bridge se conecta automáticamente y envía el estado

Configurar el cliente MCP

Añadir en la configuración MCP de Trae:

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

Reinicia Trae y podrás usar las herramientas.

Herramientas MCP

Herramienta

Parámetros

Descripción

get_game_state

Ninguno

Leer el estado del juego (minerales/gas/suministro/todas las unidades)

train

unit_type

Entrenar una unidad (p. ej. Zerg_Drone)

build

worker_id, building_type, tile_x, tile_y

Construir un edificio (busca automáticamente una posición válida)

move

unit_id, x, y

Mover una unidad a coordenadas de píxel

attack

unit_id, target_id

Atacar a la unidad objetivo

gather

worker_id, resource_id

Recolectar minerales/gas

stop

unit_id

Detener la acción actual

hold

unit_id

Mantener la posición

chat

text

Enviar un mensaje en el juego

Solución de problemas

  • El bridge se queda en "Game table mapping not found": StarCraft no se ha iniciado; es normal que espere

  • El bridge no conecta con el pipe: sal del juego y vuelve a entrar (si el bridge fue terminado forzosamente, el indicador connected de BWAPI se queda bloqueado)

  • build falla: el bridge usa getBuildLocation para buscar automáticamente una posición; asegúrate de que haya espacio libre dentro del alcance del creep

  • 0 FPS: la computadora no es lo bastante potente; cambia a 1v1 y pulsa F5 en el juego para reducir la velocidad

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