|
| 1 | +diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.d.ts b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.d.ts |
| 2 | +index 7746e82..824b80f 100644 |
| 3 | +--- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.d.ts |
| 4 | ++++ b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.d.ts |
| 5 | +@@ -17,6 +17,8 @@ export interface CreateMcpExpressAppOptions { |
| 6 | + * to restrict which hostnames are allowed. |
| 7 | + */ |
| 8 | + allowedHosts?: string[]; |
| 9 | ++ /** Controls the maximum request body size. */ |
| 10 | ++ limit?: string; |
| 11 | + } |
| 12 | + /** |
| 13 | + * Creates an Express application pre-configured for MCP servers. |
| 14 | +diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.js |
| 15 | +index a23a57b..0ad4703 100644 |
| 16 | +--- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.js |
| 17 | ++++ b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.js |
| 18 | +@@ -24,9 +24,9 @@ import { hostHeaderValidation, localhostHostValidation } from './middleware/host |
| 19 | + * ``` |
| 20 | + */ |
| 21 | + export function createMcpExpressApp(options = {}) { |
| 22 | +- const { host = '127.0.0.1', allowedHosts } = options; |
| 23 | ++ const { host = '127.0.0.1', allowedHosts, limit } = options; |
| 24 | + const app = express(); |
| 25 | +- app.use(express.json()); |
| 26 | ++ limit ? app.use(express.json({ limit })) : app.use(express.json()); |
| 27 | + // If allowedHosts is explicitly provided, use that for validation |
| 28 | + if (allowedHosts) { |
| 29 | + app.use(hostHeaderValidation(allowedHosts)); |
0 commit comments