Skip to content

Commit b37e9c3

Browse files
Craig ShoemakerCraig Shoemaker
authored andcommitted
updates
1 parent edebe62 commit b37e9c3

6 files changed

Lines changed: 55 additions & 14 deletions

articles/container-apps/mcp-authentication.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ Use the following command to fetch the API key for your session pool.
169169

170170
```azurecli
171171
API_KEY=$(az rest --method POST \
172-
--uri "https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.App/sessionPools/$SESSION_POOL_NAME/fetchMCPServerCredentials" \
172+
--uri "https://management.azure.com/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP>/providers/Microsoft.App/sessionPools/<SESSION_POOL_NAME>/fetchMCPServerCredentials" \
173173
--uri-parameters api-version=2025-02-02-preview \
174174
--query "apiKey" -o tsv)
175175
```
@@ -182,7 +182,7 @@ To rotate the API key, call the `regenerateCredentials` action on the session po
182182

183183
```azurecli
184184
az rest --method POST \
185-
--uri "https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.App/sessionPools/$SESSION_POOL_NAME/regenerateCredentials" \
185+
--uri "https://management.azure.com/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP>/providers/Microsoft.App/sessionPools/<SESSION_POOL_NAME>/regenerateCredentials" \
186186
--uri-parameters api-version=2025-02-02-preview
187187
```
188188

articles/container-apps/mcp-troubleshooting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ The correct endpoint path depends on your MCP SDK and routing configuration.
4747
| Java (Spring Boot SSE) | `/mcp` | SSE transport; path set in `WebMvcSseServerTransportProvider` constructor |
4848
| Platform-managed sessions | Value from `mcpServerEndpoint` | Full URL provided by the Azure Resource Manager (ARM) API; retrieve it from the session pool properties |
4949

50-
A common cause of 404 errors in Python is mounting the FastMCP app at `/mcp` instead of `/` on the FastAPI router. Because the SDK adds its own `/mcp` subpath, mounting at `/mcp` results in a `/mcp/mcp` endpoint. Mount at `/` so the final path is `/mcp`.
50+
A common cause of 404 errors in Python is mounting the FastMCP app at `/mcp` instead of `/` on the FastAPI router. Since the SDK adds its own `/mcp` subpath, mounting at `/mcp` results in a `/mcp/mcp` endpoint. Mount at `/` so the final path is `/mcp`.
5151

5252
Verify the endpoint responds by testing with curl:
5353

@@ -274,7 +274,7 @@ If `isMCPServerEnabled` is `false` or the field is absent, redeploy the session
274274

275275
**Cause**: Dynamic sessions with MCP are available in a subset of Azure regions during preview.
276276

277-
**Solution**: Check the [Azure Container Apps sessions documentation](/azure/container-apps/sessions) for the current list of supported regions.
277+
**Solution**: Check the [sessions documentation](/azure/container-apps/sessions) for the current list of supported regions.
278278

279279
## Diagnose and debug
280280

articles/container-apps/tutorial-mcp-server-dotnet.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ Next, define the task-management data store and the MCP tools that expose it to
138138
}
139139
```
140140
141+
The `TaskItem` record defines the data model with five properties. The `TaskStore` class manages an in-memory list prepopulated with sample data and provides methods to list, find, create, toggle, and delete tasks.
142+
141143
1. Create a file named `TasksMcpTools.cs` with the MCP tool definitions:
142144
143145
```csharp
@@ -255,6 +257,8 @@ Package the application as a Docker container so you can test it locally before
255257
ENTRYPOINT ["dotnet", "TasksMcpServer.dll"]
256258
```
257259
260+
The multi-stage build uses the SDK image to restore, build, and publish the app, then copies only the published output to a smaller ASP.NET runtime image. The `ASPNETCORE_URLS` environment variable configures the app to listen on port 8080.
261+
258262
1. Verify the container builds and runs locally:
259263
260264
```bash
@@ -311,7 +315,7 @@ After you containerize the application, deploy it to Azure Container Apps by usi
311315
--name $APP_NAME \
312316
--resource-group $RESOURCE_GROUP \
313317
--allowed-origins "*" \
314-
--allowed-methods "GET,POST,OPTIONS" \
318+
--allowed-methods "GET,POST,DELETE,OPTIONS" \
315319
--allowed-headers "*"
316320
```
317321
@@ -384,13 +388,17 @@ If you don't plan to continue using this application, delete the resource group
384388
az group delete --resource-group $RESOURCE_GROUP --yes --no-wait
385389
```
386390
391+
## Next step
392+
393+
> [!div class="nextstepaction"]
394+
> [Secure MCP servers on Container Apps](mcp-authentication.md)
395+
387396
## Related content
388397
389398
- [MCP servers on Azure Container Apps overview](mcp-overview.md)
390399
- [Deploy an MCP server to Container Apps (Python)](tutorial-mcp-server-python.md)
391400
- [Deploy an MCP server to Container Apps (Node.js)](tutorial-mcp-server-nodejs.md)
392401
- [Deploy an MCP server to Container Apps (Java)](tutorial-mcp-server-java.md)
393-
- [Secure MCP servers on Container Apps](mcp-authentication.md)
394402
- [Troubleshoot MCP servers on Container Apps](mcp-troubleshooting.md)
395403
- [ModelContextProtocol.AspNetCore NuGet package](https://www.nuget.org/packages/ModelContextProtocol.AspNetCore)
396404
- [MCP C# SDK](https://github.com/modelcontextprotocol/csharp-sdk)

articles/container-apps/tutorial-mcp-server-java.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ In this section, you create a new Spring Boot project with the MCP Java SDK.
9090
</project>
9191
```
9292

93+
The `pom.xml` defines a Spring Boot application with two key dependencies: `spring-boot-starter-web` for the web framework and `mcp-spring-webmvc` for the MCP SDK. The Spring Boot Maven plugin packages the app as an executable JAR.
94+
9395
> [!NOTE]
9496
> The MCP Java SDK is under active development. Check the [MCP Java SDK releases](https://github.com/modelcontextprotocol/java-sdk/releases) for the latest version and update the `<version>` accordingly.
9597

@@ -142,6 +144,8 @@ In this section, you define the task data model and an in-memory store.
142144
}
143145
```
144146

147+
The `TaskItem` class defines the data model with standard getters and a setter for the completion status. The constructor initializes the `createdAt` timestamp automatically.
148+
145149
1. Create `src/main/java/com/example/tasksmcp/TaskStore.java`:
146150

147151
```java
@@ -192,6 +196,8 @@ In this section, you define the task data model and an in-memory store.
192196
}
193197
```
194198
199+
The `TaskStore` Spring component manages an in-memory list prepopulated with sample data. It uses `AtomicInteger` for thread-safe ID generation and provides methods for standard CRUD operations.
200+
195201
## Define the MCP tools
196202
197203
In this section, you define the MCP tools that the AI model can invoke and configure the MCP server in your Spring Boot application.
@@ -416,7 +422,6 @@ In this section, you define the MCP tools that the AI model can invoke and confi
416422
- `WebMvcSseServerTransportProvider` registers the SSE transport at the `/mcp` path.
417423
- `McpServer.sync(transport)` configures tool capabilities and registers each tool specification.
418424
- CORS is enabled because GitHub Copilot in VS Code makes cross-origin requests to MCP servers.
419-
- A `/health` endpoint is added separately for Azure Container Apps health probes. MCP endpoints return JSON-RPC responses that aren't suitable as health checks.
420425
421426
> [!NOTE]
422427
> This tutorial uses `WebMvcSseServerTransportProvider` (SSE transport) because the MCP Java SDK doesn't yet offer a stable streamable HTTP transport. The other language tutorials (.NET, Python, Node.js) use streamable HTTP. When the Java SDK adds streamable HTTP support, update the transport provider accordingly. The SSE transport is fully compatible with VS Code Copilot and other MCP clients.
@@ -446,6 +451,8 @@ In this section, you define the MCP tools that the AI model can invoke and confi
446451
}
447452
```
448453
454+
The main class bootstraps the Spring Boot application and exposes a `/health` endpoint for Container Apps health probes. MCP endpoints return JSON-RPC responses, so a separate health endpoint is needed for health checks.
455+
449456
## Test the MCP server locally
450457
451458
Before deploying to Azure, verify the MCP server works by running it locally and connecting from GitHub Copilot.
@@ -514,7 +521,7 @@ Package the application as a Docker container so you can test it locally before
514521
515522
## Deploy to Azure Container Apps
516523
517-
Now you deploy the containerized MCP server to Azure Container Apps using the Azure CLI.
524+
After you containerize the application, deploy it to Azure Container Apps by using the Azure CLI. The `az containerapp up` command builds the container image in the cloud, so you don't need Docker on your machine for this step.
518525
519526
1. Set environment variables:
520527
@@ -575,6 +582,8 @@ Now you deploy the containerized MCP server to Azure Container Apps using the Az
575582
576583
## Connect GitHub Copilot to the deployed server
577584
585+
Now that the MCP server is running in Azure, configure VS Code to connect GitHub Copilot to the deployed endpoint.
586+
578587
1. Create or update `.vscode/mcp.json`:
579588
580589
```json
@@ -632,12 +641,16 @@ If you're not going to continue to use this application, delete the resource gro
632641
az group delete --resource-group $RESOURCE_GROUP --yes --no-wait
633642
```
634643
644+
## Next step
645+
646+
> [!div class="nextstepaction"]
647+
> [Secure MCP servers on Container Apps](mcp-authentication.md)
648+
635649
## Related content
636650
637651
- [MCP servers on Azure Container Apps overview](mcp-overview.md)
638652
- [Deploy an MCP server to Container Apps (.NET)](tutorial-mcp-server-dotnet.md)
639653
- [Deploy an MCP server to Container Apps (Python)](tutorial-mcp-server-python.md)
640654
- [Deploy an MCP server to Container Apps (Node.js)](tutorial-mcp-server-nodejs.md)
641-
- [Secure MCP servers on Container Apps](mcp-authentication.md)
642655
- [Troubleshoot MCP servers on Container Apps](mcp-troubleshooting.md)
643656
- [MCP Java SDK](https://github.com/modelcontextprotocol/java-sdk)

articles/container-apps/tutorial-mcp-server-nodejs.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ In this section, you create a new Node.js project with Express and the MCP TypeS
6767
}
6868
```
6969

70+
This configuration targets ES2022 with Node.js module resolution, outputs compiled files to `dist/`, and enables strict type checking.
71+
7072
1. Update `package.json` to enable ES modules and add build and start scripts. Add or replace the `type` and `scripts` fields:
7173

7274
```json
@@ -151,6 +153,8 @@ In this section, you create a new Node.js project with Express and the MCP TypeS
151153
export const store = new TaskStore();
152154
```
153155
156+
The `TaskItem` interface defines the task data shape. The `TaskStore` class manages an in-memory array prepopulated with sample data and provides methods to list, find, create, toggle, and delete tasks. A module-level singleton is exported for use by the MCP tools.
157+
154158
## Define the MCP tools
155159
156160
Next, you define the MCP server with tool registrations that expose the task store to AI clients.
@@ -331,6 +335,8 @@ Package the application as a Docker container so you can test it locally before
331335
CMD ["node", "dist/index.js"]
332336
```
333337
338+
The multi-stage build compiles TypeScript in the first stage, then creates a production image with only runtime dependencies and the compiled JavaScript output. The `PORT` environment variable is set to 8080 to match the Container Apps target port.
339+
334340
1. Verify locally:
335341
336342
```bash
@@ -432,7 +438,7 @@ Now that the MCP server is running in Azure, configure VS Code to connect GitHub
432438
433439
## Configure scaling for interactive use
434440
435-
By default, Azure Container Apps scale to zero replicas. For MCP servers that serve interactive clients like Copilot, cold starts cause noticeable delays. Set a minimum replica count to keep at least one instance running:
441+
By default, Azure Container Apps can scale to zero replicas. For MCP servers that serve interactive clients like Copilot, cold starts cause noticeable delays. Set a minimum replica count to keep at least one instance running:
436442
437443
```azurecli
438444
az containerapp update \
@@ -460,12 +466,16 @@ If you don't plan to continue using this application, delete the resource group
460466
az group delete --resource-group $RESOURCE_GROUP --yes --no-wait
461467
```
462468
469+
## Next step
470+
471+
> [!div class="nextstepaction"]
472+
> [Secure MCP servers on Container Apps](mcp-authentication.md)
473+
463474
## Related content
464475
465476
- [MCP servers on Azure Container Apps overview](mcp-overview.md)
466477
- [Deploy an MCP server to Container Apps (.NET)](tutorial-mcp-server-dotnet.md)
467478
- [Deploy an MCP server to Container Apps (Python)](tutorial-mcp-server-python.md)
468479
- [Deploy an MCP server to Container Apps (Java)](tutorial-mcp-server-java.md)
469-
- [Secure MCP servers on Container Apps](mcp-authentication.md)
470480
- [Troubleshoot MCP servers on Container Apps](mcp-troubleshooting.md)
471481
- [MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk)

articles/container-apps/tutorial-mcp-server-python.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ In this section, you create a new Python project with FastAPI and the MCP Python
122122
store = TaskStore()
123123
```
124124
125+
The `TaskItem` dataclass defines the data model with a `to_dict()` method for serialization. The `TaskStore` class manages an in-memory list prepopulated with sample data and provides CRUD methods. The module-level `store` singleton is shared across the application for simplicity.
126+
125127
## Define the MCP tools
126128
127129
In this section, you define the MCP tools that the AI model can invoke and mount the MCP server in your FastAPI application.
@@ -274,6 +276,8 @@ Package the application as a Docker container so you can test it locally before
274276
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080"]
275277
```
276278
279+
The Dockerfile uses a Python 3.12 slim base image, installs dependencies from `requirements.txt`, then copies the application code. Uvicorn serves the FastAPI app on port 8080.
280+
277281
1. Verify the container builds and runs locally:
278282
279283
```bash
@@ -285,7 +289,7 @@ Package the application as a Docker container so you can test it locally before
285289
286290
## Deploy to Azure Container Apps
287291
288-
Now you deploy the containerized MCP server to Azure Container Apps by using the Azure CLI.
292+
After you containerize the application, deploy it to Azure Container Apps by using the Azure CLI. The `az containerapp up` command builds the container image in the cloud, so you don't need Docker on your machine for this step.
289293
290294
1. Set environment variables:
291295
@@ -326,7 +330,7 @@ Now you deploy the containerized MCP server to Azure Container Apps by using the
326330
--name $APP_NAME \
327331
--resource-group $RESOURCE_GROUP \
328332
--allowed-origins "*" \
329-
--allowed-methods "GET,POST,OPTIONS" \
333+
--allowed-methods "GET,POST,DELETE,OPTIONS" \
330334
--allowed-headers "*"
331335
```
332336
@@ -346,6 +350,8 @@ Now you deploy the containerized MCP server to Azure Container Apps by using the
346350
347351
## Connect GitHub Copilot to the deployed server
348352
353+
Now that the MCP server is running in Azure, configure VS Code to connect GitHub Copilot to the deployed endpoint.
354+
349355
1. Create or update `.vscode/mcp.json`:
350356
351357
```json
@@ -397,12 +403,16 @@ If you don't plan to continue using this application, delete the resource group
397403
az group delete --resource-group $RESOURCE_GROUP --yes --no-wait
398404
```
399405
406+
## Next step
407+
408+
> [!div class="nextstepaction"]
409+
> [Secure MCP servers on Container Apps](mcp-authentication.md)
410+
400411
## Related content
401412
402413
- [MCP servers on Azure Container Apps overview](mcp-overview.md)
403414
- [Deploy an MCP server to Container Apps (.NET)](tutorial-mcp-server-dotnet.md)
404415
- [Deploy an MCP server to Container Apps (Node.js)](tutorial-mcp-server-nodejs.md)
405416
- [Deploy an MCP server to Container Apps (Java)](tutorial-mcp-server-java.md)
406-
- [Secure MCP servers on Container Apps](mcp-authentication.md)
407417
- [Troubleshoot MCP servers on Container Apps](mcp-troubleshooting.md)
408418
- [MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk)

0 commit comments

Comments
 (0)