Connect your agent to Lightwick.
Research strategies against your captured market data—without giving your agent access to live trading.
Research only. Lightwick MCP cannot place orders, activate a strategy, or access live-trading state.
Connect over stdio
Lightwick MCP is a local JSON-RPC server. Your client launches the executable and communicates over standard input and output; no port, cloud service, or broker credential is exposed.
Packaged builds should point at their bundled lightwick-mcp executable. When developing from source, build it with Swift and use the resulting absolute path.
swift build --product lightwick-mcp
./.build/debug/lightwick-mcp{
"mcpServers": {
"lightwick": {
"command": "/absolute/path/to/lightwick-mcp"
}
}
}Restart or reload your MCP client, then ask it to call list_series. If the tool appears and returns a structured response, the connection is ready.
Your first research session
A productive session moves from data quality to behavior, then from fitted results to evidence the strategy has not seen.
- 1
List captured series
list_seriesFind the symbol and timeframe combinations that are actually available.
- 2
Inspect bar quality
get_barsCheck coverage, session gaps, price scale, and whether data was resampled.
- 3
Create and validate
create_strategy · validate_strategyCompile before saving and keep diagnostics in the loop while revising.
- 4
Evaluate signals
evaluateSee whether conditions transition, plots warm up, and risk expressions resolve.
- 5
Backtest
backtestUse the correct point value, tick size, sizing mode, costs, and slippage.
- 6
Optimize with holdout
optimizeCompare in-sample and withheld results; prefer a stable plateau over an isolated peak.
- 7
Start a forward test
start_forward_testRecord the idea before new data arrives.
Using Lightwick:
1. List the captured market-data series.
2. Inspect ES m5 coverage and its largest gap.
3. Create and validate a simple trend strategy.
4. Evaluate every signal before backtesting it.
5. Backtest with ES pointValue 50 and tickSize 0.25.
6. Optimize with the default 30% holdout and report stability.
7. Start a forward test only if the out-of-sample result holds up.All 21 MCP tools
Tools are grouped by the job they perform. In normal use, let the agent select them; this reference is for understanding its actions and giving precise instructions.
Strategy library
Read and change the same saved-strategy library the Mac app uses.
list_strategiesList saved strategy metadata without loading source.
get_strategyRead a saved strategy and its complete .mtrade source by ID or exact name.
create_strategyCompile and save a new strategy.Nothing is saved when compilation fails.
update_strategyChange metadata or source by strategy ID.New source must compile before the update is written.
delete_strategyDelete a saved strategy by ID.
validate_strategyCompile arbitrary source and return stable diagnostics without saving it.
format_strategyReturn canonically formatted source, preserving comments.
Language help
Give the agent the grammar and semantics it needs before it authors code.
get_language_guideReturn the full Lightwick Script guide.
get_grammarReturn EBNF, the language version, risk fields, and signal kinds.
list_builtinsList callable functions and zero-argument values, optionally filtered by category.
Market data
Discover and inspect completed OHLCV bars already held by Lightwick.
list_seriesList captured symbol/timeframe pairs with bar counts and coverage.
get_barsRead up to 500 recent bars and report the largest observed gap.
request_backfillQueue an asynchronous history request for the running app.
list_backfill_requestsInspect pending, in-progress, fulfilled, failed, or rejected backfills.
Research
Run the deterministic strategy engine over captured completed bars.
evaluateReturn every signal, plot coverage, resolved risk rule, and diagnostic.Use this before backtest when behavior is surprising.
backtestSimulate next-bar fills with instrument sizing, costs, slippage, and risk exits.
optimizeGrid-search inputs with a 30% holdout by default and report neighbor stability.
Forward tests
Freeze an idea before future bars exist, then compare fitted and truly later performance.
start_forward_testFreeze source, inputs, instrument configuration, and the current-time boundary.
list_forward_testsList registered observations and their identifiers.
get_forward_testCompare pre-boundary fit with bars and trades observed afterward.
delete_forward_testRemove a forward-test journal entry.
How market data reaches MCP
MCP does not connect to Rithmic. It reads the completed OHLCV bar store that Lightwick maintains on disk.
- Lightwick loads a series.History and each newly completed bar are persisted by the app.
- MCP reads the shared store.
list_series,get_bars, and the research tools use those completed bars. - Missing intraday series may be resampled.The response includes a
dataNote; daily and weekly series are never synthesized this way. - Backfill stays app-owned.
request_backfillwrites a bounded queue entry. Nothing is fetched while Lightwick is closed or disconnected.
get_bars reports the expected bar interval and the largest observed gap. A backtest can be mathematically correct over incomplete data and still support the wrong conclusion.
The research boundary
The server is intentionally useful on one side of a hard line and powerless on the other.
MCP can
- Read and change saved strategies
- Validate and format arbitrary source
- Read captured completed bars
- Backtest and optimize when entitled
- Register forward tests
MCP cannot
- Place, modify, or cancel orders
- Activate a strategy in live trading
- Read broker credentials
- Reach the network or filesystem from a script
- Turn advisory signals into execution
Authoring and validation remain available without Lightwick Pro. backtest and optimize require an active entitlement.
Troubleshooting
The server does not appear in my client
Use an absolute executable path, verify the file can run on your Mac, then restart the client. Protocol messages use stdout; server logs use stderr.
list_series is empty
Open the desired symbol and timeframe in Lightwick while connected, or queue request_backfill. The MCP server does not fetch from the broker itself.
A compiling strategy produces no signals
Call evaluate. Signals require an exact false-to-true transition; missing warm-up values cannot fire and a condition already true on the first evaluated bar never transitions.
Futures profit is scaled incorrectly
Set the instrument configuration explicitly. ES normally uses pointValue: 50 and tickSize: 0.25; leaving point value at 1 scales every profit figure incorrectly.
Backtest or optimize says Lightwick Pro is required
Open Lightwick and sign in with an active subscription. Strategy authoring, language help, validation, formatting, data inspection, and evaluation do not cross that research entitlement gate.