Skip to main content

MCP Server

You are able to convert any App into an MCP server by using the McpPlugin. This plugin adds the necessary endpoints to your application to serve as an MCP server. The plugin allows you to define tools, resources, and prompts that can be exposed to other MCP applications.

Install it to your application:

npm install @microsoft/teams.mcp@preview

Your plugin can be configured as follows:

note

By default, the MCP server will be available at /mcp on your application. You can change this by setting the transport.path property in the plugin configuration.

And included in the app like any other plugin:

tip

Enabling mcp request inspection and the DevtoolsPlugin allows you to see all the requests and responses to and from your MCP server (similar to how the Activities tab works).

MCP Server in Devtools

Piping messages to the user

Since your agent is provisioned to work on Teams, one very helpful feature is to use this server as a way to send messages to the user. This can be helpful in various scenarios:

  1. Human in the loop - if the server or an MCP client needs to confirm something with the user, it is able to do so.
  2. Notifications - the server can be used as a way to send notifications to the user.

Here is an example of how to do this. Configure your plugin so that:

  1. It can validate if the incoming request is allowed to send messages to the user
  2. It fetches the correct conversation ID for the given user.
  3. It sends a proactive message to the user. See Proactive Messaging for more details.