Skip to content

KeithIsSleeping/mcp-http-autostart-repro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCP HTTP Auto-Start Reproduction

Minimal reproduction demonstrating two related issues with extension-contributed HTTP MCP servers in VS Code:

  1. HTTP MCP servers requiring remote authentication cannot auto-start — there is no way to mark an MCP as required or force the auth prompt at chat start. Chat continues without the MCP if the user misses the small notice.
  2. MCP tools cannot be referenced with # notation until manually started — compounding the discoverability problem since users have no way to see or invoke tools from an unstarted server.

Issue 1: No Auto-Start for HTTP MCP Servers Requiring Authentication

When an extension registers an HTTP MCP server via registerMcpServerDefinitionProvider, the server appears in the tools picker but never auto-starts. Instead, the user sees a small, easy-to-miss message at the bottom of a chat response:

"The MCP server HTTP_MCP_Repro may have new tools and requires interaction to start. Start it now?"

MCP requires interaction to start

The tools picker shows the MCP with an "Update Tools" action instead of being auto-started:

MCP shows Update Tools

If the user doesn't notice this message, they continue chatting without the MCP tools — silently degraded, with no indication of what they're missing. The chat continues to respond normally, giving the user the impression that everything is working.

There is currently:

  • No way to mark an MCP as required or autoStart via the extension API
  • No way to force or trigger the authentication prompt programmatically at chat start
  • No way to reuse an existing user's logged-in VS Code MSAL credentials for the MCP connection
  • No prominent UI (e.g., modal dialog, banner) to alert the user that a critical MCP needs authorization

This creates a confusing point of friction where users won't have access to potentially critical MCPs unless they are actively watching for and responding to a small inline notice at chat start.

This behavior occurs regardless of:

  • The chat.mcp.autoStart setting (default: newAndOutdated)
  • Whether the MCP is configured via the extension API or .vscode/mcp.json
  • Whether a valid Microsoft/GitHub auth session already exists in VS Code

Issue 2: MCP Tools Cannot Be Referenced with # Until Started

Additionally, users cannot reference MCP tools with the # notation in chat until the server has been manually started, making the tools completely invisible from the chat input:

Cannot reference MCP tools before starting

This compounds the auto-start problem: since unstarted MCPs don't appear in the # tool picker, users have no way of knowing tools exist or invoking them. This is tracked in #272000, but that issue doesn't address the auto-start problem.

Expected Behavior

Extension-contributed HTTP MCP servers should either:

  1. Auto-start and trigger the auth prompt prominently (like a modal dialog or banner), OR
  2. Provide an API for extensions to mark an MCP as required or autoStart, OR
  3. Provide a public API to programmatically start an MCP server (e.g., vscode.lm.startMcpServer(serverId)), OR
  4. Allow the MCP to auto-connect when a valid auth session is already cached (e.g., from vscode.authentication.getSession)

Steps to Reproduce

Prerequisites

  • VS Code Insiders 1.111.0+ (or stable with MCP API support)
  • GitHub Copilot Chat extension v0.39.0+
  • Signed in to a Microsoft/GitHub account

Setup

  1. Clone this repo
  2. Run npm install
  3. Run npm run compile
  4. Launch the Extension Development Host:
    • Press F5 in VS Code, or
    • From terminal: code-insiders --extensionDevelopmentPath .

Reproduce Issue 1: MCP Does Not Auto-Start

  1. In the Extension Development Host window, open any folder
  2. Open the Chat view (Ctrl+Alt+I)
  3. Send a message in chat (e.g., "hello")
  4. Observe: The chat response appears without MCP tools. A small, easy-to-miss message appears:

    "The MCP server HTTP_MCP_Repro may have new tools and requires interaction to start. Start it now?"

  5. Click the Configure Tools button (gear icon in the chat input)
  6. Observe: Under "HTTP_MCP_Repro", you'll see "Update tools" — the server has not auto-started
  7. The MCP never starts automatically — the user must click "Start it now?" to trigger the auth flow

Reproduce Issue 2: MCP Tools Not Visible via #

  1. With the MCP still in the unstarted state (do not click "Start it now?")
  2. In the chat input, type # to open the tool/reference picker
  3. Observe: No tools from "HTTP_MCP_Repro" appear in the picker
  4. Now click "Start it now?" in the chat to start the MCP and complete auth
  5. Type # again — the MCP tools now appear

Alternative: .vscode/mcp.json

Create .vscode/mcp.json in the opened folder:

{
    "servers": {
        "HTTP_MCP_Test": {
            "type": "http",
            "url": "https://api.githubcopilot.com/mcp"
        }
    }
}

The same behavior occurs — the server requires interaction to start.

Impact

Extensions that ship HTTP MCP servers to large user bases have no way to ensure the MCP is available when the user starts chatting. The current UX silently falls back to chat without the tools, and most users never realize they need to click a small link to activate them. This is particularly problematic for extensions that provide critical domain-specific tools via MCP — users will get degraded responses without understanding why.

Requested Solutions

Any of these would address Issue 1:

  1. autoStart property on McpServerDefinition — Allow extensions to declare that their MCP should auto-start, triggering the auth prompt on workspace open.

  2. required: true on MCP definitions — Show a prominent banner or block chat until the user authorizes required MCP servers.

  3. Public API to start an MCP — e.g., vscode.lm.startMcpServer(serverId) so extensions can trigger the auth flow programmatically.

  4. Honor pre-cached auth sessions — If a valid Microsoft/MSAL auth session exists (from vscode.authentication.getSession), allow the MCP to auto-connect without additional interaction.

For Issue 2, #272000 should address the # reference visibility.

Related Issues

  • #275919 — MCP tools registered by extension requires "Update tools" action (closed)
  • #272000 — Proposed API for MCP tool metadata (open, doesn't address auto-start)

Environment

  • VS Code: 1.111.0 (Insiders)
  • GitHub Copilot Chat: 0.39.0
  • OS: Windows 11
  • chat.mcp.autoStart: newAndOutdated (default)

About

Minimal reproduction: Extension-contributed HTTP MCP servers cannot auto-start due to authentication interaction requirements

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors