Skip to content

MCP and agent integration

Cortiq ships an MCP server that exposes its sessions, market data, entity authoring, and trade execution as tools an external AI client can call. This page covers when to use it, how to wire up a client like Claude Desktop, the tool families on offer, and the single approval gate that stands between an agent and a real order.

The Cortiq MCP server lets an MCP-compatible AI client use Cortiq as an execution and market-data system. Instead of relying on Cortiq’s built-in trading loop, an external agent reads Cortiq data, gathers fresh market context, authors entities, and places trades through tool calls.

The server runs as a local process over stdio. Your client starts it and shares the same local SQLite database as the Cortiq desktop app. This is a local-machine integration model, not a cloud API — nothing leaves your machine except the calls your AI client already makes to its own provider.

Use this mode when you want an agent such as Claude Desktop, Claude Code, or Codex to drive the workflow directly: inspect sessions and trades, gather data on demand, run External MCP sessions, and execute or manage positions through Cortiq’s MT5 path.

Use MCP integration when you want:

  • An MCP-compatible AI client to drive the trading workflow through tool calls.
  • Fine-grained control over when analysis happens and when trading happens.
  • Tool-based inspection of accounts, sessions, risk, and statistics before any execution.
  • An agent that authors Cortiq entities (playbooks, data packages, preparation, research) for you.

If you want the simpler product path, use autonomous sessions instead — Cortiq’s own engine runs the loop and you don’t connect an external client.

ModeWho controls the loopBest for
Autonomous sessionCortiq’s internal workflow engineMost users who want a built-in operating loop.
External MCP sessionAn external MCP-compatible AI clientAdvanced users who want agent-driven control through tool calls.

The difference that matters: an External MCP session does not run the internal workflow engine. The external agent decides what to do next and calls the right tools. Cortiq still validates risk and still gates trade execution.

Before connecting an agent to the Cortiq MCP server, confirm:

  • Cortiq is installed and its local database exists.
  • The Cortiq desktop app is running when you expect live trading actions to execute.
  • MetaTrader 5 is installed and at least one MT5 account is configured in Cortiq, if you intend to trade.
  • A data package exists for any session that needs market-data gathering.
  • Risk settings are configured before any live execution.
  • A valid license is active — any MT5-bound session start requires it. Backtests are the only license-free path.

The MCP server uses stdio transport. Your AI client starts the server as a local process and calls tools over that connection. The server reads and writes the same SQLite database as the desktop app, so an agent’s changes appear in the app immediately and approvals round-trip back to the dock.

On Windows, the Claude Desktop config file is usually at:

%APPDATA%\Claude\claude_desktop_config.json

Point it at a compiled Cortiq MCP server executable:

{
"mcpServers": {
"cortiq": {
"command": "C:\\Path\\To\\Cortiq.McpServer.exe"
}
}
}

Or run it from source with dotnet run:

{
"mcpServers": {
"cortiq": {
"command": "dotnet",
"args": [
"run",
"--project",
"C:\\Path\\To\\Cortiq.McpServer"
]
}
}
}

If automatic database discovery fails, set CORTIQ_DB_PATH explicitly so the server and the app share one database:

{
"mcpServers": {
"cortiq": {
"command": "C:\\Path\\To\\Cortiq.McpServer.exe",
"env": {
"CORTIQ_DB_PATH": "C:\\Path\\To\\cortiq.db"
}
}
}
}

Claude Code and Codex read MCP servers from their own configuration (Claude Code’s .mcp.json / ~/.claude.json, Codex’s config). Register the same cortiq server entry — command, args, and the optional CORTIQ_DB_PATH env — using each tool’s MCP configuration mechanism. The launch command is identical; only the file that holds it differs.

  1. The agent connects to the Cortiq MCP server.
  2. It discovers accounts, sessions, and data packages.
  3. It creates or updates an External MCP session with create_external_session.
  4. It starts the session with start_session.
  5. It gathers market data with the session’s data package.
  6. It decides whether to trade.
  7. It executes or manages trades — and you approve each real order.

Read-only — a safe first test:

Use the Cortiq MCP server to list my MT5 accounts, list my data packages, and inspect my sessions. Then gather fresh EURUSD data for the right session and summarize the market context only. Do not place any trades.

Virtual session — before any live attempt:

Create an External MCP session named 'EURUSD Virtual Agent', use my default MT5 account, assign the right data package, enable virtual mode, start the session, gather fresh EURUSD data, and give me a trade plan with entry, stop loss, take profit, and reasoning. Do not place a live trade.

Controlled live — only after the virtual flow is proven:

Use the Cortiq MCP server to review my account risk settings, gather fresh EURUSD data for the running external session, and only if the setup is valid under existing risk limits, execute one trade with a clear stop loss, take profit, and reasoning. Then report exactly what was executed.

Cortiq runs the MCP server in a trusted-Cortiq posture: a tool runs with no approval prompt unless it explicitly opts in. In the gated configuration used for in-app agent sessions, only execute_trade and execute_trade_action require explicit approval — opening, modifying, partially closing, or closing a real position. Every other tool, including the create / update / delete tools that author entities, runs without a card.

When a gated trade tool is called, Cortiq surfaces an approval — in the Copilot dock, as a Windows toast, and as an actionable row in the System Messages inbox. The trade body runs only on an explicit approve; reject, expiry, or error denies the call. Trade execution sits on its own gate and is never widened by any other permission grant.

The server exposes roughly 130 tools. They group into families — you rarely need to know individual names because the tool descriptions document every parameter. The families:

FamilyWhat the agent can do
SessionsList, inspect, create, update, start, stop, and delete sessions; create_external_session for agent-driven control.
Data packagesList, create, update, delete, and execute data packages to gather candles, indicators, and context for a symbol.
PlaybooksList, read, create, update, delete playbooks; link and unlink them to a session.
Trade executionexecute_trade to open; execute_trade_action to close, partial-close, modify SL/TP, or cancel. These are the only gated tools.
Trade management & historyInspect active trades, trade details, trade actions, cycle logs, and recent trades with reasoning.
Trade ideasCreate, list, read, update, invalidate, and delete trade ideas.
BacktestsList backtests and their trades and cycles; read a backtest and per-cycle detail.
SkillsList, load, create, update, and delete reusable agent skills.
PreparationCreate and list preparation packages; generate, execute, and write preparation outputs, including backdated (as-of) generation.
SentimentCreate and list sentiment reports / packages; generate and refresh sentiment, including backdated runs.
Instrument profilesCreate, read, update, delete, and regenerate instrument profiles for a symbol.
ResearchDrive research-workspace runs and read their outputs.
Candles & indicatorsFetch candles and ranged candles; list, search, and compute indicators.
NewsRead the economic calendar, today’s news, and upcoming events.
RiskRead and update global and per-account risk settings; calculate lot size.
StatisticsRead the dashboard summary and per-session trade statistics.
Symbols & accountsList symbols and presets, check symbol existence, read symbol info, manage MT5 accounts, read account info.
Webweb_search and web_fetch for cross-asset context, behind SSRF protection.
Documentationget_cortiq_documentation pulls built-in docs topics through MCP.

Backdating note: preparation, sentiment, and profile generation accept an as-of date so an agent can build artifacts dated to a past point for backtest alignment. Cortiq enforces no-lookahead on a best-effort basis; verify dates when backdating.

  1. Start with read-only tool usage.
  2. Use virtual mode before live mode.
  3. Keep risk limits configured in Cortiq, not only in the agent prompt.
  4. Gather data with execute_data_package before asking for a trade decision.
  5. Confirm the session is Running before using execution tools.
  6. Write prompts that state explicitly whether trading is allowed.
  • The MCP server is a local integration layer, not a public cloud API.
  • External MCP sessions skip the internal autonomous workflow engine.
  • The external agent owns its own analysis cadence and decision logic.
  • Live trading depends on the Cortiq app and MT5 connectivity being healthy.
  • A session without a valid data package cannot gather market data until one is assigned.
  1. Cortiq Copilot — the in-app assistant that uses the same tools and the same approval gate, without an external client.
  2. Agent permissions — the full permission model: the trade gate, the filesystem sandbox, and capability grants.
  3. Sessions — the autonomous-session alternative if MCP is more than you need.