# gainium-mcp

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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 2
- Author: Gainium
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Gainium/gainium-mcp
- Updated: 2026-10-12
- HTML: https://affpapa.org/en/nevibecode/mcp/gainium-mcp

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)
- Remote server: `https://mcp.gainium.io/mcp`
- Environment variables: `GAINIUM_API_KEY`, `GAINIUM_API_SECRET`, `GAINIUM_PAPER_ONLY`, `GAINIUM_ALLOWED_BOT_ID` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

1. **Platform CLI: remote server**
```bash
claude mcp add --transport http gainium-mcp https://mcp.gainium.io/mcp
```

2. **Platform CLI**
```bash
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
```
Replace <…> with your own values

### Codex

1. **Platform CLI: remote server**
```bash
codex mcp add gainium-mcp --url https://mcp.gainium.io/mcp
```

2. **Platform CLI**
```bash
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-mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "gainium-mcp": {
            "url": "https://mcp.gainium.io/mcp"
        }
    }
}
```
File `.cursor/mcp.json`:
```json
{
    "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

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "gainium-mcp": {
            "type": "http",
            "url": "https://mcp.gainium.io/mcp"
        }
    }
}
```
File `.vscode/mcp.json`:
```json
{
    "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

### Gemini CLI

1. **Platform CLI: remote server**
```bash
gemini mcp add -t http gainium-mcp https://mcp.gainium.io/mcp
```

2. **Platform CLI**
```bash
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-mcp
```
Replace <…> with your own values

## When to use it
- 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
- List all my `grid` bots and their current settings
- Start the `dca` bot with the id I give you
- Run a backtest on this strategy and show me the result

## Similar
- [crypto-trading-bots](https://affpapa.org/en/nevibecode/skills/crypto-trading-bots.md) — skill · 917 installs
- [exit-strategies](https://affpapa.org/en/nevibecode/skills/exit-strategies.md) — skill · 507 installs
- [find-arbitrage-opps](https://affpapa.org/en/nevibecode/skills/find-arbitrage-opps.md) — skill · 493 installs
- [solana-payments-wallets-trading](https://affpapa.org/en/nevibecode/skills/solana-payments-wallets-trading.md) — skill · 475 installs
- [crypto-tax-export](https://affpapa.org/en/nevibecode/skills/crypto-tax-export.md) — skill · 434 installs
- [index-bot](https://affpapa.org/en/nevibecode/skills/index-bot.md) — skill · 403 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
