floorbroker
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
floorbroker
A self-hosted MCP server that lets AI agents trade on several platforms through one generic tool interface, plus a small web UI to track what the agents do and how your accounts perform.
One interface, many platforms. Agents see the same tools (
get_positions,place_order,get_candles, …) whether the account is on Bybit or IG. Platforms are adapters behind a single TypeScript interface, so Binance or others can be added later without touching the MCP side.OAuth 2.1 for cloud agents. Add it as a custom connector in Claude or ChatGPT by pasting a URL. On the consent screen you choose which accounts the agent may use, read-only or trading, and optional risk limits.
Multi-user. Every user (you, a friend) has their own platform accounts and agents and only sees their own data.
Tracking UI. Equity curves, daily realized PnL, open positions/orders, and a full log of every agent tool call.
Historic data cache. Finished candles are stored once and served from the local cache forever, which matters for platforms with data allowances (IG: 10,000 points per week).
Supported platforms: Bybit (spot, perpetuals, futures, options; live, demo trading, testnet; all regional hosts) and IG (CFD and spread-bet accounts; live and demo).
⚠️ AI agents can lose real money quickly. Start with demo or testnet accounts, use read-only connections until you trust an agent, and consider the per-connection risk limits.
How it works
Claude / ChatGPT / any MCP client
│ Streamable HTTP + OAuth 2.1 (or a personal token)
▼
/mcp ── generic tools ── risk checks ── activity log
│
├── Bybit adapter ── Bybit v5 REST
└── IG adapter ───── IG REST (session-based)
Web UI (accounts, agents, activity, PnL) SQLite: app.db + marketdata.dbCreate an API key on your platform (or a sub-account and a key for it). Never enable withdrawals, keys that can withdraw are refused.
In the web UI, Accounts → Add account, choose the platform and paste the credentials. They are verified and stored encrypted.
Connect your agent to
https://<your-host>/mcp. Sign in when asked, pick the accounts, the permission (read only / trade) and optional risk limits.The agent can now read prices, history, balances, positions and orders, and trade if allowed.
Live vs. demo, for you and for the agent
Each account has two independent settings:
Setting | Meaning | Where it shows |
Environment | The real platform system the key belongs to (Bybit live / demo trading / testnet, IG live / demo). | UI badges, PnL totals (demo never mixes into live totals) |
What agents are told |
| MCP |
So you can, for example, let an agent believe a demo account is live. The UI then shows DEMO plus
agent sees LIVE. Agents are always instructed to treat every account as real money.
Related MCP server: Gogi MCP Server
MCP tools
Read tools are always available. Trading tools are only listed for connections with the trade permission.
Tool | Purpose |
| Accounts available to this agent, with environment, capabilities, platform notes and risk limits. |
| Equity, balance, available funds, unrealized PnL, margin, per-asset balances. |
| Find instruments by name/symbol; returns the platform instrument ids. |
| Trading rules: size unit, min/max size, steps, tick, contract size, leverage, expiry/strike, min stop distance, market status. |
| Bid/ask/last, 24h stats, funding (perps), greeks/IV (options). |
| Level-2 book (Bybit). |
| Historic OHLC(V) through the cache; reports the platform's data quota. |
| Which ranges are already stored locally (free to read). |
| Open positions with PnL, leverage, liquidation price, SL/TP. |
| Open orders or order history. |
| Executions with fees. |
| Closed positions with realized PnL. |
| market / limit / stop / stop_limit, TIF, reduce-only, attached SL/TP, trailing and guaranteed stops where supported. |
| Change price, trigger, size, SL/TP. |
| Cancel one or all open orders. |
| Close fully or partially, market or limit. |
| Set or remove SL / TP / trailing stop on a position. |
| Per-instrument leverage (Bybit). |
Capabilities differ per platform (e.g. IG has no order book or leverage setting), and list_accounts tells the
agent which apply. Unsupported calls return a clear unsupported error.
Risk limits (optional, per connection)
max order notional and max position notional per instrument (in the instrument's quote currency)
max leverage (applies to
set_leverage)allowed instruments (ids, trailing
*matches a prefix, e.g.linear:BTC*)
Closing and reduce-only orders are always allowed, so an agent can always exit.
Deploy with Portainer
The GitHub Actions workflow publishes ghcr.io/yniverz/floorbroker_mcp:latest (amd64 + arm64) on every push to main.
New GHCR packages are private: either make the package public (GitHub → Packages → floorbroker_mcp → settings)
or add ghcr.io registry credentials in Portainer.
Stacks → Add stack → Repository, URL of this repo, compose path
docker-compose.yml(or paste the compose file into the web editor).Set the environment variables:
Variable | Example | Notes |
|
| External origin, no path. |
| (random) |
|
|
| Only used to create the first account on first start. |
|
| Published address; keep on loopback behind the proxy, or use your proxy network. |
|
| Proxy hops whose |
| Extra | |
|
| Optional: only these clients may register. |
|
| Equity snapshot and realized-PnL sync intervals. |
See .env.example for everything else.
Deploy, then point your reverse proxy at the container.
Reverse proxy / NetBird
Cloud agents (Claude, ChatGPT) call the server from their own infrastructure, so these paths must be reachable from the public internet:
Path | Who calls it |
| the agent platform (bearer token) |
| the agent platform |
| the agent platform |
| your browser (consent screen) |
Everything else (/, /login, /accounts, /assets, …) is the web UI and can stay behind NetBird SSO.
/oauth/authorize and /login only need to be reachable from your browser, so behind NetBird is fine as long
as you're on NetBird while connecting an agent. Note that the consent screen loads /assets/style.css and posts
to /login; keep those reachable from the same browser.
Also: terminate TLS at the proxy, forward the original Host (or set ALLOWED_HOSTS), set X-Forwarded-For,
and don't add a path prefix.
Data
The volume /data holds two SQLite files:
app.db: users, encrypted credentials, agent connections, OAuth state, activity log, equity snapshots, closed PnL. Back this up.marketdata.db: the shared historic candle cache. Can grow large; safe to delete, it refills on demand.
Connecting agents
Claude (claude.ai, Desktop, mobile): Settings → Connectors → Add custom connector → https://<host>/mcp.
ChatGPT: Settings → Apps & Connectors → enable Developer mode → Create → URL https://<host>/mcp, authentication OAuth.
Claude Code / other clients: OAuth works too, or create a personal token under Agents and use
claude mcp add --transport http floorbroker https://<host>/mcp --header "Authorization: Bearer fb_pat_..."Re-connecting the same client updates its existing connection instead of creating a new one. Connections can be edited (accounts, permission, limits) or revoked at any time under Agents; changes apply to the next request.
Platform notes
Bybit
Create a system-generated (HMAC) API key: Read-Write, with Orders + Positions (Unified Trading / Contract), Spot and Options trade as needed. No withdrawal or transfer permissions. Binding an IP is recommended.
Environments: Live (pick your region host: global, EU, NL, TR, KZ, GE, AE, HK, ID), Demo trading (keys created in Bybit's demo mode), Testnet.
Sizes are in base coin for spot/linear/options and in USD contracts for inverse. Spot holdings appear as balances, not positions. Options have no candle history on Bybit.
IG
Needs your username, password and API key (My IG → Settings → API keys). Demo accounts need a separate demo login and demo API key.
One IG login can hold several accounts (CFD, spread bet). Leave Account ID empty for the preferred account.
Sizes are contracts (CFD) or stake per point (spread bet). Positions net by default. Markets have trading hours and minimum stop distances (see
get_instrument).Historic prices cost allowance (10,000 points/week). The cache and the
quotafield help the agent stay within it.
Adding a platform
Create
src/platforms/<name>/exporting aPlatformDefinition(see src/platforms/types.ts): credential fields (the UI builds its form from them), environments, capabilities, setup help, and acreateClient()returning aPlatformClient.Implement the client methods using the generic types; throw
PlatformErrorwith actionable messages; refuse credentials that can withdraw funds invalidate().Register it in src/platforms/registry.ts.
The MCP tools, risk checks, candle cache, PnL tracking and UI pick it up automatically.
Development
npm install
npm run build
ENCRYPTION_KEY=$(openssl rand -base64 32) ADMIN_PASSWORD=change-me-please PUBLIC_URL=http://localhost:8080 npm startnpm test builds and runs scripts/smoke-test.mjs: it starts a throwaway server and
walks through OAuth (registration, PKCE, refresh, code replay), MCP initialize/tools, and Bybit public market
data through the candle cache.
Status
The OAuth flow, MCP layer, UI and Bybit public market data are tested end to end. Authenticated platform calls (balances, orders, trading) have not been exercised against real accounts yet. Verify each platform on demo/testnet before giving an agent a live account.
Security
Platform credentials are encrypted with AES-256-GCM, bound to their account row.
Keys with withdrawal permission are refused (Bybit); IG's API cannot withdraw.
Passwords: scrypt; account lockout; rate-limited login;
HttpOnly/Secure/SameSitecookies; CSRF tokens.OAuth 2.1: PKCE (S256) required, exact redirect URI matching, rotating refresh tokens, code replay revokes the grant, RFC 8707 resource binding, Client ID Metadata Documents with SSRF guards.
The UI uses no JavaScript and a strict CSP. MCP requests are checked for
OriginandHost.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Trading MCP server for AI agents, with live market data, account reads and controlled execution.
Trade 16 crypto exchanges + MetaTrader 5 from your AI assistant via one MCP connection.
No-KYC managed MCP for AI agents: sandboxed TypeScript trading SDK, isolated sub-accounts, futures.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceSecure broker gateway and stateful trading SaaS that bridges LLM AI agents with brokerage accounts via MCP, encrypting credentials and supporting connectors for Bybit, MetaTrader 5, TradingView, and more.-

Gogi MCP Serverofficial
AlicenseNot gradedqualityCmaintenanceEnables AI assistants in MCP clients to query real-time market data, inspect portfolio and Web3 wallet balances across brokers, place protected equity/ETF, crypto, forex, options, DeFi swap, and prediction market orders, and run backtests.MIT
AlgoVesta MCP Serverofficial
AlicenseNot gradedqualityBmaintenanceConnects AI assistants to 16 crypto exchanges and MetaTrader 5 over a single MCP endpoint, enabling trading and account management with server-side risk controls, paper trading by default, and auditable signed receipts.4CC BY-4.0- AlicenseAqualityFmaintenanceEnables AI agents to place and manage Hyperliquid trades through MCP with position, leverage, daily-loss, market, and stop-loss limits enforced outside the model, plus paper trading and an auditable decision log.9104 npmMIT