MCPcopy Create free account
hub / github.com/simstudioai/sim / readJsonRpcBody

Function readJsonRpcBody

apps/sim/app/api/mcp/serve/[serverId]/route.ts:130–138  ·  view source on GitHub ↗
(request: NextRequest)

Source from the content-addressed store, hash-verified

128}
129
130async function readJsonRpcBody(request: NextRequest): Promise<unknown> {
131 assertContentLengthWithinLimit(request.headers, MAX_MCP_SERVE_BODY_BYTES, 'MCP request body')
132 const buffer = await readStreamToBufferWithLimit(request.body, {
133 maxBytes: MAX_MCP_SERVE_BODY_BYTES,
134 label: 'MCP request body',
135 signal: request.signal,
136 })
137 return JSON.parse(buffer.toString('utf-8'))
138}
139
140interface ManagedAbortSignal {
141 signal: AbortSignal

Callers 1

route.tsFile · 0.85

Calls 4

parseMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected