Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 39 additions & 48 deletions msteams-platform/m365-apps/agent-connectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ ms.topic: how-to
ms.subservice: m365apps
---

# Register MCP servers as agent connectors for Microsoft 365 (preview)

Agents in Microsoft 365, such as [Channel Agent](/microsoftteams/set-up-channel-agent-teams) in Microsoft Teams, can connect to external systems through *agent connectors* declared in the app manifest. This article shows you how to register your remote Model Context Protocol (MCP) server in the Microsoft 365 app manifest, enabling Microsoft 365 agents to securely discover, select, and invoke MCP tools that your server exposes.
# Register MCP servers as agent connectors for Microsoft 365

Agents in Microsoft 365<!--, such as [Channel Agent](/microsoftteams/set-up-channel-agent-teams) in Microsoft Teams,--> can connect to external systems through *agent connectors* declared in the app manifest. This article shows you how to register your remote Model Context Protocol (MCP) server in the Microsoft 365 app manifest, enabling Microsoft 365 agents to securely discover, select, and invoke MCP tools that your server exposes.
<!--
> [!NOTE]
>
> Agent Connectors are available in [public developer preview](../resources/dev-preview/developer-preview-intro.md) and only supported in Channel Agent for Microsoft Teams. Additional agent hosts will be supported in the future.
-->

Microsoft 365 agents use agent connectors to communicate with external systems. For MCP servers, the connector provides:

Expand All @@ -22,44 +23,43 @@ Microsoft 365 agents use agent connectors to communicate with external systems.
- Tool definitions (inline or dynamically discovered)
Comment thread
SirajShaik-MSFT marked this conversation as resolved.
Outdated
- Optional metadata that helps agents orchestrate the right tool during user interactions

Once registered, your MCP server becomes available to any Microsoft 365 agent capable of using MCP, including the Channel Agent in Microsoft Teams.
Once registered, your MCP server becomes available to any Microsoft 365 agent capable of using MCP.<!--, including the Channel Agent in Microsoft Teams.-->

## Prerequisites

Before you begin, ensure you have:

- A test tenant [enabled with Teams public preview](/microsoftteams/public-preview-doc-updates) features (for testing your MCP integration with Teams Channel Agent)
- A test tenant to validate your MCP integration
- A working MCP server with a secure public endpoint
- Authentication credentials (OAuth configuration or API key)
- Authentication credentials ([OAuth configuration](../messaging-extensions/api-based-oauth.md#configure-oauth-in-developer-portal) or [API key](../messaging-extensions/api-based-secret-service-auth.md#api-key-authentication))

## Add the agent connector to your manifest

First, declare your MCP server in the [agentConnectors](/microsoft-365/extensibility/schema/root-agent-connectors?view=m365-app-prev&preserve-view=true) array at the root level of your app manifest.
First, declare your MCP server in the [agentConnectors](/microsoft-365/extensibility/schema/root-agent-connectors?view=m365-app-1.27&preserve-view=true) array at the root level of your app manifest.

1. Open your Microsoft 365 app manifest (`manifest.json`) file.

2. Locate or create the root-level `agentConnectors` array.

3. Add a new connector object with a unique `id`, display name, and description:
3. Add a new connector object with a unique `id`, `displayName`, and `description`:

````json
{
"$schema": "https://developer.microsoft.com/json-schemas/teams/vDevPreview/MicrosoftTeams.schema.json",
"manifestVersion": "devPreview",
"$schema": "https://developer.microsoft.com/json-schemas/teams/v1.27/MicrosoftTeams.schema.json",
"manifestVersion": "1.27",
...
"agentConnectors": [
{
"id": "my-mcp-server",
"displayName": "My Automation Server",
"description": "Provides workflow automation and task management tools.",
"toolSource": {
"remoteMcpServer": {
"mcpServerUrl": "https://mcp.mycompany.com"
}
"agentConnectors": [
{
"id": "my-mcp-server",
"displayName": "My Automation Server",
"description": "Provides workflow automation and task management tools.",
"toolSource": {
"remoteMcpServer": {
"mcpServerUrl": "https://mcp.mycompany.com"
Comment thread
SirajShaik-MSFT marked this conversation as resolved.
Outdated
}
}
]
}
}
]
}
````

Expand All @@ -71,15 +71,15 @@ For MCP servers, use **remoteMcpServer** unless your server runs locally within

Define how Microsoft 365 connects to your MCP server using the `remoteMcpServer` object.

1. Within your connector's [toolSource](/microsoft-365/extensibility/schema/root-agent-connectors-tool-source?view=m365-app-prev&preserve-view=true), specify the `remoteMcpServer` endpoint:
1. Within your connector's [toolSource](/microsoft-365/extensibility/schema/root-agent-connectors-tool-source?view=m365-app-1.27&preserve-view=true), specify the `remoteMcpServer` endpoint:
Comment thread
SirajShaik-MSFT marked this conversation as resolved.
Outdated

````json
"toolSource": {
"remoteMcpServer": {
"mcpServerUrl": "https://mcp.mycompany.com"
}
}
````
````json
"toolSource": {
"remoteMcpServer": {
"mcpServerUrl": "https://mcp.mycompany.com"
}
}
````

2. Ensure your endpoint uses HTTPS (for HTTP connections) or WSS (for WebSocket connections).

Expand All @@ -91,10 +91,8 @@ Specify how Microsoft 365 retrieves credentials when calling your MCP server. Th

- **None**: No authentication required
- **OAuthPluginVault**: OAuth 2.0 tokens stored inside Microsoft’s secure vault
<!-- Uncomment once supported
- **ApiKeyPluginVault**: API key stored in a vault and referenced by ID
- **DynamicClientRegistration**: Dynamic OAuth client creation
-->
<!--- **DynamicClientRegistration**: Dynamic OAuth client creation-->

### Use OAuth authentication

Expand All @@ -114,7 +112,6 @@ The `referenceId` points to a secure [OAuth configuration that you register in D

When setting up your OAuth app with a third-party authentication provider, ensure that you add `https://teams.microsoft.com/api/platform/v1.0/oAuthRedirect` to the list of allowed redirect endpoints.

<!-- Uncomment when supported
### Use API key authentication

For API keys stored in a vault, configure the authorization type as `ApiKeyPluginVault`:
Expand All @@ -127,7 +124,6 @@ For API keys stored in a vault, configure the authorization type as `ApiKeyPlugi
````

The `referenceId` points to an [API key that you register in Developer Portal](https://dev.teams.microsoft.com/tools/api-key-registration). For details, see [API key authentication](../messaging-extensions/api-based-secret-service-auth.md).
-->

### Use no authentication

Expand All @@ -137,21 +133,16 @@ For enterprise scenarios, prefer OAuth over API keys to align with security best

## Define tool discovery

Choose how Microsoft 365 agents discover the tools your MCP server provides. Currently only inline tool definitions are supported.

You can use inline definitions if your toolset is static, or dynamic discovery if your toolset changes frequently.


Configure how Microsoft 365 agents discover the tools your MCP server provides. Currently only inline tool definitions are supported. Use inline definitions if your toolset is static.<!-- or dynamic discovery if your toolset changes frequently.-->
<!--
### Enable dynamic tool discovery

Dynamic discovery allows Microsoft 365 to fetch your tool list at runtime, which is recommended for servers whose tools change frequently.

You can enable dynamic tool discovery by omitting the [mcpToolDescription](/microsoft-365/extensibility/schema/root-agent-connectors-tool-source-remote-mcp-server-mcp-tool-description) from your [localMcpServer](/microsoft-365/extensibility/schema/root-agent-connectors-tool-source-local-mcp-server) or [remoteMcpServer](/microsoft-365/extensibility/schema/root-agent-connectors-tool-source-remote-mcp-server) configuration.

When enabled, agents call your server's `tools/list` method to retrieve available tools. This approach eliminates the need to republish your app when tools change.

-->

### Use inline tool definitions

For static toolsets that don't change frequently, add an `mcpToolDescription` object with your tool definitions:
Expand Down Expand Up @@ -179,8 +170,8 @@ The following is an example of a complete agent connector configuration, using *

```json
{
"$schema": "https://developer.microsoft.com/json-schemas/teams/vDevPreview/MicrosoftTeams.schema.json",
"manifestVersion": "devPreview",
"$schema": "https://developer.microsoft.com/json-schemas/teams/v1.27/MicrosoftTeams.schema.json",
"manifestVersion": "1.27",
...
"agentConnectors": [
{
Expand Down Expand Up @@ -230,15 +221,15 @@ The following is an example of a complete agent connector configuration, using *
}
```

This configuration is sufficient for Microsoft 365 agents, including the Channel Agent in Teams, to establish a connection and discover tools from your MCP server.
This configuration is sufficient for Microsoft 365 agents<!--, including the Channel Agent in Teams,--> to establish a connection and discover tools from your MCP server.

## Validate your configuration

Before deploying your app, verify that your manifest and MCP server are correctly configured.
Before deploying your agent or app, verify that your manifest and MCP server are correctly configured.

1. Use the [Microsoft 365 app package validation](https://dev.teams.microsoft.com/tools/store-validation) tool in Developer Portal to check your manifest for errors.

2. Verify your MCP server responds correctly to handshake messages by testing the connection manually.
2. Verify if your MCP server responds correctly to handshake messages by testing the connection manually.

3. Confirm that your `tools/list` endpoint returns schema-compliant tool definitions:

Expand All @@ -260,9 +251,9 @@ Before deploying your app, verify that your manifest and MCP server are correctl

Validate your integration by testing with actual Microsoft 365 agents.

1. Deploy your app to a test environment.
1. Deploy your agent or app to a test environment.

2. Open a [Channel Agent](/microsoftteams/set-up-channel-agent-teams) in Microsoft Teams or another Microsoft 365 agent that supports MCP.
2. Open a <!--[Channel Agent](/microsoftteams/set-up-channel-agent-teams) in Microsoft Teams or another -->Microsoft 365 agent that supports MCP.

3. Test natural language commands that should trigger your tools:
- "Create a task in my project management system"
Expand Down