@luxalgo/broker-mcp
OfficialProvides read-only access to Binance brokerage accounts, enabling queries for account balances, open positions, trade history, and performance statistics.
Provides read-only access to Coinbase accounts via a custom app, enabling queries for balances, positions, trade history, and performance metrics.
Provides read-only access to OKX brokerage accounts, enabling queries for account balances, positions, trade history, and performance statistics.
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., "@@luxalgo/broker-mcpHow's my portfolio looking this week?"
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.
@luxalgo/broker-mcp
Give your AI agent read access to your real brokerage accounts — with keys that never leave your machine.
A local MCP server wrapping @luxalgo/broker-sdk. Connect Claude (or any MCP client) to Alpaca, Binance, Kraken, Bybit, Hyperliquid, Interactive Brokers and more, then just ask:
"How's my portfolio doing?" · "What's my win rate this month?" · "What did I trade last week?"
No hosted service, no telemetry, no per-connection fees. The server runs on your machine, your keys live in your own MCP config, and the underlying SDK has no trading endpoints at all — the agent can look, not touch.
Setup
Add the server to your MCP client config with the credential env vars for the brokers you use. Claude Desktop (claude_desktop_config.json) or Claude Code (.mcp.json):
{
"mcpServers": {
"brokers": {
"command": "npx",
"args": ["-y", "@luxalgo/broker-mcp"],
"env": {
"BROKERS_ALPACA_API_KEY": "…",
"BROKERS_ALPACA_API_SECRET": "…",
"BROKERS_KRAKEN_API_KEY": "…",
"BROKERS_KRAKEN_API_SECRET": "…",
"BROKERS_HYPERLIQUID_WALLET_ADDRESS": "0x…"
}
}
}
}Every broker whose variables are all set is connected automatically. Create every key with read-only scope — that is all this server ever needs; the list_brokers tool includes the one-line read-only setup guide per broker.
Environment variables
Names derive mechanically from each broker's credential fields: BROKERS_<BROKER>_<FIELD>.
Broker | Variables |
Alpaca |
|
Coinbase (BYO app) |
|
Binance |
|
Bybit |
|
Crypto.com |
|
E*TRADE (BYO app) |
|
Hyperliquid |
|
Interactive Brokers (Flex) |
|
Kraken |
|
OKX |
|
Public.com |
|
Questrade |
|
Topstep |
|
Tradier |
|
Trading212 |
|
Webull |
|
Questrade caveat: its refresh tokens are single-use and rotate on every fetch. The server keeps the rotated token in memory while it runs, but after a restart the token in your config is already consumed — you'll need to paste a fresh one. Static env config and rotating tokens are a poor fit; a better answer is on the roadmap.
Related MCP server: @y0exchange/mcp
Tools
Tool | What the agent gets |
| Every supported broker, its env vars (set/unset — never values), configured state, read-only key guide |
| All connected accounts: broker, currency, equity, cash |
| Open positions with market values (negative quantity = short); filter by broker |
| Trade history, newest first; filter by broker/symbol |
| Total equity, equity by broker, top positions, FIFO win rate, avg win/loss, realized PnL per symbol |
| Bypass the 5-minute cache and re-fetch everything now |
Snapshots are cached in memory for 5 minutes; per-broker failures are reported alongside results, never silently dropped.
Security posture
Read-only by construction. The SDK underneath implements no order, transfer, or withdrawal endpoint for any broker.
Keys stay in your MCP config. The server reads them from its environment, reports only whether each variable is set, and never writes secrets anywhere.
Local only. Talks to your brokers directly over HTTPS and to your MCP client over stdio. No LuxAlgo server involved, no telemetry.
Still: scope every key read-only at the broker, and treat your MCP config file like the secret store it is.
Development
pnpm install && pnpm check && pnpm buildThe SDK dependency installs from the public npm registry like any other package.
Disclaimer
This software reports what your broker reports. It is not investment advice. Verify important numbers against your broker's own statements.
License
MIT © LuxAlgo
Available Tools
6 toolsget_positionsA
Open positions across all accounts (symbol, quantity — negative means short — and market value in the account currency when the broker prices it). Optionally filter by broker id.
| Name | Required | Description | Default |
|---|---|---|---|
| broker | No | Broker id to filter by, e.g. 'alpaca' or 'kraken' |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure. It explains that negative quantity means short, and notes market value is included 'when the broker prices it', acknowledging variability. However, it does not mention whether this is a read-only operation, any error conditions, or pagination, which would be expected without annotation support.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that front-loads the core action and then adds relevant field details and the parameter. Every part earns its place; there is no waste or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with one optional parameter and no output schema, the description adequately covers the purpose, parameter, and key output semantics. It does not explicitly state that the result is a list or how errors are handled, but these are minor given the tool's simplicity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already covers the single optional 'broker' parameter with a description and example. The description only reinforces its optionality ('Optionally filter by broker id') without adding extra meaning, so it remains at the baseline for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves open positions across all accounts, specifying the fields returned (symbol, quantity, market value) and the meaning of negative quantity. This distinguishes it from siblings like get_trades (trade history) and get_stats (statistics) without ambiguity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use it (for positions) but provides no explicit guidance on when not to use it or alternatives. It does not mention sibling tools or situations where another tool would be more appropriate, leaving the agent to infer based on the action and resource.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_statsA
Computed performance stats across the whole portfolio: total equity, equity by broker, top positions, and FIFO-matched trade stats (win rate, average win/loss, realized PnL, per-symbol breakdown). Amounts are in each account's native currency — mixed-currency totals are approximate.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of disclosing behavior. It discloses key traits: computation is FIFO-matched, amounts are in native currency, and mixed-currency totals are approximate. It also implicitly indicates a read-only nature. However, it does not explicitly state read-only status, mention any rate limits, or clarify whether the 'top positions' are sorted by value or quantity. The currency and approximation notes add valuable transparency beyond a simple 'get stats'.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, information-dense sentence that front-loads the core purpose and then specifies the exact metrics. The trailing note about currency handling is relevant and concise. There is no filler or repetition. Every clause adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given zero parameters and no output schema, the description provides a solid overview of what the tool returns. It lists all major categories of computed stats and clarifies the currency handling. However, it could be slightly more explicit about the return format (e.g., whether it's a single object or a list) and whether any filtering is possible. For a stateless aggregation tool, this is nearly complete, but not perfectly exhaustive.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so the baseline is 4. The description does not need to add parameter semantics because there are none. The schema coverage is 100% (vacuously), and the description complements the schema by explaining what the output covers. No further parameter information is required.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description explicitly states the resource ('performance stats across the whole portfolio') and enumerates the specific aggregates returned (total equity, equity by broker, top positions, FIFO-matched trade stats, per-symbol breakdown). This clearly distinguishes it from siblings like get_positions and get_trades, which focus on raw data rather than computed summary metrics.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
While the description makes the tool's purpose clear, it does not explicitly state when to use this tool versus alternatives, nor does it mention any exclusions. The usage context is implied as 'for aggregated portfolio stats', but there is no direct guidance on when get_stats should be preferred over get_positions or get_trades. Since the tool takes no parameters, the lack of alternatives guidance is a minor gap.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_tradesA
Trade history across all accounts (the most recent window each broker exposes). Optionally filter by broker id and/or symbol; newest first.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max trades to return (default 100) | |
| broker | No | Broker id to filter by | |
| symbol | No | Symbol to filter by, e.g. 'BTC' or 'AAPL' |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the behavioral burden and does a good job: it discloses the broker-dependent lookback window ('most recent window each broker exposes'), ordering ('newest first'), and all-account scope. It does not describe response shape or pagination, but these are less critical for a read-only history query.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single sentence front-loads the core purpose, then appends temporal scope, filters, and ordering. There is no filler or redundant restatement of the schema.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with three optional, fully documented parameters and no output schema, the description covers the essential invocation facts: what is returned, scope, temporal limitation, filters, and sort order. It could mention trade record fields, but the absence is not a blocker for selecting and calling the tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the schema already documents limit, broker, and symbol. The description adds only 'and/or' filter flexibility and 'newest first' ordering, which is minimal extra value over the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names the resource ('trade history'), scope ('across all accounts'), and key characteristics ('most recent window each broker exposes', 'newest first'). This clearly distinguishes it from sibling tools like get_positions (positions vs history) and list_brokers/list_accounts (metadata vs transactions).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives useful usage context: the tool is for recent historical trades across all accounts, with optional broker and symbol filters. It doesn't explicitly name alternatives or exclusions, but the scope and filters make when to call it reasonably clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_accountsA
List all connected accounts across every configured broker: id, name, broker, currency, total equity, and cash when reported. Uses a short-lived cache; call refresh for live numbers.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It discloses that the tool uses a short-lived cache, meaning data may be stale, and instructs to call refresh for live numbers, which is a behavioral trait not inferable from the name alone. It also lists the return fields.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loading the purpose and return fields before explaining the caching behavior. Every clause earns its place with no filler words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (0 params, no output schema), the description covers all necessary context: what it returns (id, name, broker, currency, equity, cash when reported), the caching behavior, and the alternative for live data. Nothing needed to invoke the tool correctly is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
This tool has zero parameters, so the schema fully documents them (vacuously) with 100% coverage. The description adds no parameter-level information, but none is needed; the baseline for zero-parameter tools is 4.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('List') and a clear resource ('all connected accounts across every configured broker') along with the exact fields returned. This clearly differentiates it from sibling tools like list_brokers, which would list brokers not accounts.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explicitly directs the agent to call refresh for live numbers, providing an alternative for the specific condition of needing up-to-date data. This is a clear when-to-use alternative, matching the high-quality pattern of naming the alternative and the condition.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_brokersA
List every supported broker, the environment variables its credentials go in, and whether it is configured in this server. Values are never shown, only whether each variable is set.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly states that values are never shown, only whether variables are set, which is a key security-relevant behavior. It also implies a read-only check of the server's configuration, though it does not partially ignore the read-only nature explicitly—still, the transparency about not revealing secrets is valuable.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences with no wasted words. It front-loads the primary purpose (list brokers), then adds a crucial caveat about not showing values. Perfectly concise and clear.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter list tool with no output schema, the description adequately conveys what is returned: the list of brokers, their env var names, and configuration status. It omits specific output formatting (e.g., list vs table) but that is minor given the simplicity and the clear security note about not exposing values. Overall, it is complete enough for an agent to call correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, and the schema covers 100% of them (i.e., an empty schema). The description correctly adds no parameter details since there are none. Per calibration, 0 params baseline is 4, and the description is consistent.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description explicitly states the tool lists every supported broker, the environment variables for its credentials, and whether each is configured. The verb 'list' and resource 'brokers' are clear, and the function is distinct from siblings like list_accounts or get_stats, which focus on other data.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description conveys the tool's purpose clearly but does not explicitly state when to use it relative to alternatives or when not to use it. Since it is a zero-parameter list operation with no obvious exclusions, the context is implied but lacks explicit guidance for selection among siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
refreshA
Bypass the cache and re-fetch every configured broker right now. Returns per-broker success/failure.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
There are no annotations, so the description carries the entire burden. It discloses the core behavioral trait (bypassing cache and re-fetching all brokers) and the return format (per-broker success/failure). However, it does not mention side effects such as potential latency, network calls, rate-limit impact, or whether it is read-only. This is a moderate disclosure but leaves out important operational implications for an agent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, well-structured sentence that front-loads the primary action, specifies the scope, and immediately states the output. Every word adds value—'Bypass the cache' sets the key behavior, 're-fetch every configured broker right now' defines scope and urgency, and 'Returns per-broker success/failure' completes the contract. There is no waste or repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with no parameters and no output schema, the description is quite complete. It tells the agent what the tool does, what it operates on, and what it returns. The only missing details are minor—like whether the operation is asynchronous or may take a long time, or whether it can trigger error rates—but these are not critical for correct invocation. The description provides enough context for an agent to use it appropriately.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so the baseline is 4. The description adds no parameter-specific info (as there are none), but it does enrich the overall meaning by clarifying the action and return structure. The schema is trivially covered since no parameters exist, and the description fully compensates for the lack of parameters by explaining the operation’s effect and output.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific action ('Bypass the cache and re-fetch every configured broker right now') and a clear resource scope ('every configured broker'). It also mentions the return type (per-broker success/failure), which distinguishes it from sibling tools like list_brokers or get_stats that focus on listing or retrieving specific data. The purpose is unambiguous and immediately differentiates this tool.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use it (when you want to bypass cache and get fresh data immediately) but does not explicitly contrast with alternatives or state when not to use it. It lacks guidance like 'use this instead of list_brokers when you need current data' or 'avoid if you don't need real-time data.' The phrase 'right now' conveys urgency, but the selection criteria are not spelled out.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
6 tool updates
v0.1.0- First observed
get_positions - First observed
get_stats - First observed
get_trades - First observed
list_accounts - First observed
list_brokers - First observed
refresh
TDQS
Scored across 6 tools
Each tool targets a clearly distinct resource: brokers, accounts, positions, trades, and aggregate stats. The only non-query tool, refresh, is unambiguous and serves as a cache-busting action. There is no overlap or potential for misselection.
Tool names follow a consistent verb_noun pattern (list_brokers, get_positions) with the minor exception of 'refresh', which is a standard imperative verb. The mirroring of list/get for collections versus individual items is predictable and readable.
Six tools is an ideal scope for a broker aggregation server, covering configuration, account status, positions, trade history, and performance analytics. Every tool earns its place without bloat or unnecessary overlap.
The set covers the full read-only lifecycle of a trading portfolio: broker connectivity, account listing, positions, trade history, and aggregated stats. The refresh tool addresses the cache invalidation need, so there are no obvious dead ends or missing functions.
Maintenance
Related MCP Connectors
Trade across 22+ exchanges and brokers from any MCP-capable AI agent, no install required.
Research-only MCP server: your AI as a quant research desk. 90 tools, no trades, no brokers.
Real SEC, 13F, insider, congress & macro data your AI agent can cite. Hosted MCP, 24 tools.
MCP server for OpenMM — exposes market data, account, trading, and strategy tools to AI agents
Related MCP Servers
- AlicenseAqualityDmaintenanceA read-only MCP server that provides access to Charles Schwab account data and market information, including portfolio positions, real-time quotes, options chains, price history, and account balances through AI assistants.9MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that gives AI agents real-time access to DeFi across multiple chains, enabling non-custodial crypto trading, portfolio queries, and transaction execution.5 npm7MIT
- AlicenseNot gradedqualityAmaintenanceMCP server for Interactive Brokers that provides account, portfolio, market data, and risk analysis tools to MCP hosts like Claude Desktop, enabling natural language queries about positions, market regime, and position sizing without placing orders.8MIT
- AlicenseAqualityAmaintenanceAn MCP server that gives AI assistants read access to real brokerage accounts and market data, with 39 tools for prices, technical analysis, SEC filings, and macro indicators, while order execution requires human approval via a separate dashboard.363MIT