@mctx-ai/mcp-dev 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/server.js +15 -0
package/package.json
CHANGED
package/src/server.js
CHANGED
|
@@ -249,6 +249,21 @@ export async function startDevServer(entryUrl, port) {
|
|
|
249
249
|
return;
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
+
// Return 404 for OAuth discovery paths so MCP clients (e.g. Claude Code) do not
|
|
253
|
+
// trigger an auth flow. Without this, non-POST requests fall through to the
|
|
254
|
+
// method check below and return 405, which some clients interpret as "auth
|
|
255
|
+
// endpoint exists but wrong method".
|
|
256
|
+
if (req.method === "GET" && req.url && req.url.startsWith("/.well-known/")) {
|
|
257
|
+
res.writeHead(404, { "Content-Type": "application/json" });
|
|
258
|
+
res.end(
|
|
259
|
+
JSON.stringify({
|
|
260
|
+
error: "Not Found",
|
|
261
|
+
message: "OAuth discovery is not supported by this server",
|
|
262
|
+
}),
|
|
263
|
+
);
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
|
|
252
267
|
// Fix #2: If app failed to load initially, return error
|
|
253
268
|
if (!app) {
|
|
254
269
|
res.writeHead(503, { "Content-Type": "application/json" });
|