Skip to content

Support type: http MCP servers in createSession() (ACP/stdio mode) #1045

@tamirdresher

Description

@tamirdresher

Problem

createSession() in the copilot-sdk only supports type: local (stdio) MCP servers when running in ACP mode (copilot --acp). The type: http transport, which works in the interactive Copilot CLI via --additional-mcp-config, is silently ignored by the SDK.

This blocks programmatic use of remote MCP servers like:

  • Microsoft's official Teams MCP (bap-microsoft/MCP-Platform -> mcp_TeamsServer) - streamable-http only
  • Any MCP server exposed over HTTP/SSE (growing ecosystem pattern)

What We Tried

Approach Result
type: http in mcpServers config passed to createSession() Silently ignored - no tools loaded
--additional-mcp-config CLI flag Only works in interactive mode, not ACP/stdio
mcp-remote proxy (npm package) Fails: MS auth server doesn't support dynamic client registration
--static-oauth-client-info with mcp-remote AADSTS90009 error - app requesting token for itself

Expected Behavior

createSession() should support MCP servers with type: http (and ideally type: sse) transports, matching the capabilities already present in the interactive CLI.

Example config that should work:

{
  "mcpServers": {
    "teams": {
      "type": "http",
      "url": "https://mcp.teams.microsoft.com/v1/mcp"
    }
  }
}

Context

We're building a Teams channel dispatch loop using the copilot-sdk (CopilotClient + session.sendAndWait()) that monitors channels and responds with AI. The persistent session approach (vs. execFileSync('copilot') per cycle) solves MCP tool-loss across cycles, but being limited to stdio-only MCP servers forces workarounds like:

  • Using @floriscornel/teams-mcp (local stdio) instead of the official MS Teams MCP (remote http)
  • Direct Graph API /beta fetch calls for channel reads instead of proper MCP tools

Impact

As more MCP servers adopt HTTP/SSE transport (especially enterprise ones from Microsoft, Google, etc.), the SDK's stdio-only limitation will become a significant gap. The interactive CLI already supports these transports - extending that to createSession() would unblock a large class of programmatic MCP use cases.

Environment

  • copilot-sdk: latest (npm)
  • Copilot CLI: v1.0.21
  • Node.js: v22.x
  • OS: Windows

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions