Install Chat Sdk
Pick your agent. Every command is ready to paste.
npx skills add microsoft/skills-for-copilot-studio --skill chat-sdkThe open skills CLI detects your agents (Claude Code, Cursor, Codex and 70+ more) and installs to the right folder. Add -g to install globally.
01
Install it
Run the command above, or upload the folder in Claude.
02
Ask naturally
Describe the task. Your agent loads chat-sdk when the request matches its description.
03
Name it if needed
If it does not trigger, say “use the chat-sdk skill”. In Codex, type $chat-sdk.
Chat via Copilot Studio SDK
Send a single utterance to a published agent via the Copilot Studio Client SDK. Use this for agents with integrated authentication / Entra ID SSO (authenticationmode 2).
Prerequisites
Requires prior authentication via /copilot-studio:test-auth. Do NOT ask the user for a client ID yourself — the test-auth skill handles app registration setup and authentication.
Instructions
Run the script with
--client-idand the utterance from$ARGUMENTS:node ${CLAUDE_SKILL_DIR}/../../scripts/chat-with-agent.bundle.js \ --client-id "<clientId>" "<utterance>" [--agent-dir <path>]Authentication: Requires prior authentication via
/copilot-studio:test-auth. The token is cached in the"test-agent"slot and shared with the eval API. If auth fails or the SDK hangs, tell the caller to re-runtest-auth.Parse the JSON output from stdout:
{
"status": "ok",
"protocol": "m365",
"utterance": "hello",
"conversation_id": "abc123-...",
"start_activities": [ ... ],
"activities": [ ... ]
}
Display the agent's response from the activities array:
- Text: activities where
type === "message"— showtext - Suggested actions:
suggestedActions.actionsarray - Adaptive cards:
attachmentswithcontentType === "application/vnd.microsoft.card.adaptive"
Save conversation_id for follow-ups.
Multi-turn
Pass --conversation-id from the previous response:
node ${CLAUDE_SKILL_DIR}/../../scripts/chat-with-agent.bundle.js \
--client-id "<id>" "<follow-up>" --conversation-id "<id>"
SDK sessions do not expire as quickly as DirectLine. Reuse conversation_id automatically for follow-ups.
Error Handling
| Error | Cause | Resolution |
|---|---|---|
Authentication failed |
Wrong client ID or tenant | Verify app registration and permissions |
Could not obtain conversation_id |
Agent not published or wrong config | Verify agent is published |
Tips for Chat Sdk
- • Start a fresh session after installing so your agent picks up the new skill.
- • It is part of a pack with 30 skills. Install only the ones you need with --skill to keep triggers precise.
- • If two skills overlap, mention the one you want by name.
Questions about Chat Sdk
What does the Chat Sdk skill do?
Send a message to a Copilot Studio agent via the Copilot Studio Client SDK (M365). Use for agents with integrated auth (Entra ID SSO). Requires an App Registration Client ID.
How do I install Chat Sdk?
Run "npx skills add microsoft/skills-for-copilot-studio --skill chat-sdk" in your project. The skills CLI installs it for Claude Code, Cursor, Codex and 70+ other agents. In Claude on the web, upload the skill folder as a ZIP under Customize > Skills.
Does Chat Sdk work in Cursor and Codex?
Yes. Chat Sdk uses the open SKILL.md format, so it works in Claude Code, Claude, Cursor, OpenAI Codex, Gemini CLI, GitHub Copilot and other agents that support agent skills.
Is Chat Sdk free?
Chat Sdk is open source on GitHub under the MIT license. It is free to install; check the license before commercial use.
Who made Chat Sdk?
Chat Sdk is published by Microsoft in the microsoft/skills-for-copilot-studio repository, together with 29 other skills.





