@mctx-ai/mcp-dev 1.0.1 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/server.js +20 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mctx-ai/mcp-dev",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Local development server for @mctx-ai/mcp-server with hot reload",
5
5
  "type": "module",
6
6
  "main": "./src/cli.js",
package/src/server.js CHANGED
@@ -117,14 +117,16 @@ function formatError(error, rpcRequest) {
117
117
  }
118
118
 
119
119
  /**
120
- * Create Request-like object compatible with app's fetch handler
120
+ * Create Request-like object compatible with app's fetch handler.
121
+ * headers must be a Headers instance (not a plain object) so that
122
+ * request.headers.get(...) works in packages/server/src/server.js.
121
123
  */
122
124
  function createRequest(body) {
123
125
  return {
124
126
  method: "POST",
125
- headers: {
127
+ headers: new Headers({
126
128
  "content-type": "application/json",
127
- },
129
+ }),
128
130
  async json() {
129
131
  return body;
130
132
  },
@@ -247,6 +249,21 @@ export async function startDevServer(entryUrl, port) {
247
249
  return;
248
250
  }
249
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
+
250
267
  // Fix #2: If app failed to load initially, return error
251
268
  if (!app) {
252
269
  res.writeHead(503, { "Content-Type": "application/json" });