Windsurf · Setup
Backtest from Windsurf
Windsurf's Cascade agent supports MCP via a JSON config file. Point it at Bagtester and Cascade gets a 14-tool backtesting surface — submit, optimize, walk-forward, compare, manage subscription.
Setup
1
Get an API key
Sign up at bagtester.com/sign-up. Create a key with the bag_ prefix.
2
Edit your Windsurf MCP config
Open ~/.codeium/windsurf/mcp_config.json (create it if it doesn't exist) and add:
json
{
"mcpServers": {
"bagtester": {
"serverUrl": "https://bagtester.com/api/mcp",
"headers": {
"Authorization": "Bearer bag_YOUR_KEY_HERE"
}
}
}
}3
Restart Windsurf and verify
After restart, open Cascade and ask:
prompt
list bagtester tools
Cascade should enumerate all 14 tools — including submit_strategy, optimize_strategy, and manage_subscription.
4
Run a backtest
prompt
backtest a Donchian channel breakout (entry=55, exit=20) on EURUSD for 2023-2024 with hybrid mode
Cascade writes the strategy, calls submit_strategy, and shows the structured result.
Tips for Windsurf specifically
- Config file location. Windsurf reads from
~/.codeium/windsurf/mcp_config.json. If you don't see the tools after restart, double-check the path — older Windsurf builds used a slightly different location. - Tool approval per session. Cascade prompts before each new MCP tool call. Approve once per tool to streamline the rest of the session.
- Long sweeps return async. If a parameter sweep is estimated >200s, the tool returns immediately with
status: "running"and ajob_id. Ask Cascade "is the sweep done?" and it pollsget_backtest_results.
Connect Cascade
Free tier: 500 credits/month. One JSON block, one restart.