style: fix formatting in MCP server
This commit is contained in:
@@ -8,9 +8,12 @@ const server = Bun.serve({
|
|||||||
idleTimeout: 0,
|
idleTimeout: 0,
|
||||||
routes: {
|
routes: {
|
||||||
// MCP metadata discovery endpoint
|
// MCP metadata discovery endpoint
|
||||||
"/.well-known/mcp/server-card.json": new Response(JSON.stringify(serverCard), {
|
"/.well-known/mcp/server-card.json": new Response(
|
||||||
|
JSON.stringify(serverCard),
|
||||||
|
{
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
}),
|
},
|
||||||
|
),
|
||||||
|
|
||||||
// MCP JSON-RPC 2.0 protocol endpoint
|
// MCP JSON-RPC 2.0 protocol endpoint
|
||||||
"/mcp": async (req: Request) => {
|
"/mcp": async (req: Request) => {
|
||||||
@@ -19,13 +22,13 @@ const server = Bun.serve({
|
|||||||
}
|
}
|
||||||
return Response.json(
|
return Response.json(
|
||||||
{ message: "MCP endpoint requires POST request" },
|
{ message: "MCP endpoint requires POST request" },
|
||||||
{ status: 405 }
|
{ status: 405 },
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
// Fallback for all other routes
|
// Fallback for all other routes
|
||||||
fetch(req: Request) {
|
fetch(_req: Request) {
|
||||||
return new Response("Not Found", { status: 404 });
|
return new Response("Not Found", { status: 404 });
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user