
Gainium Mcp
io.gainiumPublished by gainium.ioOfficial publisherv3.3.0Updated Oct 27, 2026
MCP server for Gainium — manage trading bots, deals, and balances via AI assistants
Overview
Gainium MCP lets an AI assistant manage crypto trading bots, deals, balances and backtests on the Gainium platform.
- What you can do
- List, inspect, create, update and clone DCA, combo and grid bots, and start, stop, archive, restore or change their pairs
- List and inspect deals, create or update deals, and close them or add and reduce funds
- Run backtests (validate, estimate, async or sync) and list or fetch backtest requests
- Read account balances, connected and supported exchanges, global variables, and query the crypto screener
- Discover bot-type and indicator schemas, and create, update or delete global variables
- When to use it
- Useful when you run trading bots on Gainium and want an assistant to review bot and deal performance, adjust settings, or run backtests from a chat client instead of the web UI.
- Requirements
- Either the hosted remote endpoint with OAuth sign-in, or the local npm package run with npx under Node.js. Local and header modes need a Gainium API key pair in GAINIUM_API_KEY and GAINIUM_API_SECRET; optional variables restrict to one bot or to paper trading. Network access to the Gainium API.
Installation
In SourceWeft
- Open Gainium Mcp in the dashboard and add it to a workspace.
- Connect the required credentials. They are stored privately and never shown on public pages.
- Enable the server for the chats that should use its tools.
Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.
Use with an agent
Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.
Read https://sourceweft.com/mcp/io.gainium%2Fgainium-mcp/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.Other MCP clients
Add this to your client's mcpServers config. The client completes OAuth sign-in on first connect.
{
"mcpServers": {
"gainium": {
"type": "http",
"url": "https://mcp.gainium.io/mcp"
}
}
}README
gainium-mcp
An MCP (Model Context Protocol) server for Gainium — the crypto trading bot platform. Lets AI assistants manage your bots, deals, balances, and more through a standard MCP interface.
Detailed setup and connection documentation is available in docs/using-gainium-mcp.md.
Quick Start
1. Get your API keys
Go to Gainium API Settings and create an API key pair.
2. Add to your MCP client
Add this to your MCP configuration (VS Code, Claude Desktop, etc.):
That's it. The server starts automatically when your AI assistant needs it.
This local stdio mode uses GAINIUM_API_KEY and GAINIUM_API_SECRET from the server process environment.
Environment Variables
Authentication Modes
gainium-mcp supports three deployment models:
- Local stdio mode: the MCP server reads
GAINIUM_API_KEYandGAINIUM_API_SECRETfrom env vars. - OAuth 2.1 hosted mode (recommended for hosted/public): the server acts as an OAuth protected resource. Clients (e.g. the Claude connector) obtain an access token from the Gainium authorization server and send it as
Authorization: Bearer <token>. See OAuth 2.1 hosted mode below. - Header hosted mode (legacy/self-hosted): each request sends
X-API-KeyandX-API-Secretheaders so one shared server can serve many users.
In header/stdio mode, request headers take priority, falling back to GAINIUM_API_KEY / GAINIUM_API_SECRET. When OAuth mode is enabled, the Bearer token is required and the X-API-Key/X-API-Secret headers are ignored.
OAuth 2.1 hosted mode
This is the mode used for the public https://mcp.gainium.io/mcp endpoint and the Anthropic Claude connector directory (which requires OAuth and forbids API-key headers).
Enable it by setting, in HTTP mode:
When enabled, the server:
- Serves OAuth Protected Resource Metadata (RFC 9728) at
/.well-known/oauth-protected-resourceand/.well-known/oauth-protected-resource/mcp, advertising the authorization server. - Rejects unauthenticated MCP requests with
401 Unauthorizedand aWWW-Authenticate: Bearer resource_metadata="…"header, so clients can discover the auth server and run the OAuth flow (Dynamic Client Registration + PKCE). - Validates the Bearer access token on each request via the auth server's
token introspection endpoint, resolving it to the user's Gainium
(apiKey, apiSecret)and per-key restrictions (read/write, paper-only, single-bot), which are still enforced server-side. Introspection results are cached briefly.
The local stdio path is unaffected by these variables.
HTTP and SSE Mode
By default, gainium-mcp runs over stdio for MCP clients that spawn local processes. To run it as an HTTP server instead:
When HTTP mode is enabled, the server exposes both transport styles:
GET|POST|DELETE /mcpfor the current Streamable HTTP transportGET /sseplusPOST /messages?sessionId=...for deprecated HTTP+SSE clients
This makes one server process compatible with both modern MCP HTTP clients and older SSE-based integrations. In hosted mode, authenticate with OAuth (see OAuth 2.1 hosted mode) or, for self-hosted/legacy setups, send X-API-Key and X-API-Secret on each request.
Available Tools (17)
As of v3.0.0 the toolset is consolidated: a single tool per operation, with a
botType / dealType / action discriminator instead of one tool per variant.
Every tool carries an MCP safety annotation — read-only tools set readOnlyHint,
write tools set destructiveHint.
Bots
Deals
Backtest
Discovery, Account & Market
Field Selection
All GET endpoints support the fields parameter for efficient payloads:
- Presets:
minimal,standard(default),extended,full - Custom: comma-separated dot-notation fields (e.g.
_id,uuid,settings.name,profit.total)
Using minimal reduces payload size by ~85%.
API Permissions
- Read-only key: read tools only (
list_*,get_*,discover,backtest_info,get_screener,list_presets) - Write key: all tools, including
create_*,update_*,clone_bot,manage_bot,manage_deal,manage_global_variable,apply_preset, andrun_backtest - Read-only directory connector (
/mcpwithGAINIUM_READONLY=true, served atmcp.gainium.io/read): exposes and allows only the 9readOnlyHinttools —run_backtestand all write tools are excluded - Token audience binding (OAuth mode): when
GAINIUM_MCP_PUBLIC_URLis set, the server treats<public-url><http-path>as its RFC 8707 resource. An access token whose introspectedaudis a different resource is rejected — a token minted formcp.gainium.io/readcan't be replayed againstmcp.gainium.io/mcp, and vice versa. Tokens with noaud(legacy grants) are still accepted.
Development
Architecture
License
MIT
Source: README.md at commit 989ca82
Tools
0Version history
1- v3.3.0LatestSep 16, 2026
Score
85% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 daysRequired25 pts
- Auth declaredRequired10 pts
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts