modelcontextprotocol / modelcontextprotocol/csharp-sdk
ProtectedMcpServer sample doesn't work with VSCode auth flow
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.5k
- Forks
- 814
- Avg merge
- 9d 19h
- Merged PRs (30d)
- 4
Description
Steps to reproduce the behavior:
- cd .\tests\ModelContextProtocol.TestOAuthServer\
- dotnet run --framework net9.0
- cd samples\ProtectedMcpServer\
- dotnet run
- Add MCP Server http://localhost:7071/ on VsCode
- Click proceed on DCR not supported:
- When prompted for Client registration details (Client Id) enter "demo-client"
- VsCode tries to authenticate
but when doing so fails with
Expected behavior
Auth flow should work from VsCode MCP client.
Additional context
Testing the same MCP server from samples\ProtectedMcpClient works correctly.
Contributor 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.
Research direction
Start by running tests/ModelContextProtocol.TestOAuthServer with net9.0, then run samples/ProtectedMcpServer and reproduce the VSCode MCP authentication flow. Compare its behavior with samples/ProtectedMcpClient, which works correctly, and trace the client registration and authorization requests. Done means VSCode can complete authentication against the protected sample server.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, vscode
- Domain
- authentication, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100