What problem does it solve?
Connecting a Power Apps code app to Microsoft 365 Copilot search requires handling the MCP (Model Context Protocol) handshake, JSON-RPC sequencing, session-id quirks, and deeply nested response parsing — all of which are error-prone when done manually.
Core Features & Use Cases
- Connector Setup: Creates the Work IQ Copilot MCP connection (
shared_a365copilotchatmcp) via the Power Apps CLI and adds it as a data source, generating the typed WorkIQCopilotMCPService.
- Production-Ready McpSession Wrapper: Provides a complete TypeScript wrapper that runs the
initialize handshake without a session id, sequences JSON-RPC ids, auto-retries on "Session not found" (-32001), and persists conversation ids for multi-turn chat.
- Response Parsing: Unwraps nested JSON-RPC/SSE responses into clean text, extracting the Copilot reply with attributions.
- Use Case: Build an app feature that summarizes a user's emails, meetings, or documents by sending context-rich prompts to the
CopilotChat tool and rendering structured markdown sections like action items.
Quick Start
Ask the agent to add Work IQ Copilot search to this Power Apps code app and wire up the McpSession wrapper.