Using GSB with Claude (MCP)
Let Claude start GSB builds, follow their progress and explain the results, using GSB's own command line
MCP (Model Context Protocol) is the standard way to give an AI assistant like Claude tools on your own computer. GSB already has command-line options for running settings files and macros unattended, so a small MCP server can let Claude drive them: you ask in plain English, and Claude starts the build, checks on it and reads the statistics when it finishes.
It complements macros and GSB Automation: the macro still does the work inside GSB, and Claude starts it and explains what came out. Tested with GSB 77.52 (September 2026) and the Claude desktop app for Windows.
- It only starts
GSBManagerwith the options below and reads files inside your GSB folder. - It never touches licence files, never closes GSB, never changes your settings files and never places a trade.
- It runs one GSB job at a time, because GSB rewrites its
Contracts.txtandPrice Data.txtwhen it starts. - Claude explains results; it doesn't decide what you trade. Backtest and walk-forward results are hypothetical.
1. GSB's command-line options
Run GSBManager.<version>.exe /? in a Command Prompt in your GSB folder to see them. In build 77.52 they are:
| Option | What it does |
|---|---|
| /run | Start building systems as soon as GSB opens. Can't be used with /macro. |
| /macro <file> | Load and run a macro (.gsbmacro) as soon as GSB opens. Can't be used with /run. |
| /wfsystems <folder> | Load the systems in a folder and walk them forward. |
| /appsettings <file> | Load an application settings file (.gsbappset). |
| /optsettings <file> | Load an optimisation settings file (.gsboptset). |
| /autoexit | Close GSB when the batch job is done. |
| /favb | Don't close automatically if favourites B has more than a set number of systems. |
| /header, /headerappend | Set or add to the text in GSB's title bar, handy for telling runs apart. |
| /maxus | Maximum number of unique systems. |
| /maxworkers | Maximum number of workers. |
| /min, /tiled | Run minimised, or in tiled mode. |
| /color | Icon colour. |
A typical unattended run, which builds with a saved settings file, runs a macro and closes when done:
"C:\GSB\GSBManager.77.520.exe" /optsettings CL30-AdvancedModeOff /macro m3_build+stats /autoexit /maxus 1000 /header "Test run"Three things make this usable from Claude:
- Progress is logged. GSB writes every macro step, with a timestamp, to
Logs\Manager\<date>\GSB-Manager-<process id>-….jsonl: one line per event, including warnings, errors and, at the end, Application shutdown requested (Reason=ApplicationExitCall) when /autoexit closed it normally. - Results land in a known place. A macro's ExportStats step writes
Data\Exports\Statistics\<settings file name>.csv. - Workers come from Resource Manager. Start at least one worker first, or the build waits at StartBuildingSystems.
2. Set up the ready-made server (about 10 minutes)
You need a Windows PC with GSB, GSB Resource Manager and the Claude desktop app.
- Install Python 3.12 or later from python.org. On the first installer screen tick Add python.exe to PATH.
- Install the MCP library. In PowerShell run
pip install mcp. - Download the server and save it as
C:\GSB-MCP\gsb_mcp.py. Check Windows hasn't added.txtto the name. If its Properties show an Unblock box, tick it.
- Tell Claude about it. Close Claude, then paste this into PowerShell as one line. It adds the server to Claude's settings file, keeps everything else in it, saves a backup and uses your Python's full path:
$py = (Get-Command python -All | Where-Object Source -notmatch "WindowsApps" | Select-Object -First 1).Source; $f = "$env:APPDATA\Claude\claude_desktop_config.json"; if (Test-Path $f) { Copy-Item $f "$f.bak" -Force; $c = Get-Content $f -Raw | ConvertFrom-Json } else { $c = [pscustomobject]@{} }; $gsb = [pscustomobject]@{ command = $py; args = @("C:\GSB-MCP\gsb_mcp.py"); env = [pscustomobject]@{ GSB_DIR = "C:\GSB" } }; if ($c.PSObject.Properties.Name -contains "mcpServers") { $c.mcpServers | Add-Member -NotePropertyName gsb -NotePropertyValue $gsb -Force } else { $c | Add-Member -NotePropertyName mcpServers -NotePropertyValue ([pscustomobject]@{ gsb = $gsb }) }; [IO.File]::WriteAllText($f, ($c | ConvertTo-Json -Depth 50)); "Python: $py"; "has gsb: " + [bool](Select-String -Path $f -Pattern '"gsb"' -Quiet)It should finish with has gsb: True. If you'd rather edit the file by hand, it's %APPDATA%\Claude\claude_desktop_config.json (Settings → Developer → Edit Config opens its folder), and it needs this mcpServers section next to anything already there:
{
"mcpServers": {
"gsb": {
"command": "python",
"args": ["C:\\GSB-MCP\\gsb_mcp.py"],
"env": { "GSB_DIR": "C:\\GSB" }
}
}
}- Restart Claude fully: right-click its icon by the clock and choose Quit, then open it again. Under Settings → Developer, gsb should show as running. It won't appear under Connectors: those are online services.
3. Using it
Start Resource Manager and a worker, open a new chat, and ask:
- "What GSB settings files and macros do I have?"
- "Run a build on CL30-AdvancedModeOff with macro m3_build+stats, limited to 1,000 systems."
- "How's the GSB build going?"
- "Read the stats from that run and explain them."
The first time Claude uses each tool it asks your permission. The server gives Claude these tools:
| Tool | What it does |
|---|---|
| gsb_overview | Your GSB version, whether GSB is running, and your settings files, macros and app settings |
| gsb_start_build | Starts GSB with a settings file and a macro (or /run), always with /autoexit and /min |
| gsb_start_walk_forward | Walks forward every system in a folder (/wfsystems) |
| gsb_job_status | Macro steps done, the step running now, warnings and errors, and whether GSB closed cleanly |
| gsb_read_stats | Reads the statistics a macro's ExportStats step wrote |
| gsb_recent_exports, gsb_read_export | Lists and reads other files GSB exported |
4. If it doesn't work
- gsb isn't listed under Settings → Developer: Claude isn't reading your change. Run the PowerShell command again and check it prints
has gsb: True, then quit Claude from the tray (closing the window isn't enough). - gsb shows "failed": usually Python or the mcp library. In PowerShell,
python --versionandpython -c "import mcp"should both work. Claude's log is in%APPDATA%\Claude\logs. - The build sits at StartBuildingSystems: no workers are running. Start one in Resource Manager.
- "GSB is already running": close the open GSB first. The server won't start a second one.
- The stats averages are all 0: the macro's favourites step found no systems, often because the macro's dates don't suit your data. Check the macro's dates against your price data.
5. Building your own
The ready-made server is one Python file, and you can change it or ask Claude to. Each tool is a Python function with a short description; Claude reads the description to decide when to use it. A simplified version of the build tool:
@server.tool()
def gsb_start_build(optimization_settings: str, macro: str | None = None) -> dict:
"""Start a GSB build with a settings file and a macro. GSB closes itself when done."""
args = ["/optsettings", optimization_settings]
args += ["/macro", macro] if macro else ["/run"]
args += ["/autoexit", "/min"]
subprocess.Popen([str(manager_exe()), *args], cwd=GSB_DIR)
return {"started": True, "args": args}Good additions to ask Claude for, building on GSB's options:
- Run the same macro on several settings files one after another, and compare their stats.
- Pass
/maxworkersso a build leaves room for TradeStation on a trading PC. - Read the trade lists your macros export (
Data\Exports), and the EWFO and Portfolio Analyst Pro command lines (Trademaid documents both).
Keep the same rules: one GSB job at a time, read-only access to everything except starting GSB, and no licence files.
Education only, not trading advice. Results from GSB builds and walk-forwards are hypothetical and don't guarantee future performance. The MCP server is offered as is by GSB Pro; it isn't a Trademaid product.
GSB's main tools are its genetic algorithm search, its walk-forward and robustness tests and its export to TradeStation, MultiCharts and NinjaTrader. New to it? See what Genetic System Builder does and how GSB compares with StrategyQuant and Build Alpha.