Edit

Share via


MCP tool bindings for Azure Functions overview

The Model Context Protocol (MCP) is a client-server protocol intended to enable language models and agents to more efficiently discover and use external data sources and tools.

Important

The Azure Functions MCP extension is currently in preview. You can expect changes to the trigger and binding APIs until the extension becomes generally available.
You should avoid using preview extensions in production apps.

The Azure Functions MCP extension allows you to use Azure Functions to create remote MCP servers. Your function app implements a remote MCP server by exposing a set of endpoints that are implemented as MCP tool trigger functions. MCP clients, such as language models and agents, can query and access these tools to do specific tasks, such as storing or accessing code snippets. MCP clients can also subscribe to your app to receive notifications about changes to the exposed tools.

Important

The MCP extension doesn't currently support PowerShell apps.

Prerequisites

  • Requires version 2.0.2 or later of the Microsoft.Azure.Functions.Worker.Sdk package.

Install extension

Tip

The Azure Functions MCP extension supports only the isolated worker model.

Add the extension to your project by installing this NuGet package in your preferred way:

Microsoft.Azure.Functions.Worker.Extensions.Mcp

Install bundle

The MCP extension preview is part of an experimental extension bundle, which is specified in your host.json project file.

To use this experimental bundle in your app, replace the existing extensionBundle object in your project's host.json file with this JSON object:

"extensionBundle": {
  "id": "Microsoft.Azure.Functions.ExtensionBundle.Preview",
  "version": "[4.*, 5.0.0)"
}

host.json settings

This section describes the configuration settings available for this binding in version 2.x and later. Settings in the host.json file apply to all functions in a function app instance. For more information about function app configuration settings, see host.json reference for Azure Functions.

{
  "version": "2.0",
  "extensions": {
    "mcp": {
      "instructions": "Some test instructions on how to use the server",
      "serverName": "TestServer",
      "serverVersion": "2.0.0"
    }
  }
}
Property Description
instructions Describes to clients how to access the remote MCP server.
serverName A friendly name for the remote MCP server.
serverVersion Current version of the remote MCP server.

Create a tool endpoint in your remote MCP server