gainium-mcp — Claude Code MCP server for Gainium bots
An MCP server that lets your AI assistant drive Gainium trading bots, deals and balances. Handy when the bots run on their own and you would rather issue commands from chat.
claude mcp add --transport http gainium-mcp https://mcp.gainium.io/mcpWhat gainium-mcp does
The server exposes 17 tools. Bots of type dca, combo and grid can be listed, created, updated and cloned; deals of type dca, combo and terminal can be opened, funded or closed; backtests run through run_backtest. Read tools carry readOnlyHint, write tools carry destructiveHint, so the client can tell which calls change state.
Three deployment models are supported. Local stdio reads the keys from environment variables. OAuth 2.1 hosted mode backs the public https://mcp.gainium.io/mcp endpoint and the Anthropic connector directory: the client gets a token from the Gainium authorization server and sends it as Authorization: Bearer. The legacy header mode passes X-API-Key and X-API-Secret with every request. Once OAuth is on, those headers are ignored.
Local stdio needs a key pair from the Gainium API settings: GAINIUM_API_KEY and GAINIUM_API_SECRET. Without them the server has nothing to authenticate with. Per-key restrictions — read-only, paper trading only, a single bot — are enforced server-side, so a narrow key stays narrow after you connect it.
What it helps with
- list bots and their settings without opening the web app
- start or stop one specific bot
- close a deal or add funds to it
- run a backtest before committing to a strategy
- clone a bot with different parameters
Example prompts for the agent
- List all my
gridbots and their current settings - Start the
dcabot with the id I give you - Run a backtest on this strategy and show me the result
How to install gainium-mcp
1Platform CLI: remote server
claude mcp add --transport http gainium-mcp https://mcp.gainium.io/mcp2Platform CLI
claude mcp add --env GAINIUM_API_KEY=<GAINIUM_API_KEY> --env GAINIUM_API_SECRET=<GAINIUM_API_SECRET> --env GAINIUM_PAPER_ONLY=<GAINIUM_PAPER_ONLY> --env GAINIUM_ALLOWED_BOT_ID=<GAINIUM_ALLOWED_BOT_ID> --transport stdio gainium-mcp -- npx -y gainium-mcpReplace <…> with your own values
1Platform CLI: remote server
codex mcp add gainium-mcp --url https://mcp.gainium.io/mcp2Platform CLI
codex mcp add gainium-mcp --env GAINIUM_API_KEY=<GAINIUM_API_KEY> --env GAINIUM_API_SECRET=<GAINIUM_API_SECRET> --env GAINIUM_PAPER_ONLY=<GAINIUM_PAPER_ONLY> --env GAINIUM_ALLOWED_BOT_ID=<GAINIUM_ALLOWED_BOT_ID> -- npx -y gainium-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"gainium-mcp": {
"url": "https://mcp.gainium.io/mcp"
}
}
}{
"mcpServers": {
"gainium-mcp": {
"command": "npx",
"args": [
"-y",
"gainium-mcp"
],
"env": {
"GAINIUM_API_KEY": "<GAINIUM_API_KEY>",
"GAINIUM_API_SECRET": "<GAINIUM_API_SECRET>",
"GAINIUM_PAPER_ONLY": "<GAINIUM_PAPER_ONLY>",
"GAINIUM_ALLOWED_BOT_ID": "<GAINIUM_ALLOWED_BOT_ID>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"gainium-mcp": {
"type": "http",
"url": "https://mcp.gainium.io/mcp"
}
}
}{
"servers": {
"gainium-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"gainium-mcp"
],
"env": {
"GAINIUM_API_KEY": "<GAINIUM_API_KEY>",
"GAINIUM_API_SECRET": "<GAINIUM_API_SECRET>",
"GAINIUM_PAPER_ONLY": "<GAINIUM_PAPER_ONLY>",
"GAINIUM_ALLOWED_BOT_ID": "<GAINIUM_ALLOWED_BOT_ID>"
}
}
}
}Replace <…> with your own values
1Platform CLI: remote server
gemini mcp add -t http gainium-mcp https://mcp.gainium.io/mcp2Platform CLI
gemini mcp add -e GAINIUM_API_KEY=<GAINIUM_API_KEY> -e GAINIUM_API_SECRET=<GAINIUM_API_SECRET> -e GAINIUM_PAPER_ONLY=<GAINIUM_PAPER_ONLY> -e GAINIUM_ALLOWED_BOT_ID=<GAINIUM_ALLOWED_BOT_ID> gainium-mcp npx -y gainium-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about gainium-mcp
How do I install gainium-mcp in Claude Code?
Use the hosted endpoint: claude mcp add --transport http gainium-mcp https://mcp.gainium.io/mcp. Or run it locally with your own keys: `claude mcp add --env GAINIUM_API_KEY=<GAINIUM_API_KEY> --env GAINIUM_API_SECRET=<GAINIUM_API_SECRET> --env GAINIUM_PAPER_ONLY=<GAINIUM_PAPER_ONLY> --env GAINIUM_ALLOWED_BOT_ID=<GAINIUM_ALLOWED_BOT_ID> --transport stdio gainium-mcp -- npx -y gainium-mcp`.
What does gainium-mcp do?
It gives an AI assistant access to your Gainium account: listing and creating bots, editing settings, starting and stopping them, handling deals and running backtests. All of it over the standard MCP interface.
Which keys does the local mode need?
A pair from the Gainium API settings — GAINIUM_API_KEY and GAINIUM_API_SECRET. If the key is limited to paper trading or to one bot, those limits still apply.