Skip to content

Setup

CLI MCP requires cTrader CLI to be installed and accessible on your machine. The AI agent sends commands to cTrader CLI on your behalf, so all standard prerequisites apply.

Prerequisites

  • cTrader 4.8 or newer installed (Windows or Linux Docker image).
  • A cTrader ID (cTID) with at least one linked trading account.
  • A password file (.pwd or .txt) containing your cTID password.
  • Your cBot .algo files compiled for .NET 6.

Warning

cTrader CLI works only with modern .NET 6 algos. If your cBot was built for .NET 4, recompile it in the latest cTrader Windows application.

Locate cTrader CLI

On Windows, the cTrader CLI executable is usually in the same directory as your cTrader application:

C:\Users\{username}\AppData\Local\Spotware\cTrader\{installationId}

If you are using the Linux Docker image, pull the latest version:

1
docker pull ghcr.io/spotware/ctrader-console:latest

Configure your AI client

Add the CLI MCP server to .mcp.json in your project root:

1
2
3
4
5
6
7
8
"mcpServers": {
  "ctrader-cli": {
    "command": "node",
    "args": [
      "C:\\{file-path}"
    ]
  }
}

Replace C:\\{file-path} with the correct file path for the CLI MCP server.

Verification

Restart your AI client or application, then check that the cTrader CLI MCP server appears in the list of connected servers.

Credentials

All commands that connect to a trading account require your cTID and password file. You can either supply these in every prompt or instruct the agent to reuse them throughout a session.

My cTrader ID is letstrade@email.com and my password file is at 
C:\test\password.pwd. Use these credentials for everything in 
this session.

Tip

Create a dedicated password file by opening a text editor, typing your password (without whitespace), and saving the file with a .pwd or .txt extension.