MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / readJsonRpcEnvelope

Function readJsonRpcEnvelope

apps/cloud/src/mcp/telemetry.ts:130–138  ·  view source on GitHub ↗
(request: Request)

Source from the content-addressed store, hash-verified

128const decodeElicitationReplyResult = Schema.decodeUnknownOption(ElicitationReplyResult);
129
130const readJsonRpcEnvelope = (request: Request): Effect.Effect<Option.Option<JsonRpcEnvelope>> =>
131 Effect.tryPromise({
132 try: () => request.clone().text(),
133 catch: () => undefined,
134 }).pipe(
135 Effect.map((text) => (text ? decodeJsonRpcEnvelopeString(text) : Option.none())),
136 Effect.catchCause(() => Effect.succeed(Option.none())),
137 Effect.withSpan("mcp.request.read_json_rpc"),
138 );
139
140// Managed-cloud capture of the executed script, on the `mcp.request` span
141// beside the client fingerprint. This module is cloud-only by construction —

Callers 1

annotateMcpRequestFunction · 0.85

Calls 2

textMethod · 0.65
cloneMethod · 0.65

Tested by

no test coverage detected