Let an AI assistant read your quotes, charts, portfolios and accounts — and place trades — by talking to your running copy of Medved Trader.
MCP (Model Context Protocol) is the standard that AI clients such as Claude Desktop and Claude Code use to call outside tools. Turning on Medved Trader's MCP server publishes MT's data and actions as tools your assistant can use: "What's my P&L on the tech watchlist?", "Chart me AAPL's last 30 days of daily bars", "Cancel my open orders."
The server runs inside Medved Trader and listens on your own machine. Nothing is sent to Medved Trader's servers, and the assistant only sees what it asks for, when it asks.
Read this before you enable it. A key can be granted the ability to place, modify and cancel real orders on any trading account you have started. New keys are read-only until you grant that yourself, so the risk is one you opt into deliberately — but treat every key like a password regardless.
Go to Settings → App → API and find the MCP Server panel.
16240) unless something else on your
machine already uses it.Changing any of these settings — enabling the server, changing the port, allowing local network access, or adding, removing or disabling a key — requires your account password (or your PIN, if you log in with a social login).
The MCP server, like all of Medved Trader's APIs, requires a Premium subscription. A trial subscription includes it.
The server won't start until at least one enabled key exists. Every request has to present a key, so with no keys the port would reject everything — Medved Trader doesn't open it at all.
Each key carries its own set of permissions. Click a key's Access cell to open the picker; tick as many as you need, or use the Read only / Full access presets at the top.
| Access | Lets the assistant |
|---|---|
| Market data | Read quotes, charts, history and option chains. Changes nothing. |
| Portfolios: read | See what's in your portfolios and watchlists, including quantities and cost basis. |
| Portfolios: modify | Add and remove symbols, create portfolios, and change which symbol your linked windows are showing. |
| Accounts: read | Connect accounts and read balances, positions and order history. Cannot send an order. |
| Trading: place orders | Place, modify and cancel real orders. |
| App control | Save, load and rearrange your window layouts, and other app-level actions. |
A new key gets Read only — market data, portfolios and accounts, all read-only. That covers most of what people actually want ("how's my portfolio doing?", "chart me AAPL") without putting anything at risk.
Access is enforced, not just advertised. Tools a key doesn't grant are left out of the list the assistant is given, so a read-only key isn't offered the order tools in the first place — and if a client calls one anyway, the server rejects it. Granting the least you need is a real barrier, not a matter of how carefully you word your requests.
The key list shows each key's nickname, masked value, access, and when it was last used — useful for spotting a key nothing is using any more. Uncheck Enabled to switch a key off while keeping it, or remove it outright. Either takes effect as soon as you apply; a client using that key starts getting rejected immediately. If a key leaks, delete it and add a new one — keys can't be edited or rotated in place.
By default the server only accepts connections from the same computer. Allow MCP connections from local/private network extends that to other machines on your home or office network (10.x, 192.168.x and 172.16–31.x addresses).
Connections are plain HTTP, with no encryption. Off your own machine, the API key travels the network in the clear and anyone who captures it has full access to your accounts. Leave this off unless you need it, and never expose the port to the internet or forward it through a router.
Point the client at http://localhost:16240/mcp and have it send the API key as a
bearer token. Most MCP clients take a config file like this:
{
"mcpServers": {
"medved-trader": {
"url": "http://localhost:16240/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY_HERE"
}
}
}
}
Replace YOUR_API_KEY_HERE with the key you copied, and the port if you changed it. If
your client can't set an Authorization header, it can send the key as
X-API-Key instead.
Medved Trader has to be running for any of this to work. If the client reports the server as unavailable, check that MT is open, that the MCP panel still shows the server enabled, and that at least one key is enabled.
Twenty-eight tools, in four groups. You don't call these yourself — the assistant picks them based on what you ask — but it's worth knowing what's on the table.
| Tool | What it does |
|---|---|
get_quote | Latest quote for one or more symbols — last, bid, ask,
change, volume, day range, 52-week range. Accepts a symbol list, or CURRENT (the active
portfolio window), ACTIVE (all open portfolio windows), or * (everything MT
has data for). |
get_symbol_snapshot | Every field MT tracks for a symbol in one call —
quote, OHLC, 52-week, change, volume and turnover, fundamentals, options open interest and more. Takes
the same symbol inputs as get_quote (a list, or CURRENT / ACTIVE
/ *). |
get_history | Historical OHLCV bars. Intraday by the minute, or daily, weekly, monthly and yearly bars. Can exclude extended hours. |
get_option_chain | Option chain for an underlying — expirations, strikes, calls and puts. |
enum_symbols | Lists the symbols MT currently knows about. |
get_linked_symbol / set_linked_symbol | Reads or sets the
symbol for a link colour group. Setting it retargets every window linked to that colour — the
assistant can drive what your screen is showing — so set_linked_symbol needs
Portfolios: modify access, not just market data. |
get_linked_symbol_colors | Lists the link colour groups. |
| Tool | What it does |
|---|---|
enum_portfolios | Lists your portfolios and watchlists with their IDs. |
get_portfolio_symbols | The symbols in a portfolio; optionally with quantity, cost basis, commission and notes per row. |
add_symbols_to_portfolio | Adds symbols to a portfolio, updates existing rows, or creates a new portfolio. |
remove_symbols_from_portfolio | Removes rows from a portfolio. |
add_portfolio | Creates a new, empty portfolio or watchlist. Takes a name,
and optionally an ID (auto-generated if omitted) and a type (simple, the default, or
watchlist). |
delete_portfolio | Deletes a portfolio and everything in it, by ID. |
| Tool | What it does |
|---|---|
enum_trading_accounts | Lists the trading accounts available to the API. |
start_trading_account / stop_trading_account | Connects or disconnects an account. Nothing else in this group works until the account is started. |
get_account_balances | Cash, buying power, equity and so on. |
get_positions | Open positions. |
get_transactions | Orders and transactions, including order status. |
place_order | Places a real order. Market, limit, stop and stop-limit, single or multi-leg. |
modify_order | Changes an open order — price, quantity, type. |
cancel_order | Cancels one or more open orders. |
get_trade_log | Reads the trade activity log — order placements, fills, partial fills, cancels, rejections and other order-lifecycle events. Read-only, and works without starting the account. Optional filters by account, symbol, activity type and time. |
Order tools send the order and return right away; they don't wait to hear back from the broker. A
successful result means "sent", not "filled" or even "accepted". The assistant has to check
get_transactions to find out what actually happened — and so should you.
| Tool | What it does |
|---|---|
get_app_version | The running application name and version. Available to every key. |
get_layout / set_layout | Reads the current window layout as XML, or replaces it with an edited one — a way to rearrange, open and close many windows at once. Needs App control access. |
save_layout / load_layout | Saves the current layout to a file, or loads a saved one back and applies it. Needs App control access. |
get_layout_commands / set_layout_commands | Reads or sets the
layout commands stored in a saved layout file. These are settings the layout applies every time it
is loaded — for example, “make Schwab the preferred quote source”
(SourcePriority SCHWAB High). save_layout can store them too. Needs
App control access. |
update_charts | Makes open charts recalculate and repaint, optionally only for
one symbol. With drawings set, they also reload their trendlines and other drawings
— for when the drawings were changed from outside Medved Trader. Needs App control
access. |
An assistant cannot close Medved Trader. There is no shutdown tool, and no setting that adds one — starting and stopping the program stays yours alone.
place_order, modify_order and cancel_order. Be wary of
standing "always allow" approvals for the order tools.| Symptom | Cause |
|---|---|
| Client says the server is unreachable | MT isn't running; the server isn't enabled; no enabled key exists; or the client's port doesn't match the one in Settings. |
| Every request comes back unauthorized | The key is wrong, disabled or deleted. Keys can't be recovered — if you didn't copy it, delete the key and add a new one. |
| Enabled the server but nothing is listening | Most often no key has been added yet. The port isn't opened until there's an enabled key. |
| Port won't bind | Another application has it. Pick a different port in Settings and update your client config to match. |
| Another machine can't connect | Allow local/private network access has to be on, and both machines have to be on the same private network. Restart the server after changing it. |
| A quote or history request comes back empty | MT has no data for that symbol. The MCP server reads what MT already has — it doesn't add data feeds or entitlements. |
If you're writing your own MCP client, or want to know exactly what each tool takes and returns, see the MCP Server API Reference. For Medved Trader's other APIs and when to use each one, see Medved Trader APIs.