MCPcopy Create free account
hub / github.com/modelcontextprotocol/typescript-sdk / createMiddleware

Function createMiddleware

src/client/middleware.ts:318–320  ·  view source on GitHub ↗
(handler: (next: FetchLike, input: string | URL, init?: RequestInit) => Promise<Response>)

Source from the content-addressed store, hash-verified

316 * @returns A fetch middleware function
317 */
318export const createMiddleware = (handler: (next: FetchLike, input: string | URL, init?: RequestInit) => Promise<Response>): Middleware => {
319 return next => (input, init) => handler(next, input as string | URL, init);
320};

Callers 1

middleware.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…