Skip to content

Github copilot not setting bearer token on acces to tools. #1166

@bzuidgeest

Description

@bzuidgeest

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

  1. Authenticate the mcp server
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions