Microsoft.Azure.Functions.Worker.Extensions.Mcp
1.0.0-preview.2
Prefix Reserved
dotnet add package Microsoft.Azure.Functions.Worker.Extensions.Mcp --version 1.0.0-preview.2
NuGet\Install-Package Microsoft.Azure.Functions.Worker.Extensions.Mcp -Version 1.0.0-preview.2
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Mcp" Version="1.0.0-preview.2" />
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Mcp" Version="1.0.0-preview.2" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Mcp" />
paket add Microsoft.Azure.Functions.Worker.Extensions.Mcp --version 1.0.0-preview.2
#r "nuget: Microsoft.Azure.Functions.Worker.Extensions.Mcp, 1.0.0-preview.2"
#addin nuget:?package=Microsoft.Azure.Functions.Worker.Extensions.Mcp&version=1.0.0-preview.2&prerelease
#tool nuget:?package=Microsoft.Azure.Functions.Worker.Extensions.Mcp&version=1.0.0-preview.2&prerelease
Microsoft.Azure.Functions.Worker.Extensions.Mcp
This package provides triggers and bindings to support exposing Azure Functions .NET isolated functions as a Model Context Protocol (MCP) server.
Example usage
The following is an example of how to use the MCP tool trigger in an Azure Functions application:
[Function(nameof(GetSnippet))]
public object GetSnippet(
[McpToolTrigger(GetSnippetToolName, GetSnippetToolDescription)] ToolInvocationContext context,
[BlobInput(BlobPath)] string snippetContent)
{
return snippetContent;
}
You can also bind to the MCP tool property arguments using the McpToolProperty
input binding as follows:
[Function(nameof(SaveSnippet))]
[BlobOutput(BlobPath)]
public string SaveSnippet(
[McpToolTrigger(SaveSnippetToolName, SaveSnippetToolDescription)] ToolInvocationContext context,
[McpToolProperty(SnippetNamePropertyName, PropertyType, SnippetNamePropertyDescription)] string name,
[McpToolProperty(SnippetPropertyName, PropertyType, SnippetPropertyDescription)] string snippet)
{
return snippet;
}
The above example will automatically expose the name
and snippet
parameters as properties for the MCP tool.
Alternatively, you can define properties when creating your application as follows:
builder.EnableMcpToolMetadata();
// Define properties for the MCP tool:
builder.ConfigureMcpTool("SaveSnippet")
.WithProperty(SnippetNamePropertyName, PropertyType, SnippetNamePropertyDescription);
The above example demonstrates how the properties for the tool named SaveSnippet
are defined.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net8.0
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0-preview.2 | 566 | 4/6/2025 |
1.0.0-preview.1 | 193 | 4/4/2025 |