浏览代码

feat(http): keep /search as alias for /query

Tobi Lütke 3 月之前
父节点
当前提交
07421de55f
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/mcp.ts

+ 2 - 2
src/mcp.ts

@@ -560,8 +560,8 @@ export async function startMcpHttpServer(port: number, options?: { quiet?: boole
       }
 
       // REST endpoint: POST /search — structured search without MCP protocol
-      // REST endpoint: POST /query — structured search without MCP protocol
-      if (pathname === "/query" && nodeReq.method === "POST") {
+      // REST endpoint: POST /query (alias: /search) — structured search without MCP protocol
+      if ((pathname === "/query" || pathname === "/search") && nodeReq.method === "POST") {
         const rawBody = await collectBody(nodeReq);
         const params = JSON.parse(rawBody);