Skip to content

Commit 9465eae

Browse files
committed
Fixed mismatch with sanboxRateLimiter and the express version
1 parent 95aad23 commit 9465eae

4 files changed

Lines changed: 32 additions & 84 deletions

File tree

‎cli/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"test:cli-metadata": "vitest run metadata.test.ts"
2626
},
2727
"devDependencies": {
28-
"@types/express": "^5.0.6",
28+
"@types/express": "^5.0.0",
2929
"tsx": "^4.7.0",
3030
"vitest": "^4.0.17"
3131
},

‎package-lock.json‎

Lines changed: 13 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎server/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"devDependencies": {
2323
"@types/cors": "^2.8.19",
24-
"@types/express": "^4.17.23",
24+
"@types/express": "^5.0.0",
2525
"@types/shell-quote": "^1.7.5",
2626
"@types/ws": "^8.5.12",
2727
"tsx": "^4.19.0",

‎server/src/index.ts‎

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -796,21 +796,25 @@ app.get("/config", originValidationMiddleware, authMiddleware, (req, res) => {
796796
}
797797
});
798798

799-
app.get("/sandbox", sandboxRateLimiter, (req, res) => {
800-
const __filename = fileURLToPath(import.meta.url);
801-
const __dirname = dirname(__filename);
802-
const filePath = join(__dirname, "..", "static", "sandbox_proxy.html");
803-
let sandboxHtml;
799+
app.get(
800+
"/sandbox",
801+
sandboxRateLimiter as express.RequestHandler,
802+
(req, res) => {
803+
const __filename = fileURLToPath(import.meta.url);
804+
const __dirname = dirname(__filename);
805+
const filePath = join(__dirname, "..", "static", "sandbox_proxy.html");
806+
let sandboxHtml;
804807

805-
try {
806-
sandboxHtml = readFileSync(filePath, "utf-8");
807-
} catch (e) {
808-
sandboxHtml = "MCP Apps sandbox not loaded: " + e;
809-
}
808+
try {
809+
sandboxHtml = readFileSync(filePath, "utf-8");
810+
} catch (e) {
811+
sandboxHtml = "MCP Apps sandbox not loaded: " + e;
812+
}
810813

811-
res.set("Cache-Control", "no-cache, no-store, max-age=0");
812-
res.send(sandboxHtml);
813-
});
814+
res.set("Cache-Control", "no-cache, no-store, max-age=0");
815+
res.send(sandboxHtml);
816+
},
817+
);
814818

815819
const PORT = parseInt(
816820
process.env.SERVER_PORT || DEFAULT_MCP_PROXY_LISTEN_PORT,

0 commit comments

Comments
 (0)