You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-bindings-mcp-trigger.md
+22-6Lines changed: 22 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ For information on setup and configuration details, see the [overview](functions
22
22
## Example
23
23
24
24
::: zone pivot="programming-language-csharp"
25
-
>[!TIP]
25
+
>[!NOTE]
26
26
>The Azure Functions MCP extension supports only the [isolated worker model](dotnet-isolated-process-guide.md).
27
27
28
28
This code creates an endpoint to expose a tool named `GetSnippet` that tries to retrieve a code snippet by name from blob storage.
@@ -47,7 +47,7 @@ This code creates an endpoint to expose a tool named `SaveSnippets` that tries t
47
47
For the complete code example, see [Snippets.java](https://github.com/Azure-Samples/remote-mcp-functions-java/blob/main/src/main/java/com/function/Snippets.java).
48
48
::: zone-end
49
49
::: zone pivot="programming-language-javascript"
50
-
Example code for JavaScript isn't currently available.
50
+
Example code for JavaScript isn't currently available. See the TypeScript examples for general guidance using Node.js.
51
51
::: zone-end
52
52
::: zone pivot="programming-language-typescript"
53
53
This code creates an endpoint to expose a tool named `getsnippet` that tries to retrieve a code snippet by name from blob storage.
@@ -99,7 +99,7 @@ See [Usage](#usage) to learn how to define properties of the endpoint as input p
99
99
100
100
## Annotations
101
101
102
-
The `McpTrigger` annotation creates a function that exposes a tool endpoint in your MCP server.
102
+
The `McpTrigger` annotation creates a function that exposes a tool endpoint in your remote MCP server.
103
103
104
104
The annotation supports the following configuration options:
105
105
@@ -151,7 +151,11 @@ See the [Example section](#example) for complete examples.
151
151
152
152
::: zone pivot="programming-language-csharp"
153
153
154
-
The MCP protocol enables an MCP server to make known to clients other properties of a tool endpoint. In C#, you can define one or more tool properties by applying the `McpToolProperty` attribute to input binding-style parameters in your function.
154
+
The MCP protocol enables an MCP server to make known to clients other properties of a tool endpoint. In C#, you can define properties of your tools as either input parameters using the `McpToolProperty` attribute to your trigger function code or by using the `FunctionsApplicationBuilder` when the app starts.
155
+
156
+
### [`McpToolPropertyAttribute`](#tab\attribute)
157
+
158
+
You can define one or more tool properties by applying the `McpToolProperty` attribute to input binding-style parameters in your function.
155
159
156
160
The `McpToolPropertyAttribute` type supports these properties:
157
161
@@ -161,9 +165,21 @@ The `McpToolPropertyAttribute` type supports these properties:
161
165
|**PropertyType**| The data type of the tool property, such as `string`. |
162
166
|**Description**| (Optional) Description of what the tool property does. |
163
167
168
+
You can see these attributes used in the `SaveSnippet` tool in the [Examples](#example).
169
+
170
+
### [`FunctionsApplicationBuilder`](#tab\builder)
171
+
172
+
You can define tool properties in your entry point (program.cs) file by using the `McpToolBuilder` returned by the `ConfigureMcpTool` method on `FunctionsApplicationBuilder`. This examples calls the `WithProperty` method on the builder for the `GetSnippet` tool to set the properties of the tool:
For the complete example, see the [program.cs file](https://github.com/Azure-Samples/remote-mcp-functions-dotnet/blob/main/src/Program.cs).
177
+
178
+
---
179
+
164
180
::: zone-end
165
181
::: zone pivot="programming-language-java,programming-language-python"
166
-
Properties of a tool exposed by your MCP server are defined using tool properties. These properties are returned by the `toolProperties` field, which is a string representation of an array of `ToolProperty` objects.
182
+
Properties of a tool exposed by your remote MCP server are defined using tool properties. These properties are returned by the `toolProperties` field, which is a string representation of an array of `ToolProperty` objects.
167
183
168
184
A `ToolProperty` object has this structure:
169
185
@@ -176,7 +192,7 @@ A `ToolProperty` object has this structure:
176
192
```
177
193
::: zone-end
178
194
::: zone pivot="programming-language-javascript,programming-language-typescript"
179
-
Properties of a tool exposed by your MCP server are defined using tool properties. These properties are returned by the `toolProperties` field, which is a string representation of an array of `ToolProperty` objects.
195
+
Properties of a tool exposed by your remote MCP server are defined using tool properties. These properties are returned by the `toolProperties` field, which is a string representation of an array of `ToolProperty` objects.
The [Model Content Protocol (MCP)](https://github.com/modelcontextprotocol) is a client-server protocol intended to enable language models and agents to more efficiently discover and use external data sources and tools.
The Azure Functions MCP extension allows you to use Azure Functions to create custom MCP servers. Your function app implements an MCP server by defining a set of MCP tool endpoints that are MCP 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.
21
+
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.
+ The MCP tool trigger relies on Azure Queue storage provided by the [default host storage account](./storage-considerations.md) (`AzureWebJobsStorage`). When using managed identities, make sure that your function app has at least the equivalent of these role-based permissions in the host storage account: [Storage Queue Data Reader](/azure/role-based-access-control/built-in-roles#storage-queue-data-reader) and [Storage Queue Data Message Processor](/azure/role-based-access-control/built-in-roles#storage-queue-data-message-processor).
27
+
::: zone pivot="programming-language-csharp"
27
28
+ Requires version 2.0.2 or later of the `Microsoft.Azure.Functions.Worker.Sdk` package.
28
29
29
30
## Install extension
@@ -72,14 +73,14 @@ To use this experimental bundle in your app, replace the existing `extensionBund
72
73
73
74
| Property | Description |
74
75
| ----- | ----- |
75
-
|**instructions**| Describes to clients how to access the server. |
76
-
|**serverName**| A friendly name for the server. |
77
-
|**serverVersion**| Current version of the server. |
76
+
|**instructions**| Describes to clients how to access the remote MCP server. |
77
+
|**serverName**| A friendly name for the remote MCP server. |
78
+
|**serverVersion**| Current version of the remote MCP server. |
78
79
79
80
80
81
## Related articles
81
82
82
-
[Create a tool endpoint in your MCP server](./functions-bindings-mcp-trigger.md)
83
+
[Create a tool endpoint in your remote MCP server](./functions-bindings-mcp-trigger.md)
0 commit comments