MCP with Declarative Agents on Copilot Using the M365 Agents Toolkit
This article provides an expert-level guide to building MCP-enabled declarative agents for Microsoft 365 Copilot.
In the rapidly evolving landscape of enterprise AI, Microsoft 365 Copilot has emerged as a powerhouse for productivity.
At its core, declarative agents let organizations tailor Copilot to specific business scenarios without writing imperative code.
Now, with the integration of the Model Context Protocol (MCP)—an open standard for connecting AI agents to external systems—the Microsoft 365 Agents Toolkit makes this extensibility simpler and more powerful than ever.
This article provides an expert-level guide to building MCP-enabled declarative agents for Microsoft 365 Copilot. You’ll learn the concepts, the tooling, a complete step-by-step implementation, real-world examples, best practices, and what the future holds.
Whether you’re a Microsoft 365 developer, AI architect, or enterprise solutions lead, this pattern delivers secure, scalable, production-ready agents that connect Copilot directly to your SaaS platforms, line-of-business systems, and custom workflows.
What Is Model Context Protocol (MCP)?
Model Context Protocol (MCP) is an open-source, standardized interface that allows AI models and agents to discover, connect to, and interact with external data sources, tools, and workflows in a consistent, interoperable way. Think of it as a “USB-C for AI”: one protocol that replaces dozens of custom integrations.
Key capabilities include:
- Automatic discovery of tools, actions, and knowledge exposed by an MCP server.
- Real-time data retrieval and stateful operations (create, read, update, delete).
- Seamless authentication (SSO, OAuth 2.0).
- Dynamic updates: when the backend evolves, the agent automatically reflects new capabilities without redeployment.
MCP dramatically reduces developer friction and maintenance overhead while expanding what Copilot can “see” and “do” across your ecosystem.
Declarative Agents for Microsoft 365 Copilot
Declarative agents are customized instances of Microsoft 365 Copilot that run on the same trusted orchestrator, foundation models, and security stack as the core Copilot experience. You define three elements:
- Instructions — Natural-language behavior and persona.
- Actions — Plugins or MCP servers that perform tasks.
- Knowledge — Grounding data from SharePoint, connectors, or external sources.
Unlike custom-engine agents (where you bring your own orchestrator and models), declarative agents inherit Copilot’s enterprise-grade security, compliance, Responsible AI guardrails, and multi-turn reasoning. They appear natively in the Copilot chat interface (and in Word, PowerPoint, etc.) and can be distributed via the Copilot Store or Microsoft 365 admin center.
The Microsoft 365 Agents Toolkit: Your End-to-End Development Platform
The Microsoft 365 Agents Toolkit (an evolution of Teams Toolkit) is the official Visual Studio Code and Visual Studio extension that provides zero-configuration scaffolding, debugging, testing, and deployment for both declarative and custom-engine agents. It supports the full Microsoft 365 Agents SDK, multi-channel publishing (Copilot, Teams, Outlook, web, email, SMS), and built-in integration with Azure AI Foundry and TypeSpec.
Key advantages for declarative agents:
- One-click project creation with proper manifest structure.
- Automated plugin generation from MCP servers or OpenAPI specs.
- Local testing in the Microsoft 365 Copilot web app without tenant tunneling.
- Provisioning, packaging, and publishing workflows.
Step-by-Step: Building an MCP-Powered Declarative Agent
Here’s the exact workflow using the M365 Agents Toolkit (v6.3+ recommended). The entire process requires almost no manual JSON editing—the toolkit handles schema discovery, manifest wiring, and authentication.
Prerequisites
- Visual Studio Code with the Microsoft 365 Agents Toolkit extension installed.
- Access to a Microsoft 365 tenant with Copilot licenses (sandbox via TAP recommended for testing).
- An MCP server endpoint (e.g.,
https://your-server.example.com/mcpor a partner server like GitHub’s example). - Optional: Entra ID app registration for authenticated MCP servers.
Step 1: Scaffold the Declarative Agent
- Open VS Code → Microsoft 365 Agents Toolkit pane.
- Select Create a New Agent/App → Declarative Agent.
- Choose Default folder and name your agent (e.g., “ProjectOps Agent”).
- The toolkit generates the project with
manifest.json,declarativeAgent.json, and supporting folders.
Step 2: Add the MCP Action (the magic step)
- In the toolkit pane, go to Add Action → Start with an MCP server.
- Enter your MCP server URL.
- The toolkit instantly:
- Fetches the tool list and descriptions.
- Generates the
ai-plugin.jsonplugin manifest. - Updates
declarativeAgent.jsonto reference the plugin. - Adds the plugin entry to
manifest.json.
- Select which tools to import (great for security scoping).
- Configure authentication: the toolkit supports SSO (Entra ID) or static OAuth 2.0 out of the box.
Step 3: Enhance the Agent (optional but recommended)
- Edit
declarativeAgent.jsonto add rich instructions and conversation starters. - Define Adaptive Card response templates for structured output.
- Add knowledge sources (SharePoint sites, Graph connectors).
Step 4: Test Locally
- Click Provision (one-click Azure resource creation if needed).
- Click Start Debugging → the agent side-loads into https://m365.cloud.microsoft/chat.
- Switch to your agent in the conversation drawer and test prompts like “Create a new project board in Monday.com with these tasks.”
Step 5: Publish
- Organization deployment: Package and let your Microsoft 365 admin deploy via the admin center.
- Copilot Store: Submit via Partner Center for public or private distribution.
The entire flow—from URL to working agent—takes under 10 minutes for simple MCP servers.
Real-World Examples from Partners
Several vendors already ship production MCP-powered declarative agents:
- monday.com: Create boards, assign tasks, update statuses, and pull insights—all via natural language in Copilot.
- Canva: Generate designs, search assets, and create presentations contextually inside Copilot chats.
- Sitecore: Build, localize, and personalize marketing campaigns without leaving the Microsoft 365 ecosystem.
These agents demonstrate the “plug-and-play” power of MCP: one server URL unlocks full CRUD operations grounded in enterprise security.
Best Practices and Advanced Considerations
- Security first: Only import the tools your agent actually needs. Use scoped OAuth and let the toolkit handle token exchange.
- Performance: Prefer lightweight tool descriptions; heavy computation stays on the MCP server.
- Governance: Declarative agents inherit Copilot’s data loss prevention, sensitivity labels, and audit logs. Admins control distribution centrally.
- Response semantics: Use Adaptive Cards for rich, actionable output (e.g., interactive task cards).
- Versioning: MCP servers can evolve; re-run the “Add Action” step to refresh the plugin manifest.
- Hybrid scenarios: Combine MCP actions with REST APIs, message extensions, and Graph connectors in the same agent.
Looking Ahead
Microsoft’s introduction of MCP support in declarative agents (announced at Ignite 2025 and now generally available) marks a pivotal shift toward standardized, ecosystem-wide AI extensibility. Combined with the M365 Agents Toolkit’s low-code developer experience, organizations can now deliver sophisticated, multi-tool agents at unprecedented speed while maintaining full enterprise governance.
The barrier to entry has never been lower: if you have (or can expose) an MCP server, you can bring your entire business workflow into Microsoft 365 Copilot with a URL and a few clicks.
Ready to build? Install the Microsoft 365 Agents Toolkit, grab an MCP endpoint, and start scaffolding today. The future of Copilot extensibility isn’t custom code—it’s declarative intelligence powered by open standards.
For official guidance:
- Microsoft 365 Agents Toolkit overview
- Declarative agents documentation
- Build plugins from an MCP server
Happy agent building! The next breakthrough Copilot experience in your organization is just one MCP URL away.



