spectro-kernel / web playground

Point this page at a running spectro-mcp server, give it a spectrum reachable by URL, run an algorithm. The page is intentionally tiny: it speaks the MCP streamable-HTTP protocol (JSON-RPC over POST /mcp) straight from your browser, nothing is proxied through spectrokernel.io.

1. Connect to a spectro-mcp server

Public server: https://orca-app-tihvs.ondigitalocean.app/mcp (open, 60 requests/min per IP). Local: http://localhost:8000/mcp.
Sent as X-API-Key. The public server needs none.
not checked

Run one locally with pip install "spectro-kernel[mcp]" then SPECTRO_MCP_ALLOW_ANONYMOUS=1 spectro-mcp --http --port 8000. A browser can only call a server that answers CORS pre-flights; if yours does not, put it behind a reverse proxy that adds the headers, or drive it from Claude instead (the connector path has no CORS constraint).

2. Choose a spectrum

Default: the CALSPEC solar model. It spans 1500 Å to 3 000 000 Å, so the crop below keeps the visible window.
The public server refuses local paths by design; it never sees your disk.
Pre-processing

3. Run an algorithm

Output

(idle - pick an action above)
How this page talks to spectro-mcp

The server speaks MCP over streamable HTTP. This page hand-rolls the client (see rpc() in the source):

  1. initialize - the response carries an Mcp-Session-Id header that every later request repeats, then a notifications/initialized notification.
  2. tools/call create_session - returns a session_id (this one is spectro-kernel's own, it keeps a WorkContext alive between calls).
  3. tools/call load_spectrum_from_url (or load_spectrum with a server-side path).
  4. One or more algorithm tools (snr_der, normalize_polynomial, fit_gaussian_line, ...) - each takes {session_id, params}.

Responses arrive as JSON or as a text/event-stream body; both are parsed. For a richer client (parameter forms, previews, plots) see the multi-star viewer cookbook.