Building Microsoft 365 Copilot AI Agents with MCP: A Developer’s Guide
In December 2025, Microsoft announced that Microsoft 365 Copilot declarative agents now support the Model Context Protocol (MCP) — Anthropic’s open standard for connecting AI models to tools and data sources. This is arguably the most consequential development for Office extensibility since the introduction of the unified manifest.
MCP support means that Microsoft 365 Copilot agents can now interoperate with tools and data sources across the entire AI ecosystem, not just within Microsoft’s walled garden. An agent built for Microsoft 365 can connect to the same tools and data sources used by Claude, ChatGPT, and other MCP-compatible AI platforms. Conversely, MCP servers built for other AI platforms can now be accessed by Microsoft 365 Copilot agents.
This guide explains what MCP is, why Microsoft’s adoption matters, and provides a practical walkthrough for building a declarative ai assistant that uses MCP to interact with external systems.
What Is the Model Context Protocol?
The Model Context Protocol (MCP) is an open standard originally developed by Anthropic that defines how AI models communicate with external tools and data sources. Think of it as a universal adapter between AI agents and the systems they need to interact with. By allowing agents to connect to a wide range of tools and data sources, MCP enables a diverse array of AI applications—such as classifiers, generative models, and industry-specific solutions—to function seamlessly across platforms.
Before MCP, every AI platform had its own proprietary mechanism for tool integration:
-
OpenAI used function calling with custom JSON schemas.
-
Microsoft used the Copilot plugin model with OpenAPI-based action definitions.
-
Anthropic used tool use with its own parameter format.
This fragmentation meant that a developer who built a tool integration for one platform had to rebuild it for every other platform. MCP eliminates this duplication and streamlines AI work by allowing AI systems to operate efficiently across different environments.
MCP Architecture
MCP follows a client-server architecture:
-
MCP Client: The AI model (or agent runtime) that needs to use tools. In our case, the Microsoft 365 Copilot agent runtime acts as an MCP client.
-
MCP Server: A service that exposes tools and data sources through the MCP protocol. An MCP server can provide access to a CRM, a database, a file system, an API, or any other data source.
-
Transport: MCP defines standard transport mechanisms (stdio for local servers, HTTP with server-sent events for remote servers) for communication between clients and servers.
MCP Capabilities
An MCP server can expose three types of capabilities:
-
Tools: Actions that the agent can invoke. For example, “create a task in the project management system” or “look up a customer record in the CRM.”
-
Resources: Data that the agent can read. For example, “the contents of a specific document” or “the current project status dashboard.”
-
Prompts: Predefined prompt templates that guide the agent’s interaction with the server. For example, “summarise the latest sales report” with specific instructions for how to format the summary.
Why MCP in Microsoft 365 Matters
Microsoft’s adoption of MCP is significant for several reasons:
First, it enables Microsoft 365 Copilot agents to access a much broader set of tools and data sources, creating a network effect as more services and integrations become available. This growing ecosystem not only increases the value of the platform but also leverages the computing power of multiple platforms, enhancing the capabilities available to Microsoft 365 Copilot agents.
Cross-Platform Interoperability
An MCP server built for any purpose — a CRM connector, a database query tool, a document processing service — now works with Microsoft 365 Copilot agents without modification. If you have already built MCP servers for Claude or other MCP-compatible platforms, those servers work with Microsoft 365 immediately.
This dramatically reduces the development effort for organisations building internal tools that need to be accessible from multiple AI platforms.
Ecosystem Scale
MCP has been adopted by a growing number of AI platforms and tool providers. By supporting MCP, Microsoft 365 Copilot agents gain access to this entire ecosystem of tools and integrations. The network effect is powerful — each new MCP server benefits all MCP-compatible platforms, including Microsoft 365.
Developer Simplicity
For Office add-in developers building agents, MCP provides a simpler and more standardised approach to tool integration than the previous Copilot plugin model. Instead of writing OpenAPI specifications and managing plugin manifests, developers can implement MCP servers using standard libraries and patterns.
Future-Proofing
As an open standard with multi-vendor support, MCP provides a degree of future-proofing that proprietary integration mechanisms do not. An MCP server built today will work with future AI platforms that adopt the protocol, protecting the development investment.
AI and Machine Learning Fundamentals
Artificial intelligence (AI) and machine learning (ML) are at the core of today’s most powerful digital solutions, enabling computers to perform tasks that once required human intelligence. AI systems leverage sophisticated algorithms and vast amounts of data to make predictions, classify information, and generate actionable insights. At its heart, machine learning is a subset of AI that focuses on training algorithms to learn from experience—improving their performance as they process more data.
AI researchers have developed a range of techniques to enhance the capabilities of AI models. Deep learning, for example, uses neural networks with multiple layers to analyze data, recognize complex patterns, and make decisions that mimic human problem solving. These neural networks are inspired by the human brain and are particularly effective at tasks like image recognition, speech processing, and understanding natural language.
Generative AI tools, such as large language models, represent a significant leap forward in AI capabilities. These models can generate new content—ranging from text and images to videos—by learning from massive datasets. Language models like those used in Microsoft 365 Copilot can understand and produce human language, enabling AI assistants to perform tasks, answer questions, and provide AI-generated summaries. As AI tools continue to evolve, they are increasingly able to analyze unstructured data, automate repetitive tasks, and support a broad range of real-world applications.
Advanced AI Concepts
As AI technology matures, advanced concepts such as artificial neural networks, deep learning, and generative AI are driving the development of more sophisticated AI systems. These advanced AI models are capable of performing complex tasks, including image recognition, natural language processing, and high-level decision-making. AI agents—like virtual assistants and chatbots—are now widely used to automate repetitive tasks, provide customer support, and assist with problem solving across industries.
One of the most exciting frontiers is agentic AI, where multiple AI agents collaborate to achieve shared objectives. This approach is being explored in robotics, smart homes, and autonomous vehicles, where agents must coordinate to perform tasks and respond to dynamic environments. Machine learning and deep learning algorithms enable these agents to analyze vast amounts of data, identify patterns, and make predictions with increasing accuracy.
Tools like Copilot Studio empower developers to build and orchestrate AI agents and agent flows using a graphical, low-code interface. This makes it easier to automate workflows, personalize user experiences, and integrate advanced AI capabilities into enterprise systems. By leveraging neural networks and advanced AI algorithms, organizations can unlock new efficiencies, automate complex processes, and deliver intelligent solutions that adapt to user needs.
Building a Declarative Agent with MCP
Let us walk through building a Microsoft 365 Copilot declarative agent that uses MCP to interact with an external project management system, enabling the agent to perform specific tasks such as retrieving project updates, assigning tasks, or automating routine project workflows.
Step 1: Define the MCP Server
First, build an MCP server that exposes the project management system’s capabilities. Using the MCP TypeScript SDK:
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
const server = new McpServer({
name: "project-management",
version: "1.0.0",
});
// Define a tool for creating tasks
server.tool(
"create_task",
"Create a new task in the project management system",
{
project: z.string().describe("The project name or ID"),
title: z.string().describe("The task title"),
description: z.string().describe("The task description"),
assignee: z.string().optional().describe("The person to assign the task to"),
priority: z.enum(["low", "medium", "high", "critical"]).describe("Task priority"),
},
async ({ project, title, description, assignee, priority }) => {
const task = await projectManagementAPI.createTask({
project, title, description, assignee, priority
});
return {
content: [{
type: "text",
text: `Task created: ${task.id} - ${task.title} (${task.status})`
}]
};
}
);
// Define a tool for querying tasks
server.tool(
"get_tasks",
"Get tasks from a project, optionally filtered by status or assignee",
{
project: z.string().describe("The project name or ID"),
status: z.enum(["open", "in_progress", "done"]).optional(),
assignee: z.string().optional(),
},
async ({ project, status, assignee }) => {
const tasks = await projectManagementAPI.getTasks({ project, status, assignee });
return {
content: [{
type: "text",
text: JSON.stringify(tasks, null, 2)
}]
};
}
);
// Define a resource for project summaries
server.resource(
"project-summary",
"project://{projectId}/summary",
async (uri) => {
const projectId = uri.pathname.split("/")[1];
const summary = await projectManagementAPI.getProjectSummary(projectId);
return {
contents: [{
uri: uri.href,
mimeType: "text/plain",
text: summary
}]
};
}
);
// Similar tools can be defined for other tasks beyond project management, such as automating processes in manufacturing, data processing, or analytics. This demonstrates the flexibility of MCP servers to support automation and consistency across a wide range of use cases.
const transport = new StdioServerTransport();
await server.connect(transport);
Step 2: Host the MCP Server
For Microsoft 365 integration, the MCP server needs to be accessible over HTTP. Deploy it as a web service with the MCP HTTP transport:
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
import express from "express";
const app = express();
app.post("/mcp", async (req, res) => {
const transport = new StreamableHTTPServerTransport("/mcp", res);
await server.connect(transport);
await transport.handleRequest(req, res);
});
app.listen(3001);
Secure the endpoint with authentication (API key or OAuth) and deploy to your cloud infrastructure.
Step 3: Create the Declarative Agent Manifest
The declarative agent manifest defines the agent’s identity, capabilities, and MCP connections:
{
"$schema": "https://developer.microsoft.com/json-schemas/copilot/declarative-agent/v1.0/schema.json",
"version": "v1.0",
"name": "Project Assistant",
"description": "Helps you manage project tasks and check project status",
"instructions": "You are a project management assistant. Help users create tasks, check project status, and manage their workload. Always confirm task details before creating. Use a professional, concise tone.",
"capabilities": [
{
"name": "McpServer",
"type": "mcp",
"serverUrl": "https://your-mcp-server.example.com/mcp",
"authentication": {
"type": "apiKey",
"headerName": "X-API-Key"
}
}
],
"conversationStarters": [
{
"text": "What tasks are assigned to me in the Alpha project?"
},
{
"text": "Create a high-priority task for the website redesign"
},
{
"text": "Show me a summary of the Q1 roadmap project"
}
]
}
Step 4: Package and Deploy
Package the declarative agent as a Microsoft 365 app using the Teams Toolkit or manual manifest packaging:
-
Create a Teams app manifest that references the declarative agent configuration.
-
Include the MCP server authentication credentials in the app’s configuration.
-
Deploy the app through the Microsoft 365 admin centre or sideload for testing.
Once deployed, users interact with the agent through the Copilot interface in Teams, Word, Excel, or other Microsoft 365 applications. When a user says “Create a high-priority task in the Alpha project to fix the login bug,” the Copilot agent:
-
Parses the natural language request.
-
Identifies the create_task tool from the MCP server.
-
Calls the MCP server with the extracted parameters.
-
Returns the confirmation to the user.
Relationship to Existing Office Add-In APIs
MCP does not replace the Office JavaScript APIs that power existing add-ins. The two serve different purposes:
-
Office JavaScript APIs provide direct manipulation of Office documents — reading and writing cells in Excel, formatting text in Word, managing email in Outlook. Traditional add-ins are explicitly programmed to perform these document manipulation tasks, with specific rules and instructions coded by developers.
-
MCP provides a protocol for agent-to-tool communication. It enables Copilot agents to invoke external tools and access external data sources through natural language, allowing for more flexible, agent-driven interactions that are not limited to explicitly programmed functions.
For add-in developers, the practical approach is:
-
Continue using Office JavaScript APIs for document manipulation features.
-
Use MCP for agent-facing capabilities that connect to external systems.
-
Use the unified manifest to package both add-in and agent capabilities in a single app.
Security Considerations
When building MCP servers for Microsoft 365 integration, security is paramount:
Authentication. Every MCP server must require authentication. Use API keys as a minimum, OAuth 2.0 for enterprise deployments. Never expose an unauthenticated MCP server.
Authorization. The MCP server should enforce per-user authorization. When Copilot calls the MCP server on behalf of a user, the server should verify that the user has permission to perform the requested action.
Input validation. Validate all parameters received from the MCP client. AI-generated parameters may contain unexpected values — sanitise inputs before passing them to backend systems.
Audit logging. Log all MCP tool invocations, including the user identity, the tool called, the parameters provided, and the result. This is essential for compliance and debugging.
Rate limiting. Implement rate limits to prevent abuse — whether from misconfigured agents generating excessive requests or from potential security threats.
Ethics and Bias in AI
As AI systems become more deeply embedded in business operations and daily life, ethical considerations and the risk of algorithmic bias are increasingly in the spotlight. AI models, especially those used in sensitive areas like hiring decisions, healthcare, and autonomous vehicles, must be designed and tested to ensure fairness, transparency, and accountability. Algorithmic bias can lead to unfair or discriminatory outcomes, perpetuating existing inequalities if not carefully managed.
AI researchers and developers have a responsibility to address these challenges by building systems that are both effective and ethical. This includes rigorous testing of AI models, ongoing monitoring for unintended consequences, and implementing safeguards to prevent bias in decision-making processes. For example, Microsoft 365 Copilot, which automates repetitive tasks and provides personalized support, must be continually evaluated to ensure it does not inadvertently disadvantage certain groups or reinforce stereotypes.
The use of AI in real-world applications raises important questions about privacy, consent, and the broader impact of automation. As organizations adopt AI-powered tools like Microsoft 365 Copilot, it is essential to prioritize ethical AI development—balancing innovation with a commitment to fairness and social responsibility. By staying informed and proactive, businesses can harness the power of AI while minimizing risks and building trust with users and stakeholders.
Getting Started with MCP
For Office add-in developers looking to start with MCP:
-
Explore existing MCP servers. A growing library of pre-built MCP servers covers common integrations (databases, APIs, file systems). These can be used as-is or as starting points for custom servers.
-
Build a simple MCP server. Start with a single-tool MCP server that connects to one of your existing systems. The TypeScript SDK makes this straightforward.
-
Create a declarative agent. Use the MCP server in a declarative agent manifest and test through Teams or Copilot.
-
Iterate based on usage. Monitor how users interact with the agent and add tools, resources, and prompts based on observed needs. Each iteration should be informed by the knowledge gained from observing user interactions and agent performance, applying these insights to improve the agent’s effectiveness.
McKenna Consultants has been building Microsoft Office add-ins and AI integrations for years. The convergence of add-ins and agents through MCP is a natural extension of our expertise. If you are planning to build Microsoft 365 Copilot agents or integrate MCP into your Office extensibility strategy, contact us to discuss your requirements.