Connect Microsoft Copilot
Copilot has two routes. Dynamic discovery is the one to use: Copilot Studio negotiates OAuth with Msharti and each person signs in as themselves. Where corporate DLP policy blocks that, an API key gets you connected without losing role scoping or audit.
Option A: dynamic discovery Recommended
- Open Copilot Studio. Go to Tools → Add tool → Model Context Protocol. The alternative path is M365 Admin Center → Copilot → Connectors → Create.
- Paste the server URL.
Set Authentication: OAuth 2.0 → Dynamic discovery, paste
https://mcp.msharti.dev/mcp, and click Create. - Sign in and choose the credential scope. Sign in, then Allow access. Under Details → Credentials to use pick Maker-provided for one shared org-wide connection, or Per-user so every person authenticates as themselves.
Maker-provided or per-user? Per-user is the stronger governance answer: tool calls are attributed to the individual and each person's role applies to their own requests. Maker-provided means everyone shares the maker's identity and the maker's permissions, and the audit log will say so. Choose maker-provided only when you actually want one shared service identity.
Option B: API key DLP fallback
Use this when your tenant's data loss prevention policy blocks the interactive OAuth redirect. The connection is still scoped by role and still fully audited; it simply identifies a machine rather than a person.
- Generate a Copilot key.
In the Msharti console go to Settings → API Keys → New key → Copilot and copy
the
msh_cop_…value. It is shown once. - Add it in Copilot Studio. On the MCP tool set Authentication: API key and supply the header below.
Header: Authorization
Value: Bearer msh_cop_xxxxxxxxxxxxxxxx Check it works
Reconcile our Paybill collections against Sage invoices
for last month, and flag any supplier whose KRA TCC has expired. That question crosses three connectors in one request, which makes it a good smoke test. Open Usage in the Msharti console afterwards and confirm you see calls against M-Pesa, Sage and KRA.
Rolling it out to a department
- Decide the roles first. Finance rarely needs the same tools as Operations. Build the roles before you invite people, not after. See roles and permissions.
- Prefer per-user credentials. It is the difference between an audit log full of names and one full of a single maker account.
- Invite seats in the console. Team → invite, assign a role. Their Copilot connection inherits it automatically.
- Watch the first week in the audit log. Denied calls tell you where a role is too tight; unexpected tools tell you where it is too loose.
If it does not connect
| Symptom | What to check |
|---|---|
| OAuth redirect blocked or silently fails | Tenant DLP policy. Use Option B rather than fighting it. |
| Tool appears but every call is unauthorised | The key was revoked, or the role bound to it has an empty allowlist. |
| Everyone's calls show the same identity | Credentials are set to maker-provided. Switch to per-user if you want per-person attribution. |
| Some users see fewer tools | Working as designed. Discovery is filtered by each person's role. |