MCP server
Give Claude Code, Cursor, Claude Desktop and Codex the live record. Hosted (streamable HTTP) or local (stdio).
The Langbot MCP server (spec 2026-07-28) exposes the record and your local agent runtime (langbot run) as tools and resources. The MCP server and the SDKs are MIT-licensed; Langbot itself is a hosted, closed-source service.
- Hosted:
https://mcp.langbot.ai/mcp— streamable HTTP, OAuth 2.1 orAuthorization: Bearer lb_… - Local:
uvx langbot-mcp— stdio; envLANGBOT_API_URL,LANGBOT_API_TOKEN
Install
npx langbot init # detects Claude Code / Cursor / Claude Desktop and installslangbot mcp install claude-code # or one client at a timelangbot mcp install cursorlangbot mcp install claude-desktopClaude Code (by hand)
claude mcp add langbot -e LANGBOT_API_URL=https://api.langbot.ai -e LANGBOT_API_TOKEN=lb_... -- uvx langbot-mcpCursor / Claude Desktop / Codex (config JSON)
{ "mcpServers": { "langbot": { "command": "uvx", "args": ["langbot-mcp"], "env": { "LANGBOT_API_URL": "https://api.langbot.ai", "LANGBOT_API_TOKEN": "lb_..." } } }}Hosted (no local install)
{ "mcpServers": { "langbot": { "type": "http", "url": "https://mcp.langbot.ai/mcp", "headers": { "Authorization": "Bearer lb_..." } } }}The dashboard at /app/mcp renders these with your token filled in.
Tools
| tool | what it does |
|---|---|
list_live_events() | live + upcoming events with sources and markets |
list_markets(query, venue?) | search open mention / live-event markets |
get_market_rules(ticker) | the venue's rules text and our compiled phrase rules |
subscribe_phrases(event_id, phrases[]) | subscribe this session to phrase hits |
get_transcript(event_id, since_seq?) | rolling transcript with word timestamps |
get_recent_events(event_id?, phrases?, limit) | recent events from the archive |
get_latency_stats() | the latency board |
watch_event(event_id, phrases?, max_wait_s=30, cursor?) | long-poll for new phrase hits with their verdicts (see Live push) |
draft_strategy(thesis) | LLM drafts a Strategy file from a natural-language thesis — you review it |
backtest_strategy(code, event_ids[]) | replay archived words + order-book snapshots at original timestamps |
run_paper(strategy_path) | asks your local agent runtime (127.0.0.1:8787) to run it in demo mode |
Terminal tools
The calendar → context → history workflow, described step by step in The terminal for agents.
| tool | what it does |
|---|---|
get_calendar(days=7) | upcoming and live events with sources, markets, speaker_keys and rights |
get_market_context(ticker) | market, rules, settlement source, current book, base rate for its speaker and phrase, the event it belongs to, recent mentions |
get_base_rates(speaker?, phrase?, series?, window_days=365) | yes rate, counts, by-month series, average open and close, mispricing |
search_outcomes(speaker?, phrase?, series?, since?, until?, limit=50) | settled mention markets from the venue's public record |
search_mentions(speaker?, phrase?, since?, until?, limit=50) | Langbot's own phrase_detected facts: phrase, speaker, event, t_spoken, lead, tickers. Never transcript text |
list_speakers(q?) | canonical speaker profiles with market counts |
On restricted sources (issuer earnings calls, broadcaster feeds) get_transcript and get_recent_events return phrase facts only; see Legal.
Resources
langbot://events/{event_id}/hits(subscribable): every phrase hit on the event, each with its verdictlangbot://markets/{ticker}/state(subscribable): said, counts, mention k of N, last hit, verdictlangbot://events/livelangbot://events/{id}/transcriptlangbot://markets/{ticker}/brieflangbot://latencylangbot://calendarlangbot://context/{ticker}
Live push
Subscribe to langbot://events/{event_id}/hits or langbot://markets/{ticker}/state and the
server sends notifications/resources/updated for that URI the moment a matching phrase is
heard; read the resource for the latest state. Every hit carries its verdict: Langbot's
reading of the market rules for that hit (counts, reason, role, mention, needed), or
null when there is none. A verdict is never a settlement.
| your client speaks | subscribe with |
|---|---|
| MCP 2025-11-25 or older | resources/subscribe / resources/unsubscribe |
| MCP 2026-07-28 | subscriptions/listen with resource_subscriptions: [uri] |
| neither | watch_event(event_id, phrases?, max_wait_s=30, cursor?) in a loop, passing back the cursor it returns |
Push works over stdio and the hosted server alike. watch_event needs a token and waits at most
60 seconds per call; timed_out: true just means nothing new was said.
Why run_paper talks to your own machine
Execution never runs on our servers. run_paper forwards to langbot run's HTTP API on loopback, so orders are placed by a process on your machine with your keys. Nothing live runs without you switching --mode live yourself.