brokerlinkv0.4.3GitHub

Overview

brokerlink is a free, open-source Chrome extension and local MCP server that lets Claude, Codex, Gemini and other AI tools read your own PhillipCapital MobilG brokerage account through your logged-in browser tab.

Unofficial. Not affiliated with PhillipCapital. For your own account only. Not investment advice.

  • Nothing to configure after login: the session is read inside your tab at call time.
  • The session never leaves the browser tab.
  • The tab is never opened or reloaded by brokerlink.
  • Every call is checked against one allowlist, twice.

Popup tour

The images use sample data, not a real account. The popup is in Turkish; each part is explained below.

1. Portföy (portfolio)

1. Portföy (portfolio)

Read live from your MobilG tab every time you open the popup.

  • Top right: two status dots: the local daemon ("sunucu") and the logged-in MobilG tab.
  • Table: symbol, quantity (Adet), average cost (Maliyet), last price (Fiyat), today's change (Gün), and, in the tinted block, total profit/loss in TL (K/Z) and in percent against your cost.
  • The K/Z and % pair of each row has a border coloured on a scale from red (−15 % or worse) to green (+15 % or better).

2. Derinlik (depth)

2. Derinlik (depth)

One card per position.

  • Alış / Satış: best bid and ask; Makas is the spread.
  • Bar: where the price sits between today's floor (Taban) and ceiling (Tavan).
  • Kademeler (ladder): up to ten bid and ask levels with quantity bars and a buy/sell balance, then the last trades (time, lots, price).
  • Derinlik grafiği (depth chart): cumulative buy quantity to the left of the mid price and sell quantity to the right, as on crypto exchanges.
    Cumulative depth chart
  • Levels and the depth chart appear only if your account has a depth licence; otherwise the card says so and shows the best bid/ask and the last trades.

3. Grafik (charts)

3. Grafik (charts)

Candlestick charts for your positions, drawn from MobilG's own chart feed (the data behind its TradingView chart). Nothing is loaded from third parties.

  • Period: 1 saat (hour), 1 gün / 3 gün (days), 1 hafta / 2 hafta (weeks), 1 ay / 2 ay / 3 ay / 6 ay (months), YTD, 1 yıl (year). The bar size is chosen to fit the period.
  • Type: Mum (candles), Çizgi (line), Alan (area).
  • Indicators: MA 7, MA 25, MA 99, EMA 20, Bollinger Bands and VWAP on the price; Hacim (volume), RSI 14 and MACD in their own strips below. Up to five can be on at once; each chip takes the colour of its line.
  • Your choices are remembered.
  • Top right of each card: last price and the change over the shown range.

4. Emirler (orders): approval

Emirler: approval

Orders queued by an AI client wait here.

  • Card: the exact order: side, symbol, quantity, price, type and total.
  • Onayla / Reddet: approve sends it to MobilG; reject drops it. The AI is told which one you chose.
  • Emirler açık: master switch. Off = every order tool is refused.
  • The tab label shows how many orders are waiting.

5. Emirler: Onaysız gönderim (send without approval)

3. Emirler: Onaysız gönderim (send without approval)

Off by default. While on, small limit orders skip the approval click.

  • Switch: asks for confirmation and shows the minutes left.
  • Emir başına sınır: largest single order in TL.
  • Günlük sınır: total per day in TL.
  • Açık kalma süresi: hours until it switches itself off. It also ends when the browser restarts.
  • Market orders and anything above the limits still wait for your click. The two limits also apply to approved orders.

6. Geçmiş (history)

4. Geçmiş (history)

Every order that passed through the extension, newest first, eight per page.

  • ✓ / ✕: accepted by MobilG or not.
  • How: sent with your approval, sent without approval, or rejected by you.
  • Last line: time and MobilG's own answer, for example why an order was refused.

7. Yenilikler (what's new)

5. Yenilikler (what's new)

Opens when you click the version label next to the name. Release notes for each version and the time of the last update check. When a newer version exists a banner with a Güncelle (update) button appears at the top; if a release is marked as required, the popup locks until you update.

Quick start

git clone https://github.com/nsozturk/brokerlink.git && cd brokerlink
pip install -r requirements.txt
python3 server/brokerlink.py serve
  1. Chrome, Edge, Brave: chrome://extensions → Developer mode → Load unpacked → extension/. Firefox 121+: build with python3 scripts/package.py, load dist/brokerlink-firefox-*.xpi from about:debugging, then click İzin ver in the popup. Ready-made zip, crx and xpi files are attached to each release.
  2. Open MobilG and log in as usual.
  3. Register the stdio MCP server in your client.

Connect an AI client

claude mcp add --scope user brokerlink -- python3 /path/server/brokerlink.py mcp
codex mcp add brokerlink -- python3 /path/server/brokerlink.py mcp
# Antigravity (eski adıyla Gemini CLI)
agy mcp add brokerlink python3 /path/server/brokerlink.py mcp
// Antigravity (eski adıyla Gemini CLI): ~/.gemini/settings.json
"mcpServers": {"brokerlink": {"command": "python3", "args": ["/path/server/brokerlink.py", "mcp"]}}
// OpenCode: opencode.json
"mcp": {"brokerlink": {"type": "local", "command": ["python3", "/path/server/brokerlink.py", "mcp"]}}

MCP tools

ToolPurpose
catalog()List endpoints and parameters
read(name, params)Call a read endpoint
write(name, params, body)Follow lists and price alarms
place_order / cancel_order / amend_order / order_resultQueue an order action for human approval

Endpoint catalog

NameParamsWhat
portfoliodatePositions, cost, P/L, cash balances (T/T+1/T+2), credit limit. date=YYYY-MM-DD
overall_historystartDate, endDatePortfolio value history (chart data)
bank_statementstartDate, endDateCash account statement (movements). Dates YYYYMMDD
stock_extractstartDate, endDateSecurities (lot) movements. Dates YYYYMMDD
executed_transactionsstartDate, endDate, symbolIdExecuted trades over a date range (no 10-day limit). Dates YYYYMMDD. Omit symbolId for all symbols (an empty string is rejected with 400)
transaction_result_formtransactionDateDaily trade confirmation (işlem sonuç formu). YYYYMMDD
stoppage—Withholding tax (stopaj) summary
stoppage_detailinstrumentWithholding tax detail for one instrument
order_trackingchainOrderActive, realizedDetail, retTypeToday's equity orders (all channels). Defaults chainOrderActive=1 retType=2
synthetic_orders—Waiting conditional (synthetic) orders
synthetic_order_logssymbolId, startDate, finishDateConditional order history. Dates DD/MM/YYYY
order_summarytransactionDateOrder summary info for a day
sub_markets—Sub-markets the account may trade
gmo_positionsretTypeForeign (GMO) positions
price_infosymbolId, symbol, market, buyCell, detailBid/ask, floor/ceiling, limit, sellable balance, cost, gross settlement flag
current_pricesymbolId, stock, marketCurrent price
depthsymbolIdOrder book snapshot: b0..b4 bid px, w0..w4 bid qty, a0..a4 ask px, v0..v4 ask qty, k0..k4 order counts (levels = depth licence)
last_tradessymbolIdRecent trades tape: price, quantity, time
akdstockCodeBroker distribution (AKD). Empty without AKD licence
metricssymbol, type52w high/low, returns, avg volume, valuation metrics
stock_detailsymbolCompany / instrument detail
stock_listtype, buySell, shortSellAll instruments with symbolId (sid), market, prices. type=dashboard shortSell=0
highlights—Highlighted symbols
model_portfolio—Broker model portfolio
stock_reportspage, symbolResearch reports list
stock_report_detailidOne research report
foreign_pricestockForeign stock price
depth_stepshighPrice, lowPrice, stepPrice, selectedPricePrice ladder steps between two prices
stock_messagesmarketMarket/session notices
follow_lists—Follow lists (watchlists) and their symbols
kap_for_symbolsymbolKAP disclosures for a symbol
kap_notificationsreadStatusUser's KAP notifications
news_categories—News categories
newscategoryId, pageNews list
price_alarms—Price alarms
position_notifications—Fill / position notifications
messagesreadStatusBroker messages
ai_profile—AI trading authorization profile (read only)
ai_pendingcustomer_noPending AI order confirmations (read only)
viop_overalltransactionDateVIOP overall
viop_orders—VIOP orders
viop_executedstartDate, endDate, rptId, sessionId, contractVIOP executed
viop_account_extractstartDate, endDateVIOP account extract
viop_cash_movementsstartDate, endDateVIOP cash movements
viop_pnlstartDate, endDateVIOP P/L report
viop_pricesymbolIdVIOP contract price
viop_collateral_balance—VIOP collateral balance
viop_collateral_reportstartDate, endDateVIOP collateral report
t0_reportstartDate, finishDateT+0 usage report
t0_price_tables—T+0 price tables
transfer_in—Incoming securities transfers (virman)
transfer_out—Outgoing securities transfers
credit_info—Credit info
eft_historystartDate, FinishDate, statusEFT history (read only; no transfer endpoints exist here)
fx_balancepageTypeForeign currency balances
fx_rates—FX rates
foreign_summary—Foreign shares account summary
foreign_historystartDate, endDate, sessionIdForeign shares history
foreign_derivativestartDate, endDate, rptIdForeign derivatives
public_offeringsrequestTypeOpen public offerings (halka arz)
public_offering_requestspublicOfferingId, requestType, allPublicOfferingsYour public offering requests
fund_types—Fund types
fund_founders—Fund founders
fund_listfundTransactionPlace, fundType, fundBuilderCodeFunds
fund_requests—Your fund requests
fund_sale_list—Fund sale list
server_time—Server time
chart_historysymbol, resolution, from, to, session, menkultype, descriptionOHLCV candles (TradingView UDF). resolution 1,5,15,60,1D...; from/to unix seconds

Safe writes

NameWhat
follow_addAdd a symbol to a follow list
follow_deleteRemove a symbol from a follow list
follow_reorderReorder a follow list
list_addCreate a follow list
list_updateRename a follow list
list_deleteDelete a follow list
alarm_addAdd a price alarm
alarm_deleteDelete a price alarm

Orders and safety

Orders are on by default with a switch in the popup. An order from an AI is only queued; it is sent when you click Onayla (approve) in the popup. Caps: max_order_try 2,500 TL, max_daily_try 10,000 TL.

Auto-send ("Onaysız gönderim")

A separate card in the popup, off by default. While on, limit orders, amendments and cancels below your own limits (per order, per day) are sent without asking, for the number of hours you choose; it also ends when the browser restarts. Market orders and larger orders still wait for a click. An agent steered by text it reads elsewhere can then trade real money within those limits.

History and notifications

Every order gets a notification with MobilG's answer and a line in the popup's history tab.

Never included: EFT, transfers, FX conversion, collateral moves, login, password, settings, AI-authorization switches.

Placing an order

Experimental: test with one lot and a far-away limit price first.

  1. Check the switch in the popup ("Emirler açık").
  2. Find the instrument: read("stock_list", {"type":"dashboard","shortSell":"0"}) → sid and the code with suffix, e.g. GARAN.E.
  3. Look at the price: read("price_info", …) for bid, ask, floor, ceiling; read("depth", {"symbolId": sid}) for the order book.
  4. Queue the order: place_order(symbolId, stock, side, quantity, price); optional type limit|market, tif day|ioc. The reply says awaiting_user_approval; nothing is sent yet.
  5. Approve in the browser: open the popup, read the preview, click Onayla (approve) or Reddet (reject) in the Emirler tab.
  6. The AI gets the outcome: the call waits (50 s by default) and returns outcome: sent_to_broker (with broker order id and message), rejected_by_user, refused_by_broker or awaiting_user_approval (ask again with order_result(id)).
  7. Follow it: read("order_tracking").

Change or cancel a working order with amend_order(orderId, oldPrice, oldAmount, newPrice, newAmount) and cancel_order(orderId); both need the same click.

RefusalMeaning
orders are disabledThe popup switch is off
exceeds max_order_try / daily cap reachedAbove the limits set in the popup (2,500 TL per order, 10,000 TL per day by default)
409No logged-in MobilG tab
426Extension update required

Architecture

AI client --stdio MCP--> brokerlink.py mcp --HTTP--> brokerlink.py serve (127.0.0.1:18890)
                                                      ^ long-poll
                         Chrome extension --executeScript--> logged-in MobilG tab

Raw responses are stored in data/raw.sqlite with session fields redacted.

Updates

The daemon runs one git fetch every 3 hours. The popup lists what is new and has an Update button (pull + reload). A release may set min_supported to force older builds to update.

Troubleshooting

SymptomCause and fix
timed outStart python3 server/brokerlink.py serve; the popup must show Daemon "running"
409No logged-in MobilG tab in this Chrome profile
401 / 403 from MobilGThe session ended (often after a page reload). Log in again
426Popup → Update
Orders "disabled" but the switch is onYour AI client holds an old MCP process; restart the client
depth returns zerosMarket closed or no depth licence
metrics returns zerosIt only covers foreign stocks

Privacy

Leaves your machine: calls to MobilG from your own tab and one git fetch every 3 hours. No analytics. Responses are stored locally in data/raw.sqlite with session fields redacted.

AI agent integration

Repo rules: AGENTS.md. Paste-in rule for your assistant: GLOBAL_AGENT_RULE.md. Machine summary: llms.txt.

FAQ

Do I have to copy tokens or cookies after logging in?

No. The extension reads the session inside the MobilG tab at the moment of each call, so it works as soon as you are logged in.

Can an AI place trades with this?

An agent can only queue an order; a person must click Approve in the extension popup, and a popup switch turns orders off entirely.

Can it withdraw or transfer money?

No. Money-out and transfer endpoints are on a deny list in both the daemon and the extension.

Does it work with claude.ai or ChatGPT in the browser?

No. Cloud chat apps cannot reach a localhost server. Use a local client such as Claude Code, Codex, Antigravity (eski adıyla Gemini CLI), OpenCode, Cursor or Claude Desktop.

Is it an alternative to Phillip Intelligence?

It complements it. Phillip Intelligence is the official MCP for claude.ai and ChatGPT; brokerlink is an unofficial read-first bridge for local AI clients.