gunbot-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@gunbot-mcphow are my bots doing? show status, balances and PNL"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
gunbot-mcp
⚠️ BETA SOFTWARE
This project is in beta (
0.1.0-beta.1). It has been built from Gunbot's public API docs and tested against a mock server, not yet across a range of real Gunbot installs. Expect rough edges, and expect behaviour to change between releases.
Run it on a paper-trading or low-stakes instance first.
Keep it on the default
read-onlyprofile until you've seen it work correctly against your own setup.Treat every write (
configand above) as experimental, and review each diff before applying it.Please open an issue with anything that behaves differently from what's documented here.
An unofficial Model Context Protocol server for the Gunbot REST API. It lets an AI assistant check on your bots, review config, and (if you allow it) make controlled changes, with you choosing exactly how much power it gets.
Not affiliated with or endorsed by Gunbot / Gunthy. "Gunbot" is their trademark.
Trading bots handle real money. This software is provided as-is, with no warranty, and is not financial advice. A bad setting or a bug can lose funds. Start read-only, test writes against a paper-trading or low-stakes instance first, and read the Security model.
Related MCP server: Freqtrade-MCP
Permission profiles
You choose a profile per server and/or per instance. The default is read-only.
Profile | Adds |
| Status, balances, pairs, market data, PNL, order history, redacted config, backups |
| Propose and apply pair changes (parameters, enabled, strategy), add/remove pairs |
| Start, stop, restart the trading core |
| Reserved for strategy-file writes and manual trading (not implemented yet; both need an explicit opt-in flag) |
Each profile includes everything below it. Fine-tune with allow / deny lists of tool names (deny always wins).
Tools a profile doesn't permit are not registered at all, so the model never sees them. Every call is also re-checked against the target instance.
Tools
read-only: gunbot_list_instances, gunbot_status, gunbot_get_balances, gunbot_list_pairs, gunbot_get_config, gunbot_get_pair_config, gunbot_get_pair_state, gunbot_get_candles, gunbot_get_orderbook, gunbot_get_pnl_summary, gunbot_list_state_files, gunbot_get_state_file, gunbot_list_backups, gunbot_get_backup
config: gunbot_propose_pair_change, gunbot_propose_add_pair, gunbot_propose_remove_pair, gunbot_apply_change
operator: gunbot_start_core, gunbot_stop_core, gunbot_restart_core
Writes are two-step. A propose_* call writes nothing and returns a diff plus a single-use changeId (valid 10 minutes). apply_change then:
refuses if the config changed since the proposal,
refuses to write back a config that has no real credentials in it (see below),
saves a backup of the raw config (mode
0600),applies the change,
reads the config back to verify.
New pairs are always created disabled. Only parameters in writableParams can be changed, and anything that looks like a credential can never be written.
Setup
Requires Node 20+ and a Gunbot instance with its GUI/API reachable.
npm install
npm run build
cp config.example.json gunbot-mcp.config.json # edit itSecrets are read from environment variables, never from the config file:
passwordEnv: env var holding your Gunbot GUI password.walletKeyEnv: env var holdingbot.gunthy_walletfrom your Gunbotconfig.js. Gunbot's login encrypts the password with it.
Config is found via GUNBOT_MCP_CONFIG, then ./gunbot-mcp.config.json, then ~/.config/gunbot-mcp/config.json.
Claude Desktop / Claude Code
{
"mcpServers": {
"gunbot": {
"command": "node",
"args": ["/absolute/path/to/gunbot-mcp/dist/index.js"],
"env": {
"GUNBOT_MCP_CONFIG": "/absolute/path/to/gunbot-mcp.config.json",
"GUNBOT_MAIN_PASSWORD": "...",
"GUNBOT_MAIN_WALLET_KEY": "..."
}
}
}
}Configuration
{
"profile": "read-only", // server-wide default
"allow": [], "deny": [], // tool names; deny wins
"flags": { "strategyWrites": false, "trading": false },
"writableParams": ["BUY_LEVEL"], // override params the model may change; ["*"] = any non-credential
"dataDir": "~/.gunbot-mcp", // backups + audit log
"audit": true, // JSONL log of every non-read call
"instances": {
"main": {
"url": "http://host:3001",
"passwordEnv": "...", "walletKeyEnv": "...",
"profile": "config", // per-instance override
"allowStrippedConfigWrites": false,
"timeoutMs": 15000
}
}
}Every tool takes an optional instance argument (required only when several are configured).
Security model
Read this before enabling anything above read-only. To report a vulnerability privately, see SECURITY.md.
This restricts the MCP server, not your Gunbot password. Gunbot's API has no scoped tokens: one login can do everything, including manual trades and license-key edits. Anyone who has your password can bypass these profiles. They exist to keep an AI assistant on a leash, not to be access control.
Credentials never reach the model. Everything returned is run through a redactor (credential-looking keys at any depth, plus
ENC:and JWT-shaped values). It is deliberately not configurable. Error messages never include response bodies.Never exposed, in any profile: license-key editing (the endpoint is hard-blocked in the client). Strategy-file writes and manual buy/sell/cancel are not implemented and will need explicit flags.
The password is high-value. It controls your bot. Keep it in env vars or a secrets manager, and don't commit it.
Use HTTPS or a trusted network. Gunbot defaults to plain HTTP. If the instance isn't on localhost, put it behind TLS or a VPN.
Backups contain secrets.
dataDir/backups/holds raw config copies (files0600, directory0700). Treat it like the Gunbot config itself.Whole-config writes. Gunbot's
config/updatereplaces the entire config. If the API ever returns a stripped or masked config, writing it back would erase your exchange keys. Soapply_changerefuses unless the config it read contains real, unmasked credentials. Only setallowStrippedConfigWritesif you've verified your setup round-trips safely.Prompt injection. Anything the model reads (pair names, order data) is untrusted input. Keep the profile as low as your task needs.
Status
Beta (0.1.0-beta.1). Built from Gunbot's public API docs and tested against a mock server, not yet against a range of real instances.
Verified against docs: login encryption, config get/update/pair add/remove, balances, pairs, candles, orderbook, coremem, state files, backups, start/stop.
Unverified response shapes: PNL (
/pnl/sum), and Gunbot's behaviour when writing back the full config. Please test on a non-production instance and open an issue with what you find.Docs disagree on the default port (3000 vs 3001). Set it in
url.Default
writableParamsis a conservative guess at common parameter names. Check them against your Gunbot version.No log access yet: Gunbot's API has no log endpoint. An optional SSH/pm2 backend is planned.
Development
npm test # unit tests (redaction, permissions, change-set logic, client)
npm run typecheck
npm run build && node test/smoke.mjs # end-to-end over stdio against a mock GunbotLicense
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for Gainium — manage trading bots, deals, and balances via AI assistants
Manage HaasOnline crypto trading bots, labs, backtests and HaasScript across 20+ exchanges.
Trade, monitor portfolios, and build Coinrule strategies by chat.
Crypto trading intelligence MCP — 34+ endpoints, x402 pay-per-use, AI agent strategy & execution
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to perform cryptocurrency trading analysis and execution with 38+ tools including real-time market data, technical indicators, risk management, and support for both paper trading and live execution on Hyperliquid.7MIT
- AlicenseBqualityDmaintenanceIntegrates with the Freqtrade cryptocurrency trading bot via its REST API to enable AI-driven automated trading and bot management. It allows users to fetch market data, monitor performance, manage whitelists, and execute trades through natural language.22MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI co-pilots to interact with TradingView charts, manage alerts via REST API, automate morning briefs with custom trading rules, and perform real-time market analysis.-
- AlicenseAqualityBmaintenanceRead and manage Gainium DCA/Combo/Grid bots, deals, balances, backtests, the crypto screener, and curated strategy presets via MCP.1951 npm2MIT