modelcontextprotocol / modelcontextprotocol/csharp-sdk

OAuth Flow not working for Atlassian MCP and Github MCP

Open
#842 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-auth bug needs confirmation P2
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:

  1. Clone the csharp-sdk Repo
  2. Execute the "ProtectedClient" Repo and set the serverurl to var serverUrl = "https://api.githubcopilot.com/mcp/";
  3. 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

Open the contributing guide

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.