Skip to main content
Pre-release

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.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spectre-terminal-mcp 0.1.0rc1
File Size Uploaded Provenance Actions
spectre_terminal_mcp-0.1.0rc1.tar.gz 28.4 kB With provenance Details for spectre_terminal_mcp-0.1.0rc1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for spectre-terminal-mcp 0.1.0rc1
File Interpreter ABI Platform Actions
spectre_terminal_mcp-0.1.0rc1-py3-none-any.whl Python 3 none any Details for spectre_terminal_mcp-0.1.0rc1-py3-none-any.whl

Total release size: 55.0 kB

Release files / spectre_terminal_mcp-0.1.0rc1.tar.gz

Download URL spectre_terminal_mcp-0.1.0rc1.tar.gz
Size 28.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f956f19917859a1e063414af3c42dc60aacebe520b03c4e142dadf537744a26c
BLAKE2b-256 checksum
How to use checksums
9ccf3407b32c422b8733ff592495dda3648514a99b39914e73d627c581502474
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 log

Release files / spectre_terminal_mcp-0.1.0rc1-py3-none-any.whl

Download URL spectre_terminal_mcp-0.1.0rc1-py3-none-any.whl
Size 26.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
90b77126625b43013c9d9c8b89e5073edea17259e1a8710a7d22fc026041c6bd
BLAKE2b-256 checksum
How to use checksums
b9dc6a78f9681fa27874377ae942ef1ecc43916f8f65edd938cbb6f3d0ba6c01
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 log

Security for spectre-terminal-mcp 0.1.0rc1

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.

Select from 2 files

Attestation for spectre_terminal_mcp-0.1.0rc1.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 log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page