add-workiq
Adds Work IQ (M365 Copilot Search) to a Power Apps code app via the Work IQ Copilot MCP connector (shared_a365copilotchatmcp), then wires up a production-ready McpSession wrapper for AI-powered, knowledge-grounded search and chat
Install / Use
npx skills add microsoft/power-platform-skills --skill add-workiqInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
CommunicationSupported Platforms
Our assessment of add-workiq
add-workiq scores 93/100 on our quality scale, 150th of 444 Communication skills we index (top 34%).
Its SKILL.md is 22 KB long, well organised into 14 sections with 10 code examples: a thorough specification that gives an agent plenty to work with.
It has 919 GitHub stars, a meaningful sign that others use it.
Maintenance, license and trust
- The repository was last updated 9 days ago, so add-workiq is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands.
Automated pattern scan on 2026-10-04. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
add-workiq compared with similar skills
All 4 of these similar skills score higher than add-workiq; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| add-workiq (this skill)by microsoft | 93 | 919 | 9d ago | SKILL.md |
| Agent-Reachby Panniantong | 100 | 89.8k | 18d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 74.4k | today | CLAUDE.md |
| CowAgentby zhayujie | 100 | 47.2k | today | CLAUDE.md |
| Scraplingby D4Vinci | 100 | 85.5k | today | MCP Server |
Frequently asked questions
- How do I install add-workiq?
- Run
npx skills add microsoft/power-platform-skills --skill add-workiq. The install tabs above show the steps for each supported agent. - Which AI agents does add-workiq work with?
- It is written for GitHub Copilot, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is add-workiq safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is add-workiq still maintained?
- The repository was last updated 9 days ago, so add-workiq is actively maintained.
Skill content
View source on GitHubname: add-workiq description: Adds Work IQ (M365 Copilot Search) to a Power Apps code app via the Work IQ Copilot MCP connector (shared_a365copilotchatmcp), then wires up a production-ready McpSession wrapper for AI-powered, knowledge-grounded search and chat. Use when integrating Microsoft 365 Copilot search/chat. The CopilotChat tool searches internal Microsoft 365 content (documents, emails, chats, sites, files) across your organization — prefer workload-specific tools (SharePoint, OneDrive, Teams, Mail) when the workload is explicit; do not use it for general knowledge, news, public web, or external information. user-invocable: true allowed-tools: Read, Edit, Write, Grep, Glob, Bash, LSP, TaskCreate, TaskUpdate, TaskList, TaskGet, AskUserQuestion, Skill model: sonnet
📋 Shared Instructions: shared-instructions.md - Cross-cutting concerns.
Add Work IQ (M365 Copilot Search)
Work IQ is accessed through the dedicated Work IQ Copilot MCP connector (shared_a365copilotchatmcp; shown as "Work IQ Copilot MCP (Preview)" in the maker portal). It exposes an MCP (Model Context Protocol) endpoint whose CopilotChat tool performs AI-powered, knowledge-grounded search and conversation over Microsoft 365 content.
This is the purpose-built Work IQ connector and generates a
WorkIQCopilotMCPServicewith a singlemcp_m365copilotoperation. Every command and code reference in this skill is specific toshared_a365copilotchatmcp(connection commands, and the generatedWorkIQCopilotMCPService/WorkIQCopilotMCPModelfiles). Do not run this skill for a different connector. If you instead need the broadershared_a365mcpservers"Microsoft 365 MCP Servers" bundle (Mail/Teams/SharePoint MCP servers), add it via/add-connector— its generated service isMicrosoftMCPServersService, so you must adjust the Step 2 commands and the wrapper imports accordingly.
⚠️ Work IQ uses MCP. A JSON-RPC
initializehandshake runs before the firsttools/call. This connector's server (Microsoft.MCPPlatform.WebApi) is stateless-tolerant — do NOT send anMcp-Session-Idoninitialize(the server treats it as a session lookup and returns-32001 Session not found). Drive the connector through theMcpSessionwrapper below, which runs the handshake, sends no session id by default, sequences JSON-RPC ids, auto-retries onSession not found, and parses the nested response for you.
Workflow
- Check Memory Bank → 2. Add Connector → 3. Inspect Generated Service → 4. Create McpSession Wrapper → 5. Use Work IQ → 6. Build → 7. Update Memory Bank
Step 1: Check Memory Bank
Check for memory-bank.md per shared-instructions.md.
Step 2: Add Connector
The Power Apps code-app CLI (@microsoft/power-apps-cli, invoked as pa or power-apps — resolve via cli-binary.md) creates the connection and generates the typed service itself. Make sure the CLI is installed (npm install) and you are signed in (pa auth status, or power-apps auth-status on power-apps-only projects; it shares the same auth as the rest of the code-app skills).
Find or Create the Connection
Check for an existing connection first:
pa connection list
Look for a Work IQ Copilot MCP (Preview) connection (api id shared_a365copilotchatmcp) in the output. If one is listed, note its Connection ID and skip to "Add the Data Source" below.
Otherwise create one with the native create-connection verb:
pa connection create --connector shared_a365copilotchatmcp
- The environment is read automatically from the app's
power.config.json— you do not need to pass an environment id. - This connector requires OAuth, so the CLI opens a browser to complete sign-in/consent (SSO-only connectors complete silently with no browser).
- On success it prints the Connection ID — save it for the next step.
STOP HERE — interactive sign-in required:
- Tell the user the browser has opened (or share the URL the CLI prints).
- Ask them to sign in with their Microsoft 365 account and grant consent to the Work IQ Copilot MCP connector.
- Wait for the user to confirm the browser shows success before continuing.
If create-connection fails:
- "not signed in" / auth error → run
pa auth status(orpower-apps auth-statusonpower-apps-only projects), sign in if needed, and retry. - "Connection creation was cancelled." → the browser flow was closed early; re-run and complete it.
- Any other non-zero exit → report the exact error and STOP.
As a fallback, the user can create the connection manually in the maker portal: https://make.powerapps.com/environments/<environment-id>/connections → + New connection → search for "Work IQ Copilot MCP" → Create, then re-run list-connections.
Add the Data Source
Once the connection exists, add it to the code app (this is what generates the typed service + model):
pa app add data-source --connector shared_a365copilotchatmcp -c <connection-id>
This is a non-tabular connector — only --connector (api id) and -c (connection id) are needed.
Step 3: Inspect Generated Service
After adding the connector, confirm the generated service is present. This is a small, single-operation service, so you can read it directly or grep it:
Grep pattern="async \w+" path="src/generated/services/WorkIQCopilotMCPService.ts"
The WorkIQCopilotMCPService exposes exactly one operation — mcp_m365copilot ("Work IQ Copilot (Preview)"), plus a Getmcp_m365copilot GET variant used only for connection verification. Work IQ / CopilotChat is driven through mcp_m365copilot.
Its generated signature is:
public static async mcp_m365copilot(
Mcp_Session_Id?: string,
queryRequest?: QueryRequest
): Promise<IOperationResult<void>>
- First argument is the MCP session id (the connector's
Mcp-Session-Idparameter). Leave itundefined— this server assigns/needs no client session id, and sending one oninitializereturns-32001(see below). - Second argument is the JSON-RPC body, typed as
QueryRequest({ jsonrpc?, id?, method?, params?, result?, error? }) — exported fromsrc/generated/models/WorkIQCopilotMCPModel.ts. - Return type is
IOperationResult<void>; the actual JSON-RPC / SSE body arrives inresult.dataat runtime.
Facts you can rely on (do not try to discover them at runtime):
- The tool name is
CopilotChat(case-sensitive). Do not substitutequery,search, orfind. - The argument key is
message— notquery,prompt, orquestion. - Do NOT send an
Mcp-Session-Idon theinitializehandshake. This connector's server treats an incoming id as an existing-session lookup and returns-32001 Session not found. The server is stateless-tolerant:initializeandtools/callboth succeed with no session id, so theMcpSessionwrapper below tracks none by default.
Session-id handling (verified during testing). This connector's MCP server is stateless-tolerant.
initializewith noMcp-Session-Idreturns200with server capabilities, and a subsequenttools/callwith no id returns the Copilot reply — no session id needs to be tracked or echoed. Do not generate a client id and send it oninitialize: the server treats it as a lookup and returns404 / -32001 Session not found(this was a real bug in an earlier version of this wrapper). Note that the code-apps data layer'sIOperationResult<TResponse>exposes only{ success, data, error, skipToken, count, fileName }— it does not surface response headers — so if a future MCP server returns a session id only in theMcp-Session-Idresponse header, it would be unreadable here. The wrapper still defensively adopts a server id if one ever appears insideresult.data.
Step 4: Create McpSession Wrapper
⚠️ CRITICAL: MCP session handling and response parsing are intricate. Copy the production-ready McpSession class below exactly. It runs the initialize handshake (sending no session id), sequences JSON-RPC ids, auto-retries on "Session not found", persists the conversation id, and parses the deeply nested response.
Create src/connectors/mcpClient.ts:
// src/connectors/mcpClient.ts
import type { IOperationResult } from '@microsoft/power-apps/data'
import { WorkIQCopilotMCPService } from '../generated/services/WorkIQCopilotMCPService'
import type { QueryRequest } from '../generated/models/WorkIQCopilotMCPModel'
export interface JsonRpcRequest {
jsonrpc: '2.0'
id?: string
method: string
params?: Record<string, unknown>
}
export interface JsonRpcResponse {
jsonrpc?: string
id?: string
result?: Record<string, unknown>
error?: { code?: number; message?: string; data?: unknown }
}
type CopilotConversationMessage = {
text?: string
attributions?: Array<{
attributionType?: string
providerDisplayName?: string
seeMoreWebUrl?: string
}>
}
type CopilotConversation = {
messages?: CopilotConversationMessage[]
}
function parseRpc(result: IOperationResult<unknown>): JsonRpcResponse {
if (!result.success && result.error) {
return { error: { message: result.error.message } }
}
const data: unknown = result.data
if (data == null) return {}
if (typeof data === 'object') return data as JsonRpcResponse
if (typeof data === 'string') {
// Handle SSE framing: "event: message\ndata: {JSON}"
const dataLines = data
.split(/\r?\n/)
.filter((line) => line.startsWith('data:'))
.map((line) => line.slice(5).trim())
// Per the SSE spec, multiple `data:` lines are joined with newlines — a single
// JSON object can be split across lines, so joining with '' would corrupt it.
const payload = dataLines.length ? dataLines.join('\n') : data
try {
return JSON.parse(payload) as JsonRpcResponse
} catch {
return { result: { raw: data } }
}
}
return { result: { raw: data } }
}
export class McpSession {
private nextId = 1
// MCP Streamable HTTP: the client must NOT send a session id on `initialize` —
// the server assigns one. Sending a client-generated id makes this connector's
// server return `404 / -32001 Session not found`. This server is stateless-
// tolerant, so we send no id at all; `extractSessionId` still adopts a server
// id if one ever surfaces in the response body.
private sessionId: string | undefined = undefined
private conversationId: string | undefined
private initialized = false
private extractSessionId(raw: IOperationResult<unknown>): string | undefined {
const container = raw as unknown as Record<string, unknown>
const dataObj =
raw.data && typeof raw.data === 'object'
? (raw.data as Record<string, unknown>)
: undefined
const resultObj =
dataObj?.result && typeof dataObj.result === 'object'
? (dataObj.result as Record<string, unknown>)
: undefined
const candidates: Array<unknown> = [
dataObj?.['Mcp-Session-Id'],
dataObj?.mcpSessionId,
dataObj?.sessionId,
resultObj?.['Mcp-Session-Id'],
resultObj?.mcpSessionId,
resultObj?.sessionId,
container['Mcp-Session-Id'],
container.mcpSessionId,
container.sessionId,
]
const found = candidates.find((value) => typeof value === 'string' && value.length > 0)
return typeof found === 'string' ? found : undefined
}
private isSessionNotFound(res: JsonRpcResponse): boolean {
const message = (res.error?.message ?? '').toLowerCase()
return message.includes('session not found') || res.error?.code === -32001
}
private resetSession(): void {
// Drop any session id and re-handshake from scratch (no id on `initialize`).
this.s
Truncated for display — read the full file on GitHub.
Related Skills
Agent-Reach
89.8kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
74.4kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
CowAgent
47.2kOpen-source personal AI assistant & Agent Harness. Plans tasks, runs tools and skills, self-evolves with memory and knowledge. Multi-agent, multi-model, multi-channel. Lightweight, extensible, one-line install.
Scrapling
85.5k🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
