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

Function applyMiddlewares

src/client/middleware.ts:254–258  ·  view source on GitHub ↗
(...middleware: Middleware[])

Source from the content-addressed store, hash-verified

252 * @returns A single composed middleware function
253 */
254export const applyMiddlewares = (...middleware: Middleware[]): Middleware => {
255 return next => {
256 return middleware.reduce((handler, mw) => mw(handler), next);
257 };
258};
259
260/**
261 * Helper function to create custom fetch middleware with cleaner syntax.

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…