
flox-mcp
OfficialGrounded access to the FLOX trading framework surface for AI coding agents.
Add to your client
Copy the config for your MCP client and paste it into its config file.
pip install flox-mcpPaste into ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"flox-mcp": {
"command": "flox-mcp",
"args": [
"serve"
],
"env": {
"FLOX_RUNTIME_STATE": "$HOME/.flox/runtime.json"
}
}
}
}Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf
Before you start
- Python 3.10+
- An MCP client that reads a project-local .mcp.json (Claude Code, Cursor, or Cline)
- flox-py installed for compute_indicator (pip install "flox-mcp[flox]")
- A running paper/live engine plus FLOX_CONTROL_URL and FLOX_CONTROL_TOKEN for tier-5/6 live-state tools
About flox-mcp
flox-mcp is the AI companion server for the FLOX trading framework. It exposes the framework's real surface — C-API functions, indicator signatures, event structs, cross-binding symbol maps, error catalog, code examples, and docs — to AI coding agents so they can author and validate FLOX strategies grounded in actual signatures. It also includes strategy scaffolders, a keyword indicator recommender, an in-process indicator runner, and a sandboxed Python backtest runner. The server is local-only and communicates over stdio; the IDE spawns it as a child process.
Tools & capabilities (13)
list_indicatorsList every indicator in flox_py with class signature, batch fn (if any), and shape. Filter by substring.
lookup_error_codeResolve a FLOX error code (e.g. E_SYM_001) to its full Markdown page with fix recipe, common causes, and diagnostics.
list_capi_functionsSearch the FLOX C-API surface from the committed ABI snapshot. Returns name + return type + parameter types.
validate_strategyStatic-analysis check on Python strategy code: AST parses, expected hooks present, no eval/exec.
explain_eventDescribe the fields of a FLOX event struct (FloxTradeData, FloxBookData, FloxBarData, FloxSymbolContext, FloxSignal). Accepts a struct name or a raw event dict.
lookup_symbolTake any binding-local spelling (FloxBarData, BarData, flox_indicator_ema, ema) and return what the symbol is called in C-API, Python, Node, and Codon.
list_bindingsEnumerate the exports of one binding (capi, python, node, codon, quickjs). Substring filter and limit.
get_exampleReturn code from docs/examples/ matching a topic (strategy, connector, indicator, event-handler, risk, backtest), optionally filtered by language.
scaffold_strategyGenerate a starter strategy class for Python or Node in three kinds: bar-driven, trade-driven, or hybrid. Output is validated (ast.parse + validate_strategy for Python, node --check for Node).
docs_searchTop-k FTS5 full-text search over the FLOX docs. The index is built from an allowlist of doc roots; private trackers and CLAUDE.md are excluded.
run_backtestRun a Python strategy against a CSV dataset in a sandboxed subprocess that caps CPU, memory, and output size with a wall-clock timeout. MVP sandbox — does not isolate filesystem or network.
compute_indicatorRun one FLOX indicator over a list of floats. Accepts class-form (EMA) or function-form (ema) names and forwards extra kwargs to the constructor. Input capped at 1 MiB. Needs flox-py installed.
suggest_indicatorMap an English description ('trend filter', 'momentum oscillator', 'volatility band', 'mean revert', 'regime test') to a ranked shortlist of FLOX indicators via a keyword heuristic (no LLM call).
What this server can do
flox-mcp provides tools for these capabilities — tap one to see every MCP server that does the same:
When to use it
- Let an AI coding agent write FLOX strategies against real C-API and binding signatures instead of hallucinating APIs
- Scaffold and statically validate bar-driven, trade-driven, or hybrid strategy classes in Python or Node
- Look up indicator signatures, event struct fields, error codes, and cross-binding symbol names while coding
- Full-text search the FLOX documentation from inside the IDE
- Run indicators over sample data and backtest strategies against a CSV dataset in a resource-limited sandbox
Security notes
Runs locally over stdio; makes no network calls. Most tools are read-only lookups. `run_backtest` is an MVP sandbox that caps CPU, memory, and output size but does NOT isolate filesystem or network — treat strategy code as untrusted and wrap with nsjail / firejail / Docker for any deployment that takes untrusted input. Tier-5/6 live tools (`place_order`, `flatten_positions`) require a separately started paper/live engine and a control token (`FLOX_CONTROL_URL` / `FLOX_CONTROL_TOKEN`).
flox-mcp FAQ
Does the server make network calls or send data anywhere?
No. The server is local-only: the AI client spawns it as a child process and talks to it over stdio. It makes no network calls and nothing leaves the machine.
How do I configure it?
Run `pip install flox-mcp` then `flox-mcp init`, which writes a project-local `.mcp.json` (use `--global` for the client-wide path). Restart your MCP client. You can also hand-edit the `mcpServers.flox` entry shown in the README.
Is run_backtest safe for untrusted code?
It is an MVP sandbox that caps CPU, memory, output size, and wall-clock time, but it does NOT isolate the filesystem or network. Treat strategy code as untrusted Python and wrap it with nsjail / firejail / Docker for any deployment that accepts untrusted input.
How do the live-trading tools work?
Read tools work out of the box. For tier-5/6 tools (live state, place_order, flatten_positions) you also start a paper engine with `flox engine sim`, then rerun `flox-mcp init --engine-url URL --token T` to append FLOX_CONTROL_URL and FLOX_CONTROL_TOKEN to the config.
Alternatives to flox-mcp
Compare all alternatives →Microsoft's official browser-automation MCP using Playwright's accessibility tree (no vision model).
Up-to-date, version-specific library documentation injected into your coding agent.
LSP-powered coding agent toolkit: semantic symbol search, references and structural edits.
Compare flox-mcp with: