This release is a pre-release and may not be stable for production use.
spectre-terminal-mcp
An MCP server that lets an AI agent — Claude
Code, Claude Desktop, Cursor, any MCP client — read market data from a
running Spectre Terminal on the same machine, and
trade through it. Thin, stdio; built on the spectre-terminal Python client.
pip install spectre-terminal-mcp
Setup
Switch the Local API on in the terminal (Settings App → General → Local API) and copy the token. Then register the server with your client:
Claude Code:
claude mcp add spectre-terminal -e SPECTRE_LOCAL_API_TOKEN=spt_… -- spectre-terminal-mcp
Claude Desktop (claude_desktop_config.json), Cursor and others:
{
"mcpServers": {
"spectre-terminal": {
"command": "spectre-terminal-mcp",
"env": { "SPECTRE_LOCAL_API_TOKEN": "spt_…" }
}
}
}
The server finds the port through the terminal's instance.json and reads
the token from the environment only. It starts even when the terminal is not
running; the first tool call then answers terminal_unreachable.
Tools
| Tool | Answers |
|---|---|
terminal_status |
version, health, stream topics, every connection with id, exchange, market, state |
find_instrument |
the exact exchange:market:symbol for a coin or symbol, best match first |
market_snapshot |
last price, best bid and ask with spread, mark, 24h change and volume |
order_book_top |
top N levels per side, volumes, imbalance |
recent_trades_summary |
buy and sell volume, delta, VWAP, range, largest print over the last N trades |
cluster_summary |
the newest buckets: volume by side, delta, VWAP, the busiest price levels |
candles |
OHLCV rows for an interval |
account_overview |
balances, positions with PnL, open order counts of one connection |
open_orders |
open orders and triggers with the terminal's key and the exchange id |
recent_fills |
the latest fills with buy and sell volume totals |
place_order |
places a limit or market order; needs a client_key; answers "accepted" |
cancel_order |
cancels one order by key or exchange id |
cancel_all_orders |
cancels every order of an instrument |
close_position |
closes a position the way the window does |
leverage |
leverage, its maximum, the terminal's mode and the margin mode of a futures instrument |
place_trigger |
places a stop loss or take profit on the open position, or a stop; needs a client_key |
cancel_trigger, amend_trigger, cancel_all_triggers |
cancel, move or clear trigger orders by their numeric id |
set_leverage, set_margin_mode |
leverage (a number, or max/smart) and cross/isolated |
workspace |
every window with its tabs, stacks and charts; the ids the commands below take |
open_stack, open_tab, open_multiview |
a stack (with a chart if asked) in a new tab or window; a tab with a column per instrument; a coin on every venue of «Exchange layout» |
add_stacks |
instruments added as columns to an existing tab by window and tab id |
set_stack_instrument, close_stack |
re-point or close one stack by widget_id |
close_tab, activate_tab, close_window, activate_window |
tabs by window and tab id, windows by id; the main window and a window's only tab never close |
settings, orderbook_settings |
settings rows as stored; a stack's settings resolved the way the stack sees them, with the level each came from |
update_settings |
writes settings through the Settings App's own path after the terminal checked each change |
Read tools are read-only and idempotent and say so in their annotations; the
ten trading tools, the ten workspace commands and update_settings are
annotated as destructive, so an MCP client may ask the user before each call. Trading answers mean "accepted by the terminal", not
"filled": the outcome is read from open_orders and recent_fills.
Prices and sizes are decimal strings; times are UTC milliseconds plus an ISO
twin. Errors start with a stable code (unauthorized, not_found,
unsupported, rate_limited, terminal_unreachable, …) followed by a
human message. See docs/mcp.md.
Development
cd mcp
python3 -m venv .venv
.venv/bin/pip install -e ../python -e '.[dev]'
.venv/bin/pytest -q
SPECTRE_LOCAL_API_TOKEN=spt_… .venv/bin/python examples/smoke.py # against a running terminal
Metadata
Release files for spectre-terminal-mcp 0.1.0rc2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| spectre_terminal_mcp-0.1.0rc2.tar.gz | 28.6 kB | With provenance | Details for spectre_terminal_mcp-0.1.0rc2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| spectre_terminal_mcp-0.1.0rc2-py3-none-any.whl | Python 3 | none | any | Details for spectre_terminal_mcp-0.1.0rc2-py3-none-any.whl |
Total release size: 55.3 kB
Release files / spectre_terminal_mcp-0.1.0rc2.tar.gz
| Download URL | spectre_terminal_mcp-0.1.0rc2.tar.gz |
|---|---|
| Size | 28.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
80c1f20cc594b6ec9e08c400be398116f658dd2fc402f7af04e598bccd882a8d
|
|
BLAKE2b-256 checksum How to use checksums |
9659fbd3275a51d8e4e7a143fbf18847e867b561bb81cf7d3b9a098c32a72387
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.
Transparency logRelease files / spectre_terminal_mcp-0.1.0rc2-py3-none-any.whl
| Download URL | spectre_terminal_mcp-0.1.0rc2-py3-none-any.whl |
|---|---|
| Size | 26.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d0572b64381fa53425fd19727f0735d8e4021eb386a0789e5286cb294a480e39
|
|
BLAKE2b-256 checksum How to use checksums |
1d27e999ce9b20d32aa2eb13a706d6c0b29439a21275497578a40019a19a5c8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.
Transparency logSecurity for spectre-terminal-mcp 0.1.0rc2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for spectre_terminal_mcp-0.1.0rc2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.