Cursor
The command + args entry in mcp.json, global or per project, and why the node keys belong in the credential store rather than this file.
Add the server
Either Settings → MCP → Add new server, or edit the config file directly.
Global, at ~/.cursor/mcp.json — available in every project:
{
"mcpServers": {
"vike-trader": {
"command": "vike-cli",
"args": ["mcp", "--node", "127.0.0.1:7879"]
}
}
}Per project, at .cursor/mcp.json in the repository root — same shape, scoped to that project.
command + args is the local shape, and it is the only one that works here: vike-cli mcp is
a subprocess Cursor starts and speaks stdio to, and it has no URL at all. (A url + headers entry
is the remote shape, which is what the data server uses.)
Scoping what the tools reach
Both vike-cli mcp flags are optional. --node <host:port> is the running vike-tradehub the live
tools observe and control — no default, so without it node_snapshot returns a clean error naming
the flag before any socket is opened. A write tool is quieter: it previews unless a call carries
both confirm: true and the preview_token its preview returned, and with no node
configured that preview contacts nothing — so a preview is no evidence the flag arrived; a node
snapshot is. --addr <host:port> is the vike-datahub the backtest tools ship profiles to,
defaulting to 127.0.0.1:7878.
With neither, the offline tools — validate_strategy, discover_params, list_templates,
list_indicators — still work, which makes a flag-less entry a reasonable first step:
{
"mcpServers": {
"vike-trader": { "command": "vike-cli", "args": ["mcp"] }
}
}If Cursor reports the binary as not found, give command an absolute path: an editor launched from
the desktop does not inherit the PATH your shell exports.
The node keys
For the same reason, keep VIKE_TRADEHUB_OBSERVE_KEY and VIKE_TRADEHUB_CONTROL_KEY in the
credential store — <project>/settings/secrets.env, the same file the vike-tradehub daemon reads.
vike-cli looks in the process environment first and the store second, and a desktop-launched
child process sees none of your terminal's exports, so the store is the source that actually
reaches it. That lookup order is crates/vike-cli/src/cmd/nodekeys.rs's resolve.
That is also the safer default for a per-project .cursor/mcp.json, which sits inside the
repository: nothing secret ends up in a file that is one git add away from being committed. A
committed control key is the expensive kind — it places orders.
vike-cli secrets path prints which store a directory resolves to; vike-cli secrets list shows
whether the key is in it, by name.
After editing
Reload Cursor, or toggle the server off and on in the MCP pane. The settings pane shows each
server's status and the tools it exposes — a healthy vike-trader lists 17.
Verify
list the vike strategy templates
list_templates is offline: no key, no node, no network. If it answers, the subprocess is running
and the protocol is working, and anything still failing is an address or a key. With a node
configured, "show me the node snapshot" proves the observe key too.
Troubleshooting
The server shows as failed. Almost always the JSON: a trailing comma, or a key nested in the
wrong object. command and args are siblings inside the server's own object.
It is green but tools are never called. Cursor decides per request whether to use a tool. Name
it — "use the list_templates tool" — to confirm the wiring before trusting the model to reach for
it on its own.
A project config and a global config both exist. Keep the server in one of them. Two entries of
the same name pointing at different --node addresses means the tool you are watching may not be
the node you are watching.
The offline tools work and the node tools do not. That is an address or a key, not the MCP
wiring — the two failures are worded differently on purpose. "no vike-tradehub node configured"
means --node never arrived; "set neither in the process environment nor in the credential store"
names a key, and names both places it looked.
The data server too
Cursor holds both Vike servers in the same mcpServers object — the hosted data server
as a url + headers entry beside this one. Data client setup → Cursor
has its shape. The names must differ: a second vike replaces the first.