Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ export async function startServer(): Promise<void> {
export async function startHttpServer(host: string, port: number, mcpServer: McpServer): Promise<void> {
const app = express();

// Parse JSON requests for the Streamable HTTP endpoint only, will break SSE endpoint
app.use("/mcp", express.json());
// Parse JSON requests for the Streamable HTTP endpoint only (this will break SSE endpoints),
// and enforce an explicit body size limit to reduce DoS risk.
app.use("/mcp", express.json({ limit: "1mb" }));

// Modern Streamable HTTP endpoint
app.post("/mcp", async (req, res) => {
Expand Down