kentcdodds / kentcdodds/cloudflare-remote-mcp-server

401 When attempting to connect in MCP Inspector

Open
#1 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
15
Forks
2
PR merge metrics
No merged PRs in 30d

Description

## Issue description

When attempting to connect via the MCP Inspector, server throws a 401 stopping from actually having a valid connection and progressing through the steps to test locally.

## Steps to reproduce
- As stated run `npx nx dev remote-mcp-server`
- Initialise the inspector as documented: `npx @modelcontextprotocol/inspector`
- Update the transport type and url as recommended in the readme and via http://localhost:8787/
- "switch the Transport Type to `SSE` and enter `http://localhost:8787/sse` as the URL"
- Attempt to connect and get 401.

## Logs

**server**
```
> wrangler dev

⛅️ wrangler 4.16.0
-------------------

Your Worker and resources are simulated locally via Miniflare. For more information, see: https://developers.cloudfl
are.com/workers/testing/local-development.

Your Worker has access to the following bindings:
- Durable Objects:
- MCP_OBJECT: MyMCP
- KV Namespaces:
- OAUTH_KV: [simulated locally]
- Assets:
- Binding: ASSETS
❓ Your types might be out of date. Re-run `wrangler types` to ensure your types are correct.
⎔ Starting local server...
[wrangler:inf] Ready on http://localhost:8787
[wrangler:inf] GET / 200 OK (95ms)
[wrangler:inf] GET /img/mcp-inspector-successful-tool-call.png 200 OK (6ms)
[wrangler:inf] GET /img/mcp-inspector-sse-config.png 200 OK (11ms)
[wrangler:inf] GET /img/available-tools.png 200 OK (7ms)
[wrangler:inf] GET /img/claude-does-math-the-fancy-way.png 200 OK (10ms)
✘ [ERROR] OAuth error response: 401 invalid_token - Missing or invalid access token

[wrangler:inf] GET /sse 401 Unauthorized (5ms)
```

**MCP Inspector**
```
$ npx @modelcontextprotocol/inspector
Starting MCP inspector...
⚙️ Proxy server listening on port 6277
🔍 MCP Inspector is up and running at http://127.0.0.1:6274 🚀
New SSE connection. NOTE: The sse transport is deprecated and has been replaced by streamable-http
Query parameters: [Object: null prototype] {
url: 'http://localhost:8787/sse',
transportType: 'sse'
}
SSE transport: url=http://localhost:8787/sse, headers=Accept
Received 401 Unauthorized from MCP server: SSE error: Non-200 status code (401)
```

Noted that "sse transport is deprecated". No luck attempting streamable-http.

## Workaround

Looks like defining what version of instpector is spun up works as referenced by the screenshots in the readme.

Instead, when starting the MCP Inspector, run: `npx @modelcontextprotocol/inspector@0.6.0`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running `npx nx dev remote-mcp-server` and the documented MCP Inspector command, then compare the current inspector behavior with `npx @modelcontextprotocol/inspector@0.6.0`. Check the README's SSE configuration and the `/sse` request logs; the issue is resolved when the documented local connection succeeds without a 401.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, authentication
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.