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: README.md
+23-7
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,7 @@ An Azure Storage Emulator is needed for this particular sample because we will s
62
62
63
63
Note by default this will use the webhooks route: `/runtime/webhooks/mcp/sse`. Later we will use this in Azure to set the key on client/host calls: `/runtime/webhooks/mcp/sse?code=<system_key>`
64
64
65
-
## Use the MCP server from within a client/host
65
+
## Connect to the *local* MCP server from within a client/host
66
66
67
67
### VS Code - Copilot Edits
68
68
@@ -120,13 +120,18 @@ azd env set VNET_ENABLED true
120
120
121
121
Additionally, [API Management]() can be used for improved security and policies over your MCP Server, and [App Service built-in authentication](https://learn.microsoft.com/en-us/azure/app-service/overview-authentication-authorization) can be used to set up your favorite OAuth provider including Entra.
122
122
123
-
### Connect to your function app from a client
123
+
## Connect to your *remote() MCP server function app from a client
124
124
125
125
Your client will need a key in order to invoke the new hosted SSE endpoint, which will be of the form `https://<funcappname>.azurewebsites.net/runtime/webhooks/mcp/sse`. The hosted function requires a system key by default which can be obtained from the [portal](https://learn.microsoft.com/en-us/azure/azure-functions/function-keys-how-to?tabs=azure-portal) or the CLI (`az functionapp keys list --resource-group <resource_group> --name <function_app_name>`). Obtain the system key named `mcp_extension`.
126
126
127
-
For MCP Inspector, you can include the key in the URL: `https://<funcappname>.azurewebsites.net/runtime/webhooks/mcp/sse?code=<your-mcp-extension-system-key>`.
127
+
### Connect to remote MCP server in MCP Inspector
128
+
For MCP Inspector, you can include the key in the URL:
For GitHub Copilot within VS Code, you should instead set the key as the `x-functions-key` header in `mcp.json`, and you would just use `https://<funcappname>.azurewebsites.net/runtime/webhooks/mcp/sse` for the URL. The following example uses an input and will prompt you to provide the key when you start the server from VS Code:
133
+
### Connect to remote MCP server in VS Code - GitHub Copilot
134
+
For GitHub Copilot within VS Code, you should instead set the key as the `x-functions-key` header in `mcp.json`, and you would just use `https://<funcappname>.azurewebsites.net/runtime/webhooks/mcp/sse` for the URL. The following example uses an input and will prompt you to provide the key when you start the server from VS Code. Note [mcp.json]() has already been included in this repo and will be picked up by VS Code. Click Start on the server to be prompted for values including `functionapp-name` (in your /.azure/*/.env file) and `functions-mcp-extension-system-key` which can be obtained from CLI command above or API Keys in the portal for the Function App.
130
135
131
136
```json
132
137
{
@@ -136,20 +141,31 @@ For GitHub Copilot within VS Code, you should instead set the key as the `x-func
136
141
"id": "functions-mcp-extension-system-key",
137
142
"description": "Azure Functions MCP Extension System Key",
Click Start on the server to be prompted for values including `functionapp-name` (in your /.azure/*/.env file) and `functions-mcp-extension-system-key` which can be obtained from CLI command above or API Keys in the portal for the Function App.
168
+
153
169
## Redeploy your code
154
170
155
171
You can run the `azd up` command as many times as you need to both provision your Azure resources and deploy code updates to your function app.
@@ -168,7 +184,7 @@ azd down
168
184
169
185
## Source Code
170
186
171
-
The functioncodeforthe `GetSnippet` and `SaveSnippet` endpoints are definedin [`SnippetsTool.cs`](./dotnet/). The `McpToolsTrigger` attribute applied to the async `Run` method exposes the code functionas an MCP Server.
187
+
The functioncodeforthe `GetSnippet` and `SaveSnippet` endpoints are definedin [`SnippetsTool.cs`](./src/SnippetsTool.cs). The `McpToolsTrigger` attribute applied to the async `Run` method exposes the code functionas an MCP Server.
172
188
173
189
This shows the code for a few MCP server examples (get string, get object, save object):
0 commit comments