Skip to main content
GCC Jumpstart WA Government AI Training Partners Impact About Procurement Capability Insights Contact
Uncategorized

Building a Custom MCP Server for Microsoft 365 GCC: Architecture Notes

The Model Context Protocol (MCP) is one of the most significant architectural shifts in AI agent design in the last year. For government IT teams running Microsoft 365 in GCC, it solves a problem that has quietly frustrated every Copilot Studio deployment: how do you give an AI agent safe, auditable, policy-compliant access to backend systems without building a custom connector for every API call?

This post covers the architecture of a production MCP server deployed inside a GCC environment as the automation layer underneath 17 AI systems. All client and agency details are omitted. The architectural patterns generalize.

What MCP Solves in Government Cloud

Commercial MCP tutorials assume a permissive environment: local file access, unrestricted outbound calls, developer credentials. None of that applies in GCC.

GCC imposes hard constraints: FedRAMP authorization boundary, restricted connector categories in Power Platform, outbound traffic limited to approved endpoints, and strict requirements around service account privilege and audit logging. A naive MCP implementation that works fine on a developer laptop will fail at the GCC boundary in ways that are difficult to debug and uncomfortable to explain to a contracting officer.

The MCP server architecture described here was designed from day one for these constraints — not retrofitted from a commercial prototype.

Architecture Overview

The core design decision was to run the MCP server as a Python/PowerShell hybrid process executing inside the government network boundary, accessible to cloud-based agents via a proxied HTTPS endpoint that operates within the GCC tenant’s approved service principal scope.

Tool routing layer: Each MCP tool is mapped to a specific Graph API call, PowerShell cmdlet, or internal API endpoint. Tools are defined declaratively — name, description, input schema, required permissions — so the AI agent’s tool-selection logic can reason about what each tool does and when to invoke it. In Copilot Studio, this maps directly to generative orchestration: the agent reads tool descriptions and decides at runtime which tool to call based on user intent.

Auth boundary: The MCP server authenticates to Graph API using a service principal with least-privilege, scope-constrained permissions. No user credentials are stored or proxied. Every Graph API call is made with an access token that is short-lived and scoped to the minimum permission set required by that tool. This satisfies both the GCC compliance requirement and the agency’s security baseline.

Audit trail: Every tool invocation is logged with timestamp, invoking agent identity, tool name, input parameters (sanitized of PII), and response status. Logs are written to a SharePoint list via Graph API — inside the GCC boundary, searchable by compliance officers, and retained per the agency’s records schedule. This was a hard requirement from the agency’s information security office: no action taken by the AI agent can be unaccountable.

The Policy Enforcement Problem

The most interesting engineering challenge was not authentication or logging — it was policy enforcement at the tool level.

Government environments have a class of operations that are technically possible (the Graph API allows them) but operationally restricted: bulk mailbox access, cross-department data queries, automated provisioning above a certain scale. A naive agent with broad Graph API permissions could execute any of these correctly from an auth standpoint while violating operational policy.

The solution was to implement policy guards at the MCP tool boundary — before the Graph API call is ever made. Each tool has a policy function that evaluates the input parameters against a set of configurable rules: scope limits, rate limits, permitted entity ranges, and approval requirements for high-impact operations. Requests that fail policy evaluation return a structured error to the agent with an explanation, which the agent then surfaces to the user. No policy violation ever reaches the Graph API layer.

This is a pattern that doesn’t appear in commercial MCP documentation because commercial environments rarely need it. In government, it’s essential.

What This Architecture Unlocks

Once the MCP server is in place, adding new agent capabilities drops from a multi-week development effort to a matter of defining a new tool with its schema and policy rules. The AI Readiness Assessment, M365 admin automation, records classification, and license anomaly pipelines described in our representative work all plug into this same MCP layer — same auth, same audit trail, same policy enforcement.

The compounding benefit is significant. The first MCP tool takes the longest to build because you’re also building the server infrastructure. Each subsequent tool inherits the entire compliance stack. By the time seventeen tools exist, the marginal cost of the next one is roughly the time it takes to write the Graph API call and define the policy rules — typically a day or two of engineering time for a well-understood operation.

If your agency is deploying Copilot Studio agents without an MCP layer, you are building bespoke connectors and workarounds for every integration point. That’s not a technical debt you want to carry. An AI agent engineering engagement that includes MCP infrastructure pays itself back on the second agent you deploy.

What Readiness Looks Like

Before deploying an MCP server in your GCC environment, you need: a service principal with the right permission grants approved by your tenant admin, an endpoint (Azure Function or approved compute) that sits within or proxies through your GCC boundary, and buy-in from your information security office on the audit logging approach. None of these are blockers — they are planning items that take a week or two to line up.

If you want to start with something smaller, a targeted GCC AI Jumpstart can deliver a working MCP-backed agent with two or three tools as the first engagement, giving your team hands-on experience with the architecture before committing to a broader rollout.

The Bottom Line

MCP is the right abstraction for government AI agents operating inside GCC. It solves the connector problem, the policy enforcement problem, and the audit problem in a way that scales across multiple agents without multiplying complexity. The engineering investment is front-loaded but the compounding returns are real — every agent built on the same MCP layer gets compliance, auditability, and policy enforcement for free.

If you are architecting Copilot Studio agents for a GCC environment and have not yet built an MCP layer, that is the most high-leverage infrastructure investment you can make in 2026.

Questions About Your GCC Environment?

Book a 20-min scoping call or send a message. We respond within one business day.