AI Integration
Connect FMZ to an AI coding assistant (AI agent) such as Claude Code, Codex or Cursor, and you can write strategies, run backtests, create and manage live trading, and read logs and profit just by talking to it. The assistant reaches these functions through the platform's MCP (Model Context Protocol) service, with an API KEY created for it alone; you choose its permissions when you approve it and can change or revoke them at any time.
Connect with one sentence
Tell your AI assistant:
Read https://www.fmz.com/agent/setup.md and connect to FMZ
The assistant follows that page; your only step is one click in the browser:
- The assistant requests authorization and shows you a link such as
https://www.fmz.com/agent/authorize?code=XXXX-XXXX, valid for 10 minutes. - Open it in a browser where you are logged in to FMZ, check the requester's name and the permissions, and approve. You can untick permissions you do not want to grant.
- The assistant receives an API KEY, writes it into its own MCP configuration and connects. From then on you can simply ask it to "list my live trading" or "backtest this strategy".
The assistant names the key "name @ machine" (for example Claude Code @ MacBook). When a request with the same name is approved again, the old key is revoked and replaced, so connecting again does not pile up keys.
Permissions
| Permission | Allows | Default |
|---|---|---|
| read | Lists and details of strategies, live trading, nodes and exchange accounts; logs, messages, account summary (never any secret) | Yes |
| backtest | Start, query and stop backtests | Yes |
| write | Save strategies and versions, groups, alert switches; change the configuration of stopped live trading | Yes |
| trade | Create, start and stop live trading, send interactive commands (costs balance and places real orders) | Yes |
| danger | Delete strategies, live trading and nodes; publish strategies | No |
danger is never granted by default: the assistant has to request it explicitly and you have to tick it on the approval page. Before calling a [trade] or [danger] tool the assistant should ask you first.
Manual configuration
Clients that cannot run commands (for example Cherry Studio) can be configured by hand:
- Create an API KEY under Account settings → API KEY (
https://www.fmz.com/m/account#apikey) and note its Access Key and Secret Key. - Add an MCP server of type Streamable HTTP to the client:
- URL:
https://www.fmz.com/api/mcp/<Access Key> - Header:
Authorization: Bearer <Secret Key>
- URL:
The Secret Key goes in the header only, never in the URL. Examples:
bash
# Claude Code
claude mcp add --transport http fmz "https://www.fmz.com/api/mcp/<Access Key>" --header "Authorization: Bearer <Secret Key>"
json
{"mcpServers": {"fmz": {"url": "https://www.fmz.com/api/mcp/<Access Key>", "headers": {"Authorization": "Bearer <Secret Key>"}}}}
The JSON is for Cursor (~/.cursor/mcp.json) and other clients that speak Streamable HTTP; Claude Desktop needs the npx mcp-remote bridge described in the setup page.
Install the skills (recommended)
The skills are knowledge packs written for AI assistants: platform workflow, the full API reference, how to write strategies in each language, backtesting and indicators. With them installed the assistant writes noticeably more accurate strategies. In a terminal:
bash
npx skills add fmzquant/skills --global --yes -a claude-code
Put your assistant's name after -a (claude-code, codex, cursor, gemini-cli, ...). They can also be read on GitHub: https://github.com/fmzquant/skills.
Available tools
Once connected the assistant can use the tools below; the list the assistant sees is authoritative:
| Permission | Tools |
|---|---|
| read | ping, get_account_summary, list_exchanges, list_platforms, list_nodes, list_strategies, get_strategy, list_strategy_versions, get_strategy_version, list_robots, get_robot, get_robot_logs, get_robot_profit, get_robot_output, list_messages, list_groups, revoke_my_key |
| backtest | run_backtest, get_backtest, list_backtests, stop_backtest |
| write | check_strategy, save_strategy, save_strategy_version, delete_strategy_version, update_robot, save_group, move_to_group, delete_group, set_robot_alert, set_node_alert, delete_messages |
| trade | create_robot, start_robot, stop_robot, restart_robot, send_robot_command, and the trading terminal plugin tools plugin_* (market data, orders, ...) |
| danger | delete_strategy, delete_robot, delete_node, publish_strategy |
A typical session: list_platforms and list_nodes to see which exchange accounts and nodes the account has; save_strategy to save a strategy and check_strategy to check it; run_backtest and get_backtest to backtest; then create_robot to go live and get_robot / get_robot_logs to watch it.
Security and management
- Exchange API KEYs never pass through the assistant: add them on the Exchanges page of the website and the assistant picks them by id. No tool result ever contains a secret.
- At
https://www.fmz.com/m/account#apikeyyou can see the key the assistant uses, change its permissions or lock it. Besides the permission names above, permissions can list tool names, and!tool_nameexcludes one tool. - When you are done, ask the assistant to call
revoke_my_keyto revoke its own key, or delete it on that page. stop_robotstops live trading; it does not close positions.- The first time the assistant creates live trading, backtest first and then run on a demo account or with a small amount.
Common problems
- No online node: live trading needs at least one online node, see Platform Basics → Nodes.
- Too many backtests: concurrent backtests are limited; have the assistant
stop_backtestthe ones it no longer needs. - The assistant says a tool is missing or a call is refused: the key lacks that permission; change it on the API KEY page and reconnect.
The same API KEY also works with the Extended API (Integrations → Extended API Interface) for scripts and schedulers; prefer MCP wherever it can be used.