Connect your own Claude
The chat pane's Connect to Claude button writes the claude mcp add line that registers vike-cli mcp against the datahub the Studio already dials — and what that button does in a build that left the feature off.
The copilot pane ends with a Connect to Claude button, and it is a different thing from the
copilot above it. The copilot spends your API key on a hosted
model inside the app; this button wires a Claude you already run on your machine to Vike Trader's
MCP server, so that Claude can validate scripts, run backtests and — behind a preview gate — trade,
through tools. The server is vike-cli mcp; the button only writes the command that registers it.
What the button generates
crates/vike-studio/src/connect.rs is the whole helper: server_entry builds the executable plus
its argv tail — the mcp subcommand, then --addr <host:port> when the Studio has a datahub
address to give — and claude_code_add_command renders the copy-pasteable line for Claude Code:
claude mcp add <name> -- <path-to-vike-cli> mcp --addr 127.0.0.1:7878The pane shows the result in a single-line field under the button. There is no Claude Desktop config merge: the module header records that the retired predecessor crate's JSON helper was dropped, because the Studio only ever surfaced the command. For Claude Desktop, the JSON block on Connect an agent is the same server registered by hand.
Why it carries a datahub address and not a store path
vike-cli mcp's run and list tools — run_backtest, run_sweep, run_walk_forward,
list_strategies, list_series — go over a running vike-datahub server, not an in-process store
(crates/vike-cli/src/cmd/mcp.rs's header; that is what keeps the CLI free of the query engine).
So the generated command carries the data service's address and never a history-store path.
ChatPane::connect_to_claude reads it off the Studio's
Remote backend: with Remote selected, its address rides as
--addr, so the spawned server dials the same datahub the Studio offloads to; with Local selected
no --addr is written, and the server falls back to its own default, 127.0.0.1:7878 — the same
default vike-cli's backtest verb uses.
The optional node keys, VIKE_TRADEHUB_OBSERVE_KEY and VIKE_TRADEHUB_CONTROL_KEY, are — per
server_entry's doc — the operator's process-environment concern, never something the Studio
writes into a generated command. --node, the running trading node the trade tools reach, is not
generated either; add it by hand if you want the live tools, as the guide shows. The scoping flags
are in the same position: --profile read-only (or --deny-tool NAME) goes on the generated line
by hand, and it is what withholds the order-write tools from the Claude you are wiring up rather
than merely gating them.
The executable path is a guess
connect_to_claude's doc marks it a stub: the command names the vike-cli binary as the sibling
of the running executable — right when the two ship side by side, but not a resolved install path.
Check the path before pasting.
Whether your build has it
The generator is compiled only under vike-studio's non-default mcp feature — a plain code gate
over the connect module, no extra dependency; the crate manifest and its lib.rs both say so.
Without the feature the button still exists and still responds: it writes a note into the same
field instead of a command — "MCP connect helper not compiled in — rebuild vike-studio with
--features mcp to generate the claude mcp add command that registers vike-cli mcp (needs a
running vike-datahub server)" — so the pane renders identically minus the copyable line.
The default desktop build leaves the feature off
crates/vike-desktop/Cargo.toml takes vike-studio with no features. In the app as built by default,
pressing the button produces the rebuild note. That costs you the convenience and nothing else: the
command it would have written is the one line above with your own path and address filled in, and
the guide has it ready to paste.
What you get once it is registered
vike-cli mcp is a local stdio MCP server — newline-delimited JSON-RPC, hand-rolled, no SDK. Its
tools split into read-only ones (compile-validate a script, discover its param() knobs, list the
templates and the host-bound indicators — all offline — plus the datahub-backed run and list tools
and a node snapshot) and order-writing ones behind a mandatory preview: a write executes only on a
call carrying both confirm: true and the preview_token an earlier preview of that same
command returned, and anything less previews again rather than failing — so the Claude you wired up
here cannot place an order in one call, and a confirming call with no token comes back
will_execute: false rather than as an error. If it should not be able to place one at all, add
--profile read-only to the generated line: the seven write tools then never appear in
tools/list, and are refused if called anyway. The tool-by-tool reference is
Trader tools;
the verb itself is vike-cli mcp; the service the run tools need is
vike-datahub.
The AI copilot
The Studio's chat pane sends a description to a model, compiles and backtests what comes back on held-out data, and shows a diff before anything touches the editor.
Remote runs
The Backend toggle sends a Run, Sweep or Walk-Forward to a vike-datahub server over TCP and folds the answer into the same results pane, with the one refusal the split-plane rule adds.