Local MCP returns 200 text/plain for OAuth protected-resource discovery paths, breaking tunnel-client v0.0.14 interoperability
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
Research direction
Start in src/OpenClaw.Shared/Mcp/McpHttpServer.cs and trace the authenticated GET handling before the generic friendly probe response. Add regression coverage for both OAuth protected-resource well-known paths, preserving 401 responses, the existing friendly GET 200 response, and POST JSON-RPC behavior; done means those authenticated discovery paths return 404.
Written by the indexing model from the issue text.
Description
Summary
OpenClaw Windows Local MCP v2026.9.4 returns the generic authenticated GET probe response for OAuth Protected Resource Metadata discovery paths such as:
/.well-known/oauth-protected-resource/mcp
/.well-known/oauth-protected-resource
That behavior conflicts with openai/tunnel-client v0.0.14 when the OpenClaw Local MCP server does not actually advertise OAuth Protected Resource Metadata.
For an HTTP MCP target with no OAuth metadata, tunnel-client treats HTTP 404 from all PRMD candidates as the normal/optional "OAuth metadata not advertised" case. An authenticated 200 text/plain response instead looks like a metadata endpoint that returned invalid metadata and can keep OAuth discovery/readiness degraded.
This is an interoperability issue at the HTTP endpoint semantics boundary, not a general MCP transport incompatibility.
Environment
- OpenClaw Windows Companion: v2026.9.4
- Local MCP: enabled on loopback (
127.0.0.1:8765) - Local MCP bearer authentication: enabled
- OpenAI tunnel-client: v0.0.14
- Windows 11 x64
- tunnel-client target: OpenClaw Local MCP over loopback HTTP
Both versions were the latest stable releases at the time of reproduction.
OpenClaw behavior
In v2026.9.4, McpHttpServer.HandleAsync performs the bearer-token check before method dispatch and then handles any authenticated GET with the same friendly probe response:
if (ctx.Request.HttpMethod == "GET")
{
_writeText(ctx.Response, HttpStatusCode.OK,
$"OpenClaw MCP server. POST JSON-RPC to {Endpoint}", "text/plain");
return McpRequestResult.Success;
}
Source:
Therefore a correctly authenticated request to:
GET /.well-known/oauth-protected-resource/mcp
does not return 404 when OpenClaw has no PRMD document for that path; it falls through to the generic 200 text/plain GET probe response.
For completeness, an unauthenticated live probe to those paths correctly returned 401. The incompatibility occurs after valid bearer authentication, as shown by the method ordering above.
tunnel-client behavior
tunnel-client v0.0.14 actively probes OAuth Protected Resource Metadata candidates for HTTP MCP targets.
Its discovery implementation explicitly falls back across HTTP 404 responses, and its doctor path treats "all candidates returned HTTP 404" as the successful optional case:
OAuth metadata not advertised; all candidates returned HTTP 404
Sources:
https://github.com/openai/tunnel-client/blob/v0.0.14/pkg/oauth/discovery.go
https://github.com/openai/tunnel-client/blob/v0.0.14/cmd/client/doctor_command.go
So these two behaviors meet badly:
tunnel-client
GET /.well-known/oauth-protected-resource/mcp
Authorization: Bearer <OpenClaw local MCP token>
|
v
OpenClaw Local MCP
auth succeeds
any GET => 200 text/plain friendly probe
|
v
tunnel-client
received 200 from a metadata candidate
body is not Protected Resource Metadata JSON
=> discovery cannot be treated as the normal "metadata not advertised" case
Verified workaround
A loopback compatibility adapter was inserted only between tunnel-client and OpenClaw:
tunnel-client -> 127.0.0.1:8767 -> OpenClaw 127.0.0.1:8765
The adapter does only this:
/.well-known/oauth-protected-resource*=> HTTP 404- every other request => proxy unchanged to OpenClaw Local MCP
With that narrow change:
- tunnel-client
/healthz=> 200 - tunnel-client
/readyz=> 200 - OpenClaw operator/node state remained Ready / Connected
- actual ChatGPT -> tunnel-client -> OpenClaw MCP tool calls continued to work
- no change to OpenClaw JSON-RPC request/response handling was required
This strongly isolates the interoperability problem to the PRMD GET semantics rather than bearer authentication or MCP JSON-RPC transport.
Expected behavior
If OpenClaw Local MCP does not implement OAuth Protected Resource Metadata, requests to the well-known PRMD paths should behave as "not provided", e.g. HTTP 404.
The existing friendly GET probe can remain available for its intended endpoint.
Suggested minimal fix
Prefer a narrow compatibility fix rather than changing Local MCP architecture:
- Detect the OAuth Protected Resource Metadata well-known paths before the generic GET probe branch.
- Return HTTP 404 for those paths when OpenClaw does not provide PRMD metadata.
- Preserve current bearer-token, Origin, Host, concurrency, and JSON-RPC behavior.
For example, conceptually:
if (ctx.Request.HttpMethod == "GET" &&
IsOAuthProtectedResourceMetadataPath(ctx.Request.Url?.AbsolutePath))
{
return Reject/NotFound(...);
}
if (ctx.Request.HttpMethod == "GET")
{
// existing friendly probe
}
A broader "unknown GET paths return 404" change may also be valid, but the well-known-path special case appears lower-risk for existing clients that may rely on the current friendly GET probe.
Regression tests
Suggested cases for McpHttpServer:
- Valid bearer +
GET /.well-known/oauth-protected-resource=> 404 - Valid bearer +
GET /.well-known/oauth-protected-resource/mcp=> 404 - Missing/invalid bearer on those paths => preserve current 401 auth behavior
- Valid bearer + existing friendly probe GET => preserve 200 text/plain
- Existing MCP POST JSON-RPC behavior unchanged
An integration test with tunnel-client is not required to validate the OpenClaw-side fix, but the expected external outcome is that tunnel-client v0.0.14 classifies the two 404s as "OAuth metadata not advertised" and proceeds without the compatibility adapter.
Scope
I am not claiming that OpenClaw or tunnel-client is generally non-compliant with MCP. The observed problem is specifically the interaction between:
- OpenClaw's path-agnostic authenticated GET probe behavior, and
- tunnel-client v0.0.14's OAuth PRMD discovery semantics for HTTP MCP targets.
- Dominant language
- C#
- Stars
- 2.1k
- Forks
- 315
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 135
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openclaw/openclaw-windows-node
-
clawsweeper:source-repro impact:ux-release-blocker issue-rating: 🦞 diamond lobster P0
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
openclaw/openclaw-windows-node#1723 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
clawsweeper:needs-info clawsweeper:needs-maintainer-review clawsweeper:no-new-fix-pr impact:ux-friction issue-rating: 🦐 gold shrimp P1 stale
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
openclaw/openclaw-windows-node#1145 · 5 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
clawsweeper:needs-security-review clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:security issue-rating: 🦞 diamond lobster P2
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
openclaw/openclaw-windows-node#1755 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
bug impact:ux-friction issue-rating: 🦪 silver shellfish P2
Difficulty 3/5 Half a day Newbie friendliness 50/100
openclaw/openclaw-windows-node#1753 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
clawsweeper:needs-maintainer-review clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-release-blocker issue-rating: 🦞 diamond lobster P0
Difficulty 4/5 3-5 days Newbie friendliness 30/100
openclaw/openclaw-windows-node#1740 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
All issues in openclaw/openclaw-windows-node
Similar issues
-
ASP.NET Core container quickstart: `docker-run: debug` task sample is missing its closing braceOpen
Difficulty 1/5 Under an hour Newbie friendliness 88/100
microsoft/vscode-docs#10499 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
python triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
microsoft/semantic-kernel#14615 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
vzeol/DeployCraft#125 ·
Maintainers usually reply within 1 day