Skip to main content
Glama

sc-bwapi-mcp

MCP (Model Context Protocol) を介して AI アシスタント (Trae/Claude など) が StarCraft 1 の BWAPI ブリッジを操作できるようにします。

アーキテクチャ

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

前提条件

コンポーネント

バージョン

説明

StarCraft

1.16.1

通常版 (リマスター版ではない)。Battle.net クライアントから Anthology を無料ダウンロード

BWAPI

4.4.0

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

Visual Studio

2022 Community

インストール時に「C++ によるデスクトップ開発」にチェックを入れる

uv

0.12+

Python パッケージマネージャー https://astral.sh/uv

Chaoslauncher

(BWAPI 付属)

BWAPI.dll を StarCraft プロセスに注入する

インストール手順

1. StarCraft 1 + BWAPI をインストール

  1. Battle.net クライアントから StarCraft Anthology (無料) をダウンロードし、スペースを含まないパス (例: C:\Games\Starcraft) にインストールする

  2. BWAPI 4.4.0 をダウンロードし、スペースを含まないパス (例: C:\libraries\BWAPI_440) にインストールする

  3. 環境変数 BWAPI_DIRC:\libraries\BWAPI_440 に設定する

  4. BWAPI のインストールディレクトリにある StarCraft\Windows\ の内容を StarCraft ディレクトリにコピーする

2. BWAPI ライブラリをコンパイルする (初回必須)

BWAPI 4.4.0 の .lib ファイルは 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. bridge をコンパイルする

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

出力: cpp\build\Release\bwapi_bridge.exe

4. bwapi.ini を設定する

StarCraft ディレクトリの bwapi-data\bwapi.ini で次を確認:

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

使用方法

起動順序 (重要!)

  1. 管理者として Chaoslauncher を実行 → 「BWAPI Injector 4.4.0 [RELEASE]」にチェック → Start はまだクリックしない

  2. bridge を起動: scripts\run_bridge.bat (BWAPI サーバーを待機します)

  3. Chaoslauncher で Start をクリック → StarCraft に入る → Single Player → Expansion → Play Custom → マップを選択 → 開始

  4. ゲーム画面に入ると、bridge が自動的に接続し、状態をプッシュします

MCP クライアントを設定する

Trae の MCP 設定に以下を追加:

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

Trae を再起動すると、ツールを呼び出せます。

MCP ツール

ツール

パラメータ

説明

get_game_state

なし

ゲーム状態を読み取る (鉱物/ガス/サプライ/全ユニット)

train

unit_type

ユニットを訓練する (例: Zerg_Drone)

build

worker_id, building_type, tile_x, tile_y

建物を建設する (建設可能な位置を自動検索)

move

unit_id, x, y

ユニットをピクセル座標へ移動

attack

unit_id, target_id

対象ユニットを攻撃

gather

worker_id, resource_id

鉱物/ガスを採集

stop

unit_id

現在の行動を停止

hold

unit_id

その場で待機

chat

text

ゲーム内でメッセージを送信

トラブルシューティング

  • bridge が「Game table mapping not found」で止まる: StarCraft が起動していないだけ。通常の待機状態です

  • bridge がパイプに接続できない: ゲームを一度終了して再度入り直す (以前に bridge が強制終了され、BWAPI の connected フラグが固まった状態)

  • build が失敗する: bridge は getBuildLocation で位置を自動検索します。creep 範囲内に空きスペースがあることを確認してください

  • 0 FPS: PC の性能が足りない。1v1 に変更し、ゲーム内で F5 を押して速度を下げる

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