clerk / clerk/mcp-express-example

Fails to authenticate in cursor

Open
#3 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Edit: Seems "Dynamic client registration" needs to be toggled on, however it still doesn't authenticate

Image

https://github.com/user-attachments/assets/97ae9c66-f8f9-4075-886e-0017533262ee

Hi, I've tried this is a variety of tools (e.g. Claude@0.12.55, Cursor@ 1.99.3) but can't get it to work.

Image

I add some extra logging. Seems like the first issue is there is no handler for /.well-known/oauth-protected-resource. But adding that and returing protectedResourceHandlerClerk doesn't work either.

HTTP server running at http://localhost:3000
HTTPS server running at https://localhost:3001
request:  POST /mcp
mcpAuth: req.headers.authorization = undefined
await auth.getToken() = null
request:  GET /.well-known/oauth-protected-resource
ANY request received: /.well-known/oauth-protected-resource
request:  GET /.well-known/oauth-authorization-server
request:  GET /mcp
ANY request received: /mcp

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with Cursor or Claude and trace the /mcp, /.well-known/oauth-protected-resource, and /.well-known/oauth-authorization-server requests shown in the issue. Inspect how the example handles these routes and Clerk authentication; done means the MCP client authenticates successfully without the missing-handler behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
express, typescript
Domain
authentication, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.