/mcs-assistant:add-knowledge A URL (website / SharePoint / OneDrive) or a local file path, plus an optional name/descriptionfrom mcs-assistant
Adds a knowledge source (public website, SharePoint, OneDrive, or uploaded file) to a locally-cloned Copilot Studio agent by writing capabilities/knowledge YAML.
Ships in mcs-assistant. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are a workflow that adds a knowledge source to a locally-cloned Copilot Studio
agentic-loop agent by writing modern capabilities/knowledge YAML. You discover the agent,
classify the requested source, normalize its URL, and write a *.mcs.yml component. You never invent
behavior the files do not support.
Initial request: $ARGUMENTS
Supports four source kinds: Public Website, SharePoint, OneDrive, and Uploaded file.
The exact YAML for every source kind, the capabilities/knowledge file layout, filename
conventions, SharePoint/OneDrive URL normalization, best practices, and limitations live in a single
shared reference — reference/knowledge-schema.md. It is the source of truth; the
copilot-studio-architect agent uses the same file, so the two never drift. Read it before writing
any YAML and follow it exactly.
Resolve its path via the plugin root: read
path.join(os.homedir(), '.copilot-studio-cli', 'plugin-paths.json') to get pluginRoot for the
current mcs-assistant plugin, then read path.join(pluginRoot, 'reference', 'knowledge-schema.md').
If plugin-paths.json cannot be read, fall back to locating reference/knowledge-schema.md under the
installed plugin directory.
Glob: **/settings.mcs.yml. A cloned agentic-loop workspace
contains settings.mcs.yml at its root. Never hardcode an agent name.pac copilot clone, or use /migrate). Stop.schemaName from settings.mcs.yml (e.g. crbab_guitarcoach_dcF_b3) — it is
the filename prefix for source-backed knowledge components.<agent>/capabilities/knowledge/ (create it if missing). Uploaded files
additionally use <agent>/capabilities/knowledge/files/.Extract from $ARGUMENTS:
reference/knowledge-schema.md)-my.sharepoint.* host with /personal/… → OneDrive
(SharePointKnowledgeSource, targetKind: File)*.sharepoint.com, *.sharepoint.us, *.sharepoint.cn, or
*.sharepoint-mil.us → SharePoint (targetKind: File for a file, Folder for a
folder/library)https:// URL → Public Website (WebsiteKnowledgeSource), after applying
the reference's public-site validation. Reject paths deeper than two nonempty segments and ask
for a broader HTTPS base URL instead.files/ +
metadata-only sidecar). Do not treat directories or unsupported file types as uploads.AllItems.aspx?id= decode, sharing-link
refusal, %20 encoding) exactly as the reference specifies.componentName, plus a genuinely descriptive description). Encode every value derived
from user input, a URL, a path, or an existing file as a YAML-safe double-quoted scalar using
JSON.stringify(value) semantics; never interpolate an external value as raw YAML structure.capabilities/knowledge/<schemaName>.<slug>_<id>.mcs.ymlcapabilities/knowledge/files/, then write the
metadata-only sidecar capabilities/knowledge/files/<slug>_<id>.mcs.yml
Apply the reference's exact 100-character schema-name budget before writing. Check that the
resulting component path does not already exist; regenerate the id on a component-name collision.mcs.metadata.componentName names that payload:
Tell the user what was created: the source kind, the resolved siteUrl (or copied file), and the
path of the written *.mcs.yml. Remind them the agent must be re-packed/pushed and (re)published for
the new knowledge to take effect. For source types not supported here (Dataverse, AI Search, SQL
Server, Graph connectors), point them to the Limitations section of the reference.
For SharePoint/OneDrive links you can verify up front that the link resolves and the signed-in
(author) user can read it — without downloading the file — via a single Microsoft Graph call
(GET /shares/{id}/driveItem). This is opt-in (offer it, or run it when the user asks); never
block adding the source on it.
⚠️ Delegated-permissions caveat — always state this. SharePoint/OneDrive knowledge is retrieved at runtime using each end user's permissions. This check runs as the author, so a ✅ result confirms your access only — it does not guarantee end users of the agent can access the item. Always pair the result with a reminder to ensure end users have access in SharePoint/OneDrive.
How to run it. Resolve pluginRoot from
path.join(os.homedir(), '.copilot-studio-cli', 'plugin-paths.json') (as in step "Authoritative
schema" above), then:
node "<pluginRoot>/scripts/verify-knowledge-access.bundle.js" --agent-dir "<agentDir>" "<url>"
--dry-run to resolve the plan (encoded share id, Graph endpoint, scopes, needsClientId)
without authenticating — useful to check setup first./chat skill saves. That app
registration must also have the delegated Microsoft Graph permission Files.ReadWrite
consented, and must be an app the user owns in the tenant. Microsoft documents
Files.ReadWrite as the least-privileged delegated permission for GET /shares; although this
script only issues a GET, the consent grants the app read/write access to files the signed-in
user can access. Make that permission impact clear before asking the user to opt in. If
needsClientId is true or auth/permission errors come back, explain the missing setup and
continue adding the source anyway.--cloud <name> can override inference when necessary.AADSTS65002 in an error means the --client-id is a Microsoft first-party/sample app,
which cannot obtain Graph tokens. Tell the user to supply their own Entra app registration
(single-tenant, public client flows enabled, delegated Graph Files.ReadWrite consented). An app
id that works for /chat (preauthorized for the Power Platform API) is not automatically valid
for Graph. This is a setup issue, not a failure of the source — continue.Interpreting the JSON status:
status | Meaning | What to tell the user |
|---|---|---|
ok | Dry-run plan resolved; no request was sent | inspect needsClientId, authority, and scopes before opting in |
accessible | Link valid; author can read it | ✅ proceed — plus the end-user caveat above |
forbidden | Access denied — no access or the link doesn't resolve (Graph /shares returns 403 for both) | ⚠️ re-copy the URL from the browser, confirm you (and end users) have access, then retry — you can still add it, but it returns nothing without access |
notfound | Link didn't resolve (uncommon — /shares usually returns forbidden for bad links) | ❌ likely a wrong/renamed URL — re-copy it from the browser address bar |
skipped | Not a SharePoint/OneDrive URL | no check needed |
error | Setup/auth/network problem | note it's optional; continue adding the source |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub microsoft/copilot-studio-plugin --plugin mcs-assistant8 skills in this plugin
/add-skillAdd an Agent Skill to a Copilot Studio agent - uploaded from your drive (a SKILL.md or .zip) or picked from the Power CAT "Cat Agent Skills" gallery - then optionally import it into a cloned agent workspace under behaviors/. Use when the user asks to add, import, upload, or install an Agent Skill (from a local SKILL.md/.zip or the Cat Agent Skills gallery) into a Copilot Studio agent./clone-agentClone an existing Copilot Studio agent into a new local PAC CLI workspace with `pac copilot clone`. Use when the user asks to clone, check out, download, or bring a Copilot Studio agent into a local folder./create-agentCreate a new MCS2 Copilot Studio agent and PAC-connected local workspace with `pac copilot init`, then optionally add modern instructions, skills, tools, knowledge, and settings before synchronizing it. Use when the user asks to create, scaffold, initialize, or build a Copilot Studio agent.Other plugins' skills for the same job