
Gainium Mcp
io.gainium由 gainium.io 發布官方發布者v3.3.0更新於 Oct 27, 2026
MCP server for Gainium — manage trading bots, deals, and balances via AI assistants
概覽
Gainium MCP 讓 AI 助理在 Gainium 平台上管理加密貨幣交易機器人、交易單、餘額並執行回測。
- 可以做什麼
- 列出、檢視、建立、更新與複製 DCA、combo、grid 機器人,並啟動、停止、封存、還原或更換交易對
- 列出與檢視交易單,建立或更新交易單,以及平倉、追加或減少資金
- 執行回測(驗證、估算、非同步或同步)並列出或查詢回測請求
- 讀取帳戶餘額、已連結與支援的交易所、全域變數,並查詢加密貨幣篩選器
- 查詢機器人類型與指標的結構定義,並建立、更新或刪除全域變數
- 適用情境
- 適合在 Gainium 上運行交易機器人、希望直接在聊天用戶端中檢視機器人與交易單表現、調整設定或執行回測,而不必開啟網頁介面的使用者。
- 執行需求
- 可使用具 OAuth 登入的託管遠端端點,或在 Node.js 下以 npx 執行本機 npm 套件。本機與標頭模式需要 Gainium API 金鑰組,透過 GAINIUM_API_KEY 與 GAINIUM_API_SECRET 提供;另有選用變數可限定單一機器人或僅限模擬交易。需要能存取 Gainium API 的網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Gainium Mcp,將其新增到工作區。
- 連接 所需的 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
- 為需要使用其工具的對話啟用該服務。
Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。
交給代理程式安裝
把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。
閱讀 https://sourceweft.com/mcp/io.gainium%2Fgainium-mcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。其他 MCP 客戶端
把它新增到你客戶端的 mcpServers 設定中。 客戶端會在首次連接時完成 OAuth 登入。
{
"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
來源:README.md,提交 989ca82
工具
0版本歷史
1- v3.3.0最新Sep 16, 2026
評分
已滿足適用檢查項的 85%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通必需25 分
- 已宣告認證方式必需10 分
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分