Skip to content

[extensions] Fix Claude Desktop connector compatibility#38

Open
matthallett1 wants to merge 14 commits intomainfrom
contrib/matthallett1/fix-extension-routing
Open

[extensions] Fix Claude Desktop connector compatibility#38
matthallett1 wants to merge 14 commits intomainfrom
contrib/matthallett1/fix-extension-routing

Conversation

@matthallett1
Copy link
Collaborator

Summary

  • Fixes the Accept header mismatch that prevents Claude Desktop custom connectors from connecting to OB1 MCP edge functions
  • Patches all 6 tracked extension index.ts files with a request rewrite that injects Accept: application/json, text/event-stream when missing
  • No behavior change for Claude Code or other clients that already send the correct header

Root cause

Claude Desktop's custom connector system sends POST requests without the Accept: text/event-stream header. The StreamableHTTPTransport from @hono/mcp@0.1.1 rejects these requests before they reach auth or tool code.

Fix

Construct a new Request with the missing header patched in (Deno's incoming request headers are immutable, so simple .set() doesn't work).

Test plan

  • All 7 edge functions deployed and tested via curl without Accept header — initialize, tools/list, and tools/call all succeed
  • Tested with Accept header present — no regression for Claude Code
  • Claude Desktop: added connectors via Settings → Connectors → Add custom connector — connected and all tools visible
  • Community confirmation: does this fix the issue for other users?

Fixes #33

🤖 Generated with Claude Code

matthallett1 and others added 14 commits March 13, 2026 21:59
…ltering

- Canonical OB1 MCP server with 4 tools: capture_thought, search_thoughts, list_thoughts, thought_stats
- Source filtering on search_thoughts, list_thoughts, thought_stats (optional source param)
- Auth via x-brain-key header and ?key= query param against MCP_ACCESS_KEY
- deno.json with pinned canonical dependency versions
- Update .gitignore to track Edge Function source files while ignoring Supabase temp/config

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replaced custom monkeyrun Edge Function with OB1 canonical MCP server.
4 tools (capture_thought, search_thoughts, list_thoughts, thought_stats),
source filtering on 3 tools, auth via query param and header.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Supabase Edge Functions pass the function name as part of the request
path (e.g., /professional-crm/mcp), but all extensions used explicit
routes like app.post("/mcp") which only matches /mcp. This caused every
extension to return 404 when deployed.

Changed to wildcard routing (app.post("*"), app.get("*")) to match
regardless of path prefix, consistent with the core open-brain-mcp
server pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
z.record(z.any()) in the details parameter breaks with Zod 4.x and
MCP SDK 1.24.3 (_zod property error). Changed to z.string() accepting
a JSON string, which is compatible and functionally equivalent since
the JSONB column accepts string input.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Local deployment copies of the 4 extension MCP servers with fixes
applied: edge runtime import, wildcard routing for Supabase path
handling, and z.record compatibility fix for household-knowledge.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Deployment-ready copies with edge runtime import and wildcard routing
fix applied. All 6 OB1 extensions now deployed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Same wildcard routing fix as the other 4 extensions — Supabase passes
the function name in the request path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
server.tool() wraps params in z.object() internally. Passing a
z.object() schema double-wraps it, producing empty parameter schemas.
Changed all 8 tool registrations to pass schema.shape instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tool handlers returned raw strings instead of MCP content objects
({ content: [{ type: "text", text: "..." }] }). Added wrap() helper
to all 8 tool registrations with error handling.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
OB1 pattern: users copy from extensions/ and deploy themselves.
Removed supabase/functions/ from tracking — these are local
deployment copies, not part of the repo standard.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove .planning/ files from tracking (already gitignored), fix broken
link to nonexistent recurring-tasks primitive, add numbered step list
to source-filtering README for review check compliance.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude Desktop's custom connector system doesn't send the
Accept: application/json, text/event-stream header that
@hono/mcp StreamableHTTPTransport requires. This patches
incoming requests to inject the header when missing.

Fixes #33

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Claude Desktop/claude.ai connector fails MCP handshake — Accept header mismatch

1 participant