modelcontextprotocol / modelcontextprotocol/csharp-sdk
OAuth Flow not working for Atlassian MCP and Github MCP
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.5k
- Forks
- 814
- Avg merge
- 9d 19h
- Merged PRs (30d)
- 4
Description
Describe the bug
The OAuth flow does not work for both Atlassian MCP and Github MCP when using the C# SDK. After initiating the authentication process, the redirect or token exchange does not complete successfully, resulting in authentication failure. It throws an error:
throw new McpException($"Failed to find .well-known/openid-configuration or .well-known/oauth-authorization-server metadata for authorization server: '{authServerUri}'");
Error Message is as follows:
ModelContextProtocol.McpException: 'Failed to find .well-known/openid-configuration or .well-known/oauth-authorization-server metadata for authorization server: 'https://github.com/login/oauth/''
To Reproduce
Steps to reproduce the behavior:
- Clone the csharp-sdk Repo
- Execute the "ProtectedClient" Repo and set the serverurl to
var serverUrl = "https://api.githubcopilot.com/mcp/"; - Error is thrown, no OAuth flow gets initiated
Expected behavior
I expected it to launch an authorization URL that I can use to authenticate against Github or Atlassian, just like it works with FastMCP.
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 with the ProtectedClient sample and its serverUrl set to https://api.githubcopilot.com/mcp/. Trace the OAuth metadata lookup that reports the missing .well-known/openid-configuration or .well-known/oauth-authorization-server metadata, then compare the GitHub and Atlassian flows. Done means the sample launches an authorization URL and completes authentication for the affected MCP servers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, github
- Domain
- api, authentication
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100