๐Ÿš€ 106 Tools. One MCP Server. Claude Desktop + Copilot Studio — Microsoft Purview on Full Autopilot



New · Complete Guide · 2026

106 Tools. One MCP Server.
Total Microsoft Purview Control.

The step-by-step guide to building an AI-powered security command center that connects Claude Desktop and Copilot Studio to Microsoft Purview, SharePoint, and the entire M365 security stack.

106
Tools
12
Modules
35
Presets
7,628
Lines
⭐ Download from GitHub →

1️⃣ What is MCP and Why Should You Care?

Imagine telling an AI assistant: "Search all Copilot interactions from the last 6 months, generate an analytics report, and upload it to SharePoint" — and it just does it. No scripts. No portals. No clicking through 47 tabs.

Model Context Protocol (MCP) is an open standard created by Anthropic that lets AI assistants like Claude and Microsoft Copilot Studio connect to external tools through a standardized interface.

๐ŸŽฏ What This Server Does

๐Ÿ” Audit Search
Search any M365 audit log
๐Ÿ“ SharePoint
Sites, lists, files, sharing
๐Ÿค– Copilot Tracking
Usage, security, dashboards
๐Ÿ“Š Threat Hunting
10 MITRE ATT&CK presets
๐Ÿท️ Sensitivity Labels
Apply, remove, scan labels
๐Ÿ›ก️ Security
Alerts, eDiscovery, risk
๐Ÿ’ฌ "Run a brute force threat hunt for the last 30 days"
๐Ÿ’ฌ "Apply the Confidential label to all files in HR Documents"
๐Ÿ’ฌ "Run Copilot usage pipeline for last 6 months, upload to SharePoint"

2️⃣ Architecture: How It All Connects

๐Ÿ–ฅ️ Mode 1: Claude Desktop (Local)

You type Claude Desktop MCP Server (stdio) Graph API Purview

☁️ Mode 2: Copilot Studio (Azure)

User asks agent Copilot Studio Azure App Service Graph API Purview

3️⃣ Create Azure App Registration

1Go to portal.azure.com → sign in as admin
2Search App registrations → click + New registration
3Name: Purview MCP Server · Single tenant · No redirect URI → Register
4Copy Application (client) ID and Directory (tenant) ID

๐Ÿ”‘ Create Client Secret

1Certificates & secrets+ New client secret → 24 months → Add
!IMMEDIATELY copy the Value — you can only see it once!

4️⃣ Add API Permissions (18)

Click API permissions+ AddMicrosoft GraphApplication permissions:

PermissionPurposeRequired
AuditLogsQuery.Read.AllPurview audit search
AuditLog.Read.AllSign-in + directory logs
Sites.ReadWrite.AllSharePoint
Files.ReadWrite.AllFile operations
SecurityAlert.ReadWrite.AllSecurity alerts
SecurityIncident.ReadWrite.AllIncidents
SecurityEvents.Read.AllSecure Score
IdentityRiskEvent.Read.AllIdentity risk
InformationProtectionPolicy.Read.AllSensitivity labels
Policy.Read.AllConditional Access
Reports.Read.AllUsage reports
ServiceHealth.Read.AllService health
Mail.SendEmail notificationsOptional
⚠️ After adding all permissions, click "Grant admin consent". All should show green checkmarks ✅.

5️⃣ Download, Install & Build

๐Ÿ“ฆ Download from GitHub

# Option 1: Clone with Git
git clone https://github.com/PowerofAutomation2026/MCP.git
cd MCP/purview-mcp-server

# Option 2: Download ZIP
# https://github.com/PowerofAutomation2026/MCP → Code → Download ZIP
⭐ PowerofAutomation2026/MCP on GitHub

๐Ÿ“‹ Prerequisites

1. Node.js 20+ — download from nodejs.org

2. Azure CLIaka.ms/installazurecliwindows (only for Azure deploy)

๐Ÿš€ Build

cd C:\Projects\purview-mcp-server
npm install
npm run build
✅ No errors = ready! Compiled files in dist/ folder.

6️⃣ Configure Claude Desktop

Open %APPDATA%\Claude\claude_desktop_config.json and add:

{
  "mcpServers": {
    "purview": {
      "command": "node",
      "args": ["C:\\Projects\\purview-mcp-server\\dist\\index.js"],
      "env": {
        "PURVIEW_TENANT_ID": "ENTER_YOUR_TENANT_ID",
        "PURVIEW_CLIENT_ID": "ENTER_YOUR_CLIENT_ID",
        "PURVIEW_CLIENT_SECRET": "ENTER_YOUR_SECRET",
        "PURVIEW_EXPORT_PATH": "C:\\Projects\\PurviewExports"
      }
    }
  }
}

Save → Create C:\Projects\PurviewExports folder → Fully quit Claude Desktop (system tray → Quit) → Reopen.


7️⃣ Your First Audit Search

Test 1: Connection

๐Ÿ’ฌ "List all Purview audit searches"

Test 2: Create Search

๐Ÿ’ฌ "Create audit search for CopilotInteraction events from last 7 days"

Test 3: Full Pipeline

๐Ÿ’ฌ "Run Copilot usage pipeline for last 6 months, upload to SharePoint"
๐Ÿ” Search ⏳ Wait ๐Ÿ“„ CSV ๐Ÿ“Š Dashboard ๐Ÿ“ SharePoint

8️⃣ Deploy to Azure App Service

cd C:\Projects\purview-mcp-server

.\deploy-azure.ps1 `
  -TenantId "YOUR_TENANT_ID" `
  -ClientId "YOUR_CLIENT_ID" `
  -ClientSecret "YOUR_SECRET"

The script handles everything: Azure login, resource creation, build, package with node_modules, deploy, verify health.

๐Ÿ”ง Key Azure Fixes Built In

FixSolution
WAM Auth bugaz config set core.enable_broker_on_windows=false
Azure build failsSkip Oryx build, include node_modules in zip
Startup resetsRe-apply node dist/web.js after env vars + deploy
MCP transport failsManual JSON-RPC handler (bypasses SDK)
Free tier quotaAuto-detect + offer B1 upgrade

9️⃣ Connect to Copilot Studio

2Open your agent → ToolsAdd a tool
3New toolModel Context Protocol
4URL: https://YOUR-APP.azurewebsites.net/mcp
5Auth: None → Create → Select all 106 tools → Add
6SettingsGenerative AI → Turn ON Generative Orchestration
✅ Your Copilot agent now has 106 Purview tools! Try: "Search for Copilot interactions from last 7 days"

๐Ÿ”Ÿ All 106 Tools at a Glance

๐Ÿ” Audit Search (7)
search · status · list · results · delete · export · full pipeline
๐Ÿ“ SharePoint (28)
upload · sites · lists · CRUD · files · sharing · pages · permissions
๐Ÿ“‹ Workload Presets (35)
Exchange · SP · OD · Teams · Entra · PP · Copilot · DLP · Compliance
๐Ÿค– Copilot (5 + 3 security)
tracking · pipeline · dashboard · trends · agent security scan
๐Ÿ“Š Analytics (7)
risk scoring · 10 MITRE hunts · executive summary · timeline
๐Ÿท️ Labels (7)
list · apply site · apply library · default · extract · remove
๐Ÿ›ก️ Security (17)
alerts · incidents · Secure Score · eDiscovery · risk · KQL · privacy
๐Ÿฅ Health & Reports (12)
service health · sign-in logs · CA · usage · Teams · SP · email

๐Ÿ”ง Troubleshooting

ErrorFix
segment not foundAuto-retries beta endpoint. Check AuditLogsQuery.Read.All permission.
403 ForbiddenGrant admin consent (Step 4)
Search stuckNormal — takes 2-15 min. Keep polling.
403 Site DisabledFree tier quota exceeded — upgrade to B1
Copilot no toolsDelete old MCP tool, re-add with correct URL
Not in ClaudeFully quit (system tray → Quit) + restart
Power of Automation

powerofautomation2025.blogspot.com · GitHub: PowerofAutomation2026/MCP

Purview MCP Server v6.0 · 106 Tools · 12 Modules · 7,628 Lines · TypeScript

© 2026 Power of Automation. All credentials shown are placeholders.

Comments

Popular posts from this blog

Bridging the Impossible: Connecting Jira On-Prem to Power Automate & Copilot Studio — The Solution Nobody Built Until Now"

How I Automated My Entire SharePoint Tenant with 150 MCP Tools and Claude Desktop

The Impossible Bridge II: One Server, Two AIs, Every SharePoint List I Built the SharePoint Integration Microsoft Hasn't The First SharePoint MCP That Talks to Copilot and Claude