Skip to content

Error using the Work IQ Copilot MCP server #454

Description

@stevecorey365

Description

I've added the Work IQ Copilot MCP server via the CLI, updated permissions via:

a365 setup permissions mcp
a365 setup permissions bot

But when the agent tries to connect to the server, I get this in the app service logs:

2026-06-11T11:02:45.3987325Z Error adding MCP tool servers: MCPClientError: Failed to connect to streamable HTTP server after trying to fall back to SSE: "mcp_M365Copilot, url: https://agent365.svc.cloud.microsoft/agents/servers/mcp_M365Copilot": Error: Streamable HTTP error: Error POSTing to endpoint: {"error":"Forbidden","message":"Access denied: Scope \u0027McpServers.CopilotMCP.All\u0027 is not present in the request."} (SSE fallback failed with error MCPClientError: Failed to create SSE transport for server "mcp_M365Copilot, url: https://agent365.svc.cloud.microsoft/agents/servers/mcp_M365Copilot": Error: SSE error: Non-200 status code (403))
2026-06-11T11:02:45.3987686Z at MultiServerMCPClient._initializeStreamableHTTPConnection (/node_modules/@langchain/mcp-adapters/dist/client.cjs:413:12)
2026-06-11T11:02:45.3987722Z at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
2026-06-11T11:02:45.3987754Z at async MultiServerMCPClient._initializeConnection (/node_modules/@langchain/mcp-adapters/dist/client.cjs:334:9)
2026-06-11T11:02:45.3987785Z at async MultiServerMCPClient.initializeConnections (/node_modules/@langchain/mcp-adapters/dist/client.cjs:138:5)
2026-06-11T11:02:45.3987812Z at async MultiServerMCPClient.getTools (/node_modules/@langchain/mcp-adapters/dist/client.cjs:161:4)
2026-06-11T11:02:45.3987856Z at async McpToolRegistrationService.addToolServersToAgent (/node_modules/@microsoft/agents-a365-tooling-extensions-langchain/dist/cjs/McpToolRegistrationService.js:69:26)
2026-06-11T11:02:45.3987884Z at async getClient (/home/site/wwwroot/dist/client.js:79:29)
2026-06-11T11:02:45.3987909Z at async /home/site/wwwroot/dist/agent.js:106:36
2026-06-11T11:02:45.3987936Z at async A365Agent.handleAgentMessageActivity (/home/site/wwwroot/dist/agent.js:104:13)
2026-06-11T11:02:45.3987961Z at async Object.handler (/home/site/wwwroot/dist/agent.js:64:13) {
2026-06-11T11:02:45.3987986Z serverName: 'mcp_M365Copilot'
2026-06-11T11:02:45.3988007Z }

Expected behavior

Agent should be able to pull the list of tools without error.

SDK Version

1.1.206

Language/Runtime

NodeJS 24

OS

Windows 11

How to Reproduce

  1. Create new agent based on the M365 Agents Toolkit NodeJS + Agent 365 sample
  2. Add necessary parameters for LLM, etc
  3. Add MCP via A365 CLI
  4. Setup permissions, deploy, test

Output

2026-06-11T11:02:45.3987325Z Error adding MCP tool servers: MCPClientError: Failed to connect to streamable HTTP server after trying to fall back to SSE: "mcp_M365Copilot, url: https://agent365.svc.cloud.microsoft/agents/servers/mcp_M365Copilot": Error: Streamable HTTP error: Error POSTing to endpoint: {"error":"Forbidden","message":"Access denied: Scope \u0027McpServers.CopilotMCP.All\u0027 is not present in the request."} (SSE fallback failed with error MCPClientError: Failed to create SSE transport for server "mcp_M365Copilot, url: https://agent365.svc.cloud.microsoft/agents/servers/mcp_M365Copilot": Error: SSE error: Non-200 status code (403))
2026-06-11T11:02:45.3987686Z at MultiServerMCPClient._initializeStreamableHTTPConnection (/node_modules/@langchain/mcp-adapters/dist/client.cjs:413:12)
2026-06-11T11:02:45.3987722Z at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
2026-06-11T11:02:45.3987754Z at async MultiServerMCPClient._initializeConnection (/node_modules/@langchain/mcp-adapters/dist/client.cjs:334:9)
2026-06-11T11:02:45.3987785Z at async MultiServerMCPClient.initializeConnections (/node_modules/@langchain/mcp-adapters/dist/client.cjs:138:5)
2026-06-11T11:02:45.3987812Z at async MultiServerMCPClient.getTools (/node_modules/@langchain/mcp-adapters/dist/client.cjs:161:4)
2026-06-11T11:02:45.3987856Z at async McpToolRegistrationService.addToolServersToAgent (/node_modules/@microsoft/agents-a365-tooling-extensions-langchain/dist/cjs/McpToolRegistrationService.js:69:26)
2026-06-11T11:02:45.3987884Z at async getClient (/home/site/wwwroot/dist/client.js:79:29)
2026-06-11T11:02:45.3987909Z at async /home/site/wwwroot/dist/agent.js:106:36
2026-06-11T11:02:45.3987936Z at async A365Agent.handleAgentMessageActivity (/home/site/wwwroot/dist/agent.js:104:13)
2026-06-11T11:02:45.3987961Z at async Object.handler (/home/site/wwwroot/dist/agent.js:64:13) {
2026-06-11T11:02:45.3987986Z serverName: 'mcp_M365Copilot'
2026-06-11T11:02:45.3988007Z }

Screenshots

No response

Code of Conduct

Metadata

Metadata

Assignees

Labels

P1Very high prioritybugSomething isn't workingsecuritySecurity-related issue

Type

No type

Fields

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