Skip to main content
Glama

midas-mcp

An MCP server for the Midas brokerage (atlas.getmidas.com), so an AI assistant can read your portfolio and place orders on BIST and US markets.

Midas has no public API. This server drives the Atlas web app with Playwright: it keeps one authenticated browser session alive and issues the same GraphQL calls the web app itself makes, from inside the page so the session cookies are attached automatically.

This places real orders with real money. Read the safety section before using it.

Tools

Tool

Arguments

What you get

get_portfolio

–

Total value in TRY, today's P/L, cash and buying power per account

get_assets

–

Every open position: quantity, average cost, price, market value, P/L

get_asset_price

symbol, optional currency

Last price, previous close, % change, session status

get_asset_info

symbol

Instrument name, market and description, plus current price

buy_asset

symbol, quantity, optional limit_price

Places a buy order, returns the order id and status

sell_asset

symbol, quantity, optional limit_price

Places a sell order, returns the order id and status

get_pending_orders

symbol

Orders still waiting to execute, with their ids

cancel_order

order_id, symbol

Cancels a pending order

Omitting limit_price places a market order. Symbols are resolved by search, so both tickers (TUCLK) and names work; BIST and US instruments are both supported.

Related MCP server: bcs-mcp

Safety

Every order is checked before it reaches Midas:

  • Value cap — the order's estimated value is converted to TRY (Midas will quote any instrument in TRY) and refused if it exceeds MAX_ORDER_VALUE_TRY, which defaults to 5000. One cap therefore covers both the TRY and USD accounts.

  • Price band — limit prices outside the instrument's daily band are refused locally rather than bounced by the exchange.

  • Position check — sells larger than your sellable quantity are refused.

  • Fractional check — fractional quantities are refused for instruments that don't support them.

cancel_order exists so a mistake can be undone immediately. Note that BIST trades 10:00–18:00 Turkey time; orders placed outside the session queue for the next one, which means they can be cancelled before they ever reach the exchange.

Setup

Requires Node.js 20+.

git clone https://github.com/<you>/midas-mcp.git
cd midas-mcp
npm install
npx playwright install chromium
cp .env.example .env    # then fill in your credentials
npm run build

.env:

MIDAS_PHONE=5XXXXXXXXX      # Turkish mobile number, no country code
MIDAS_PASSWORD=your-password
MAX_ORDER_VALUE_TRY=5000    # refuse any order estimated above this, in TRY
HEADLESS=true

.env and the browser profile in .midas-session/ are both gitignored — they hold your credentials and session cookies, so keep them out of version control.

First login

Midas requires approving a push notification in the Midas mobile app, so the first login has to be interactive:

npm run login          # opens a visible browser, then approve the prompt on your phone

The session is saved to .midas-session/ and reused afterwards, so this is a one-off until the session expires. Only one process can use that profile at a time — stop the MCP server before running npm run login.

Verify it works:

npm run smoke          # prints your portfolio, positions and a quote

Register with Claude Code

claude mcp add midas -- node /absolute/path/to/midas-mcp/dist/index.js

Or, for any MCP client that reads a JSON config:

{
  "mcpServers": {
    "midas": {
      "command": "node",
      "args": ["/absolute/path/to/midas-mcp/dist/index.js"]
    }
  }
}

How it works

src/session.ts launches a persistent Chromium profile and handles login. Auth is entirely cookie-based, so src/api.ts runs each GraphQL request via page.evaluate inside the authenticated page rather than reimplementing the token flow.

Two details are easy to miss when working on this:

  • The API gateway requires an x-midas-rid header. It is a stable per-profile request id generated by the web app, so the session observes it on the app's own requests instead of trying to recompute it.

  • The gateway routes on x-apollo-operation-name, which must be the root field name, not the operation name. When a document's first selection is an alias (as in OverviewAllPositions), the real field name has to be passed explicitly.

Headless Chromium is rejected with a 403 unless it presents a normal user agent and client hints; session.ts sets these.

scripts/ holds the tooling used to map the API, kept for when Midas changes it: browser-daemon.ts (logging browser with a CDP port), analyze.ts (summarise captured GraphQL traffic), dump-panel-bundles.ts (download lazy-loaded chunks), and extract-ops.ts / extract-document.ts (recover GraphQL documents from the minified bundle's embedded AST — introspection is disabled server-side).

Verifying trading end-to-end

src/order-test.ts places one real single-share order and cancels it immediately. It also checks that the value cap rejects an oversized order. It refuses to run without an explicit confirmation:

CONFIRM_REAL_ORDER=yes node dist/order-test.js CANTE 1.08 BUY
CONFIRM_REAL_ORDER=yes node dist/order-test.js TUCLK 4.04 SELL

Pick a limit price at the far end of the daily band so the order cannot fill, and run it while the market is closed for extra margin.

Disclaimer

Unofficial, not affiliated with or endorsed by Midas. It depends on undocumented internal endpoints that can change without notice. You are responsible for every order it places. Use at your own risk.

License

MIT

Available Tools

10 tools
buy_assetA
Destructive

Place a BUY order. Orders whose estimated value exceeds ₺5000 are refused. Omit limit_price for a market order. Note that orders placed outside market hours queue for the next session (BIST trades 10:00-18:00 Turkey time).

Inputs: symbol (required), quantity (required), limit_price.

cancel_orderA

Cancel a pending order by its order id. Use get_pending_orders to find the id.

Inputs: symbol (required), order_id (required).

get_asset_infoA
Read-only

Get descriptive information about an instrument (full name, market, description) together with its current price.

Inputs: symbol (required).

get_asset_priceA
Read-only

Get the current trade price for a symbol, with previous close, percent change and whether the market session is open.

Inputs: symbol (required), currency.

get_assetsA
Read-only

List all open positions (BIST stocks, US stocks, Turkish funds, US options) with quantity, average cost, current price, market value and profit/loss.

Inputs: no named parameters.

get_chartA
Read-only

Get raw OHLCV candles for a symbol (open, high, low, close, volume, timestamp). Use get_technicals for computed indicators; use this only when you need the raw series.

Inputs: symbol (required), limit, interval.

get_pending_ordersA
Read-only

List orders for a symbol that are still waiting to execute, including their order ids for cancellation.

Inputs: symbol (required).

get_portfolioA
Read-only

Get overall portfolio value in TRY, today's profit/loss, and cash balances and buying power for the Turkish (BIST/TRY) and US (USD) accounts.

Inputs: no named parameters.

get_technicalsA
Read-only

Compute a full technical-analysis snapshot for a symbol from its daily price history: RSI(14), SMA/EMA (20/50/200), MACD, Bollinger Bands, ATR and annualized volatility, 52-week range, swing-pivot support/resistance levels, and volume-vs-average. Feed this into the scan scoring formula in CLAUDE.md.

Inputs: symbol (required), interval.

sell_assetA
Destructive

Place a SELL order. Orders whose estimated value exceeds ₺5000 are refused. Omit limit_price for a market order. Note that orders placed outside market hours queue for the next session.

Inputs: symbol (required), quantity (required), limit_price.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 10 tools

    Disambiguation4/5

    Each tool has a clear primary purpose, and the descriptions make boundaries mostly clear. However, get_asset_info and get_asset_price both provide current price information, and get_assets vs get_portfolio could be confused at a glance, though they serve different levels of detail.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with snake_case (get_*, sell_asset, buy_asset, cancel_order). The verbs are simple and predictable, making the API easy to navigate.

    Tool Count5/5

    10 tools is well-scoped for a trading platform MCP, covering portfolio viewing, order placement, order management, and market data. Each tool has a distinct role and none seem redundant or unnecessary.

    Completeness4/5

    The core trading lifecycle is covered: see positions, place orders, cancel pending orders, view quotes, and get technical analysis. Minor gaps include lack of order history (executed trades) and no way to modify an order (though cancel+replace works), and no symbol search, but these are not critical dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      Enables AI assistants to interact with Interactive Brokers trading accounts to retrieve market data, check positions, and place trades. Includes pre-configured IB Gateway and handles OAuth authentication automatically.
      14
      161 npm
      228
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to interact with BCS brokerage accounts for portfolio viewing, quotes, order book, candles, position analysis, and rebalancing planning using natural language, with read-only mode by default and optional trade execution with confirmation.
      15
      13 npm
      2
      Apache 2.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to read a Trading 212 portfolio (balances, positions, orders, history) and place trades via the public API, supporting both demo and live environments.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Connects a brokerage account to AI assistants, enabling portfolio queries, order management, and market data access through natural language.
      MIT