MCP Runtime Reference

Package entries
| Entry | Purpose |
|---|---|
@tradescript/chart-mcp/browser | Browser attachment, WebMCP, chat tools, gateway client, Agent Console controller |
@tradescript/chart-mcp/server | In-process MCP server composition |
@tradescript/chart-mcp/server/stdio | Local stdio transport and loopback bridge |
@tradescript/chart-mcp/server/hosted | Customer-operated HTTP/WSS gateway and session-store contracts |
@tradescript/chart-mcp/server/websocket | Browser bridge transport |
The package binaries are tradescript-chart-mcp for local stdio and
tradescript-chart-mcp-hosted for a customer-operated gateway process.
The hosted binary requires
TRADESCRIPT_MCP_GATEWAY_MODULE=./customer-gateway.mjs; that local module must
export createTradeScriptSelfHostedGatewayOptions() and return production
gateway options containing the customer's store, identity, authorization,
rate-limit, audit, origins, URLs, and limits. Startup fails instead of selecting
an anonymous or in-memory runtime when this contract is missing. Relative
module paths resolve from the process working directory.
Stable tools
Standard MCP and WebMCP expose six stable tools:
tradescript_get_contexttradescript_list_controlstradescript_calltradescript_batchtradescript_subscribetradescript_snapshot
The self-hosted MCP server additionally exposes tradescript_pair_session for
one-time browser-session binding. Hundreds of chart and terminal operations are
catalog controls discovered through tradescript_list_controls; they are not
hundreds of top-level MCP tool schemas.
Customer-hosted routes
| Route | Purpose |
|---|---|
/mcp | Authenticated MCP transport |
/bridge | Exact-origin browser WebSocket bridge |
/sessions | Authenticated issue and revoke operations |
/sessions/rotate | Authenticated atomic browser-token rotation |
/healthz | Process liveness |
/readyz | Store, routing, and serving readiness |
Legacy demo route names are deprecated for one compatibility release and must not be used in new integrations.
All external request and response bodies are validated. Errors use stable codes and safe messages; stack traces, credentials, prompt content, and unbounded tool results are not returned.
Related pages
- Controls and resources explains dynamic discovery through the six stable tools.
- Deploy MCP on customer infrastructure defines the production gateway requirements.
- Configure an MCP client provides loopback, remote, and WebMCP client examples.