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
Problem
createSession()in the copilot-sdk only supportstype: local(stdio) MCP servers when running in ACP mode (copilot --acp). Thetype: httptransport, 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:
bap-microsoft/MCP-Platform->mcp_TeamsServer) - streamable-http onlyWhat We Tried
type: httpinmcpServersconfig passed tocreateSession()--additional-mcp-configCLI flagmcp-remoteproxy (npm package)--static-oauth-client-infowith mcp-remoteExpected Behavior
createSession()should support MCP servers withtype: http(and ideallytype: 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:@floriscornel/teams-mcp(local stdio) instead of the official MS Teams MCP (remote http)/betafetch calls for channel reads instead of proper MCP toolsImpact
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