Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This guide walks you through the process of integrating your service with Microsoft 365 Copilot by adding an MCP server to a declarative agent using the Microsoft 365 Agents Toolkit. By following these steps, you'll enable conversational, AI-powered access to your MCP-exposed services for business users.
Important
This feature is currently in public preview.
Prerequisites
- Requirements specified in Requirements for Copilot extensibility options
- A GitHub account
- Visual Studio Code
- Microsoft 365 Agents Toolkit version 6.3.x or later
Create the agent
Open Visual Studio Code and Select the Microsoft 365 Agents Toolkit icon in the left-hand Activity Bar.
Select Create a New Agent/App in the Agents Toolkit task pane.
Select Declarative Agent.
Select Add an Action, then select Start with an MCP Server.
Enter the GitHub MCP server URL
https://api.githubcopilot.com/mcp/.
Choose a location for the agent project.
Enter a name for the agent.
Once you complete these steps, Agents Toolkit generates the required files for the agent and opens a new Visual Studio Code window with the agent project loaded.
Add tools from the MCP server
Open the .vscode/mcp.json file. Select the Start button in the file editor.
If prompted to authenticate, select Allow to authenticate.
Select the ATK: Fetch action from MCP button in the file editor, then select ai-plugin.json.
Select operations for the agent to use. For this exercise, choose search_repositories and search_users.
Important
Only tools from MCP servers are supported.
Select OAuth (with static registration) as the authentication type.
Register an OAuth app with GitHub
Go to https://github.com/settings/developers in your browser. Select OAuth Apps, then New OAuth App.
Add a name and homepage URL for your app, and set
https://teams.microsoft.com/api/platform/v1.0/oAuthRedirectas the Authorization callback URL. Select Register application.After the app is created, select Generate a new client secret. Copy the secret and the Client ID to use in the next section.
Package and sideload the agent
Open the agent project in Visual Studio Code.
Select the Microsoft 365 Agents Toolkit icon in the left-hand Activity Bar.
In the Accounts pane, select Sign in to Microsoft 365. (If you're already signed in continue to the next step).
Confirm that both Custom App Upload Enabled and Copilot Access Enabled display under your Microsoft 365 account. If they don't, check with your organization admin. See Requirements for Copilot extensibility options for details.
In the Lifecycle pane, select Provision.
When asked to Enter client id for OAuth registration..., enter your client ID.
When asked to Enter client secret for OAuth registration..., enter your client secret.
When asked for scopes, press Enter to continue.
Read the message in the dialog and select Confirm to continue.
Wait for the toolkit to report that is finished provisioning.
Important
While this feature is in public preview, manifest validation may fail for function parameters in the following cases.
- Nested objects in the
propertiesmember - Properties in the
propertiesmember with theminimum,maximum, ordefaultmembers present
If the teamsApp/validateAppPackage step fails during provisioning, remove the unsupported members and retry the provisioning step.
Use the agent
In your browser, go to https://m365.cloud.microsoft/chat.
In the Agents section of the sidebar, locate your agent. It is listed as the name you gave in the Create the agent section, with
devappended at the end. Select the agent.Ask the agent to find a repository or user. For example,
can you find a repo for kiota?.When prompted, select Sign in to {agent-name}. In the pop-up window, login with your GitHub account and authorize the agent.
When the pop-up window closes, the agent returns a response.