How it works
A brake between your agent and your broker.
An ordinary "guardrail" MCP server only advises. Your agent can still call the broker's order tool directly. Brakeline is a proxy: the agent connects only to Brakeline, and Brakeline holds the broker connection. Blocking is enforced, not suggested.
Claude or Cursor
Plans a trade and calls place_order, the same as with any broker MCP.
Checks your rules
Loss limit, size cap, revenge window, buy count, loss streak. Any failure stops the order and says why.
Simulation or Robinhood
Only orders that pass reach the broker. Every verdict goes into the journal.
Selling is never blocked
Rules only stop orders that add risk. Cutting a loss or taking profit always goes through.
The agent can't change the rules
There is no tool for it. Only you change them, in the dashboard, and they apply from the next order.
Every block explains itself
The reply carries the numbers: today's loss, the position's share of equity, minutes left on a cooldown, the max size allowed.
Rules
Five brakes and a kill switch.
The defaults follow common retail risk rules. Change any number in the dashboard, and hit one button to pause every buy.
daily_loss_limitNo new buys once today's loss reaches 3% of your start-of-day equity.
position_sizeNo single position above 5% of equity. A blocked order is told the largest size it may buy instead.
revenge_tradeNo buying a stock back within 15 minutes of selling it at a loss.
max_buys_per_dayCaps overtrading when the agent gets busy.
loss_streak_cooldownThree losing exits in a row pause all new buys for an hour.
kill_switchPause all buys from the dashboard, instantly, until you turn it back on.
reduce_onlySells that reduce a position always pass. Brakeline never traps you in a trade.
See it work
What your agent hears back.
A real run on the simulated $100k account (npm run demo).
› buy 20 AAPL ✔ FILLED @ 228.00 · 4.5% of equity› buy 40 NVDA ✖ BLOCKED position_size: NVDA would be 7.28% of equity, cap 5% (max buy now: 27)› sell 20 AAPL # AAPL fell 6% ✔ FILLED @ 214.32 · pnl -273.60 · reducing risk is always allowed› buy 10 AAPL # right back in ✖ BLOCKED revenge_trade: AAPL was sold at a loss 0 min ago (15 min left)› buy 5 MSFT # you hit "Pause all buys" in the dashboard ✖ BLOCKED kill_switch: a human has paused all buys› sell 25 NVDA ✔ FILLED @ 182.00 · selling still works› buy 5 MSFT # four positions fell 20% ✖ BLOCKED daily_loss_limit: today -3,902.40 (-3.9%), limit -3%
Dashboard
You stay in the driver's seat.
A local dashboard at localhost:5900/app shows every order the agent tried, what got through and why the rest were stopped.
Kill switch
One button pauses all buys. Selling stays open so you can always get out.
Approve each order
Turn on dashboard approval and every order that passes the rules waits for your click before it reaches the broker.
Live budget
Today's loss budget, position sizes and the full journal, refreshed every second and a half.
Install
One line in Claude.
Needs Node 20 or newer. Nothing to clone: npm fetches Brakeline when your AI app starts it.
Claude Code
claude mcp add brakeline -- npx -y brakeline
Claude Desktop / Cursor
// mcpServers in the config file
"brakeline": {
"command": "npx",
"args": ["-y", "brakeline"]
}Dashboard
npx brakeline dashboard
# then open localhost:5900/appFrom source
git clone https://github.com/brakeline-devv/brakeline.git cd brakeline && npm install && npm start
Tools: guard_statusget_accountget_quotecheck_orderplace_orderget_journal · npm · GitHub
Modes
Practice first. Connect later.
Simulation
A simulated $100,000 account that starts from real closing prices for AAPL, MSFT, NVDA, TSLA, AMZN, GOOGL, META, AMD, PLTR, SPY, QQQ, COIN and HOOD. No broker account needed.
Try asking your agent: "Buy 500 HOOD", then "What's my max size?"
Robinhood
Run npm run login once to connect your Robinhood account through Robinhood's own sign-in (OAuth). Brakeline then relays Robinhood's hosted trading MCP: order tools are checked first, everything else passes through unchanged.
Any Robinhood tool Brakeline doesn't recognise as a read, a cancel or an order is refused, so nothing slips past. P&L is estimated from the orders Brakeline forwarded. Not yet tested on a live account.
Let your agent trade. Keep the brakes.
Start in simulation, tune your rules, then connect your broker.
Add to Claude