modelcontextprotocol / modelcontextprotocol/csharp-sdk
Github copilot not setting bearer token on acces to tools.
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
I have created an MCP server and I am trying to use it in visual studio 2026 with github copilot. I created an .mcp.json for the solution and I managed to authenticate using oauth using the codelens ui for that file. When saving the .mcp.json file Visual Studio supplies the bearer token to the MCP server and it is marked as online.
But when copilot chat tries to access it, the bearer token is not included in the request. But the server still shows connected in the config. I don't know if this is a problem with this library or not. If I execute the tools using the bearer token and postman it all works. But github copilot does not try to supply the token.
Do I need to add anything special in the way of attributes or such to get copilot ai to understand it needs to supply the bearer token when calling tools?
To Reproduce
- Authenticate the mcp server
- Try to use the tool in the chat. No token gets send.
Expected behavior
copilot chat should send the bearer token to the mcp server
Logs
Additional context
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 .mcp.json configuration and reproduce the call from Visual Studio GitHub Copilot chat to the MCP server, comparing it with the working Postman request. Determine whether the missing bearer token is caused by the C# SDK or the Copilot client; done means the tool request includes the authenticated token or the issue is narrowed to the responsible component.
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
- Needs clarification
- Newbie friendliness
- 30/100