Skip to main content

Setting up CIPP with Copilot Studio as a Declarative Agent (MCP)

· 5 min read
Luke Steward
Technical Manager & Security Engineer

Connect CIPP to Microsoft Copilot Studio as a declarative agent over the CyberDrain MCP endpoint, so engineers can work agentically against tenant data through CIPP.

This is a proof of concept. The companion master prompt and skills are only minimally trained, cover a small skillset, and need further training before you treat them as production-ready. Official CIPP API and MCP setup lives in the CIPP API documentation; this post covers Copilot Studio declarative-agent wiring on top of that.

⚠️ Use a declarative agent, not a classic agent. CIPP’s MCP tool surface is large. Classic Copilot tooling is limited to importing 70 tools (see Scoping Copilot Tool Imports in the official docs). Without scoping, Copilot may pick 70 tools at random. Declarative agents are the path this guide uses so you are not stuck behind that classic import limit.

Prerequisites

  1. Complete CIPP API and MCP setup using the official guide: CIPP-API & MCP. That includes enabling the MCP feature, creating an API client with MCP Access Allowed, saving to Azure, and adding any provider redirect URI your environment needs.
  2. From the CIPP-API page after setup, note your Client ID, Client secret, and ExecMCP URL (https://<your-instance>.azurewebsites.net/api/ExecMCP).
  3. Your Entra tenant ID (the tenant where CIPP authenticates).
  4. Access to create a declarative agent in Copilot Studio / Microsoft 365 Copilot.
  5. A Claude Opus model available in that environment (the companion master prompt is optimised for Claude Opus in Copilot Studio).

Companion materials (master prompt + topic skills): CIPP-MCP on Blog-Resources.

Create the declarative agent

  1. In Copilot Studio, create a declarative agent (do not use a classic agent for this CIPP MCP setup).
  2. Select a Claude Opus model for the agent.
  3. Keep generative orchestration / tool use enabled so the agent can call MCP tools.

Add the CIPP MCP server

Add an MCP / Model Context Protocol connection with the values below. Replace placeholders with values from your CIPP portal and CIPP-API page (docs).

FieldValue
Server nameCIPP
Server descriptionThe CyberDrain MCP for CIPP, provides access for engineers and staff members to agenticly work with CIPP
Server URLhttps://[GET FROM CIPP PORTAL].azurewebsites.net/api/ExecMCP
Client ID[GET FROM CIPP API PORTAL]
Client secret[GET FROM CIPP API PORTAL]
Authorization URLhttps://login.microsoftonline.com/[INSERT YOUR TENANT ID HERE]/oauth2/v2.0/authorize
Token URL templatehttps://login.microsoftonline.com/[INSERT YOUR TENANT ID HERE]/oauth2/v2.0/token
Refresh URLhttps://login.microsoftonline.com/[INSERT YOUR TENANT ID HERE]/oauth2/v2.0/authorize
Scopesapi://[SAME CLIENT ID AS ABOVE]/user_impersonation

Connect and complete the Microsoft / CIPP sign-in when prompted. CIPP’s read tools should appear for the agent once auth succeeds.

If you ever stay on a classic Copilot path instead, the official docs describe scoping imports with query parameters on the ExecMCP URL (tags, tools, or limit / first) under Scoping Copilot Tool Imports. That is a workaround for the 70-tool ceiling, not a substitute for the declarative approach in this guide.

Apply the master prompt and skills

The POC pack is here: https://github.com/LukeSteward/Blog-Resources/tree/master/CIPP-MCP.

  • Paste MASTER.md into the agent’s instructions / system prompt.
  • Use the topic files under skills/ as additional skill or topic guidance for areas such as connectivity checks, tenant overview, identity, Conditional Access, Exchange, endpoints, and so on.

Again: this pack is minimally trained and intentionally small. Expect gaps; plan further training before relying on it in day-to-day operations.

High-level behaviours baked into the master prompt:

  • Prefer CIPP tool calls over guessing for live tenant data.
  • Read-only by default; do not write without explicit approval.
  • Never paste secret material (recovery keys, LAPS, and similar) into chat — confirm existence in CIPP UI instead.
  • Optimised for Claude Opus in Copilot Studio; other models may follow instructions less reliably.

Smoke test

Aligned with the verify step in the official CIPP MCP docs:

Using CIPP, list all my tenants.

Or start with a connectivity-style prompt (“Are we connected to CIPP?”) if you have loaded the cipp-test-connectivity skill. If tools run and return data, the MCP link is working.

Troubleshooting

  • Auth or permission errors creating/using the API client: Follow troubleshooting in the CIPP API docs (CIPP-SAM permissions, Save Azure Configuration, MCP Access Allowed).
  • Wrong tenant ID or scope: Authorization / token URLs must use your CIPP auth tenant ID. Scope must be api://<same-client-id>/user_impersonation.
  • Classic agent missing most CIPP tools: You hit the 70-tool import limit. Switch to a declarative agent, or scope with tags / tools / limit as documented officially.
  • Odd or weak instruction-following: Confirm the agent is on Claude Opus; the POC master prompt was tuned for that family.
  • Empty or failing tools after Save to Azure: Give the instance a short restart window (up to about a minute) before reconnecting, as noted in the CIPP MCP setup steps.