Wraith.Kiro.Bridge (Wraith v0.1.0)

View Source

The studio's MCP bridge, ported from shadow_corp: how the agent reaches the site's tools without any public endpoint or secret in the VM.

KAS ─http─▶ shim 127.0.0.1:8090/mcp/studio ══WS (Phoenix dials :8080/bridge)══▶ Studio.Server ─▶ handle/2

The shim turns each HTTP request into a JSON-RPC request on the bridge WebSocket (bridge/http, params %{method, path, headers, body}); we answer with handle/2's %{status, headers, body}.

The one route is POST /mcp/studio, served by Wraith.Studio.Tools. The request must carry the bearer token (token/0, an HMAC under the endpoint's secret) that only appears in the agent's definition; a wrong one is 403 (not 401: a WWW-Authenticate: Bearer makes KAS start OAuth against us).

Summary

Functions

The URL KAS uses for the studio's tools (inside the VM).

Functions

handle(context, req)

@spec handle(term(), map()) :: %{status: integer(), headers: map(), body: String.t()}

headers()

token()

url()

The URL KAS uses for the studio's tools (inside the VM).