Skip to content

Commit e7ffd04

Browse files
Merge pull request #49383 from dotnet/main
Merge main into live
2 parents dee0038 + b3e1e8f commit e7ffd04

File tree

41 files changed

+99
-82
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+99
-82
lines changed

.github/workflows/scorecards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@ jobs:
7171

7272
# Upload the results to GitHub's code scanning dashboard.
7373
- name: "Upload to code-scanning"
74-
uses: github/codeql-action/upload-sarif@f443b600d91635bebf5b0d9ebc620189c0d6fba5 # v3.29.5
74+
uses: github/codeql-action/upload-sarif@16140ae1a102900babc80a33c44059580f687047 # v3.29.5
7575
with:
7676
sarif_file: results.sarif
-1.97 KB
Loading

docs/ai/quickstarts/build-mcp-server.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Quickstart - Create a minimal MCP server and publish to NuGet
33
description: Learn to create and connect to a minimal MCP server using C# and publish it to NuGet.
4-
ms.date: 07/02/2025
4+
ms.date: 10/20/2025
55
ms.topic: quickstart
66
author: alexwolfmsft
77
ms.author: alexwolf
@@ -23,7 +23,7 @@ In this quickstart, you create a minimal Model Context Protocol (MCP) server usi
2323

2424
## Create the project
2525

26-
1. In a terminal window, install the MCP Server template (version 9.7.0-preview.2.25356.2 or newer):
26+
1. In a terminal window, install the MCP Server template (version 9.10.0-preview.3.25513.3 or newer):
2727

2828
```bash
2929
dotnet new install Microsoft.Extensions.AI.Templates
@@ -35,6 +35,8 @@ In this quickstart, you create a minimal Model Context Protocol (MCP) server usi
3535
dotnet new mcpserver -n SampleMcpServer
3636
```
3737

38+
By default, this command creates a self-contained tool package targeting all of the most common platforms that .NET is supported on. To see more options, use `dotnet new mcpserver --help`.
39+
3840
1. Navigate to the `SampleMcpServer` directory:
3941

4042
```bash
@@ -125,7 +127,7 @@ In this example, you enhance the MCP server to use a configuration value set in
125127
"args": [
126128
"run",
127129
"--project",
128-
"<RELATIVE PATH TO PROJECT DIRECTORY>"
130+
"<relative-path-to-project-file>"
129131
],
130132
"env": {
131133
"WEATHER_CHOICES": "sunny,humid,freezing"
@@ -145,13 +147,13 @@ In this example, you enhance the MCP server to use a configuration value set in
145147

146148
1. Update the `.mcp/server.json` to declare your environment variable input. The `server.json` file schema is defined by the [MCP Registry project](https://github.com/modelcontextprotocol/registry/blob/main/docs/reference/server-json/generic-server-json.md) and is used by NuGet.org to generate VS Code MCP configuration.
147149

148-
- Use the `environment_variables` property to declare environment variables used by your app that will be set by the client using the MCP server (for example, VS Code).
150+
- Use the `environmentVariables` property to declare environment variables used by your app that will be set by the client using the MCP server (for example, VS Code).
149151

150-
- Use the `package_arguments` property to define CLI arguments that will be passed to your app. For more examples, see the [MCP Registry project](https://github.com/modelcontextprotocol/registry/blob/main/docs/reference/server-json/generic-server-json.md#examples).
152+
- Use the `packageArguments` property to define CLI arguments that will be passed to your app. For more examples, see the [MCP Registry project](https://github.com/modelcontextprotocol/registry/blob/main/docs/reference/server-json/generic-server-json.md#examples).
151153

152154
:::code language="json" source="snippets/mcp-server/.mcp/server.json":::
153155

154-
The only information used by NuGet.org in the `server.json` is the first `packages` array item with the `registry_name` value matching `nuget`. The other top-level properties aside from the `packages` property are currently unused and are intended for the upcoming central MCP Registry. You can leave the placeholder values until the MCP Registry is live and ready to accept MCP server entries.
156+
The only information used by NuGet.org in the `server.json` is the first `packages` array item with the `registryType` value matching `nuget`. The other top-level properties aside from the `packages` property are currently unused and are intended for the upcoming central MCP Registry. You can leave the placeholder values until the MCP Registry is live and ready to accept MCP server entries.
155157

156158
You can [test your MCP server again](#test-the-mcp-server) before moving forward.
157159

@@ -163,12 +165,16 @@ You can [test your MCP server again](#test-the-mcp-server) before moving forward
163165
dotnet pack -c Release
164166
```
165167

166-
1. Publish the package to NuGet:
168+
This command produces one tool package and several platform-specific packages based on the `<RuntimeIdentifiers>` list in `SampleMcpServer.csproj`.
169+
170+
1. Publish the packages to NuGet:
167171

168172
```bash
169173
dotnet nuget push bin/Release/*.nupkg --api-key <your-api-key> --source https://api.nuget.org/v3/index.json
170174
```
171175

176+
Be sure to publish all `.nupkg` files to ensure every supported platform can run the MCP server.
177+
172178
If you want to test the publishing flow before publishing to NuGet.org, you can register an account on the NuGet Gallery integration environment: [https://int.nugettest.org](https://int.nugettest.org). The `push` command would be modified to:
173179

174180
```bash

docs/ai/quickstarts/snippets/build-chat-app/openai/ExtensionsOpenAI.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
<ItemGroup>
1111
<PackageReference Include="Microsoft.Extensions.AI.OpenAI" Version="9.4.0-preview.1.25207.5" />
12-
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.9" />
13-
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.9" />
12+
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.10" />
13+
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.10" />
1414
</ItemGroup>
1515

1616
</Project>

docs/ai/quickstarts/snippets/chat-with-data/openai/VectorDataAI.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
<ItemGroup>
1212
<PackageReference Include="Microsoft.Extensions.AI.OpenAI" Version="9.5.0-preview.1.25265.7" />
13-
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.9" />
14-
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.9" />
13+
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.10" />
14+
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.10" />
1515
<PackageReference Include="Microsoft.Extensions.VectorData.Abstractions" Version="9.7.0" />
1616
<PackageReference Include="Microsoft.SemanticKernel.Connectors.InMemory" Version="1.55.0-preview" />
1717
</ItemGroup>

docs/ai/quickstarts/snippets/function-calling/openai/FunctionCallingAI.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.Extensions.AI" Version="9.9.0" />
11+
<PackageReference Include="Microsoft.Extensions.AI" Version="9.10.0" />
1212
<PackageReference Include="Microsoft.Extensions.AI.OpenAI" Version="9.4.0-preview.1.25207.5" />
13-
<PackageReference Include="Microsoft.Extensions.Configuration" Version="10.0.0-rc.1.25451.107" />
14-
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="10.0.0-rc.1.25451.107" />
13+
<PackageReference Include="Microsoft.Extensions.Configuration" Version="10.0.0-rc.2.25502.107" />
14+
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="10.0.0-rc.2.25502.107" />
1515
</ItemGroup>
1616

1717
</Project>

docs/ai/quickstarts/snippets/image-generation/azure-openai/ImagesAzureOpenAI.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Azure.Identity" Version="1.16.0" />
11+
<PackageReference Include="Azure.Identity" Version="1.17.0" />
1212
<PackageReference Include="Azure.AI.OpenAI" Version="2.1.0" />
13-
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.9" />
14-
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.9" />
13+
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.10" />
14+
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.10" />
1515

1616
</ItemGroup>
1717

docs/ai/quickstarts/snippets/mcp-client/MinimalMCPClient.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<ItemGroup>
1111
<PackageReference Include="Azure.AI.OpenAI" Version="2.2.0-beta.5" />
1212
<PackageReference Include="Azure.Identity" Version="1.17.0" />
13-
<PackageReference Include="Microsoft.Extensions.AI" Version="9.9.1" />
13+
<PackageReference Include="Microsoft.Extensions.AI" Version="9.10.0" />
1414
<PackageReference Include="Microsoft.Extensions.AI.OpenAI" Version="9.4.3-preview.1.25230.7" />
1515
<PackageReference Include="ModelContextProtocol" Version="0.1.0-preview.14" />
1616
</ItemGroup>
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
{
2-
"$schema": "https://modelcontextprotocol.io/schemas/draft/2025-07-09/server.json",
2+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
33
"description": "<your description here>",
44
"name": "io.github.<your GitHub username here>/<your repo name>",
5+
"version": "<your package version here>",
56
"packages": [
67
{
7-
"registry_name": "nuget",
8-
"name": "<your package ID here>",
8+
"registryType": "nuget",
9+
"registryBaseUrl": "https://api.nuget.org",
10+
"identifier": "<your package ID here>",
911
"version": "<your package version here>",
10-
"package_arguments": [],
11-
"environment_variables": [
12+
"transport": {
13+
"type": "stdio"
14+
},
15+
"packageArguments": [],
16+
"environmentVariables": [
1217
{
1318
"name": "WEATHER_CHOICES",
1419
"value": "{weather_choices}",
1520
"variables": {
1621
"weather_choices": {
1722
"description": "Comma separated list of weather descriptions to randomly select.",
18-
"is_required": true,
19-
"is_secret": false
23+
"isRequired": true,
24+
"isSecret": false
2025
}
2126
}
2227
}
@@ -26,8 +31,5 @@
2631
"repository": {
2732
"url": "https://github.com/<your GitHub username here>/<your repo name>",
2833
"source": "github"
29-
},
30-
"version_detail": {
31-
"version": "<your package version here>"
3234
}
3335
}

docs/ai/quickstarts/snippets/mcp-server/SampleMcpServer.csproj

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net10.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<RuntimeIdentifiers>win-x64;win-arm64;osx-arm64;linux-x64;linux-arm64;linux-musl-x64</RuntimeIdentifiers>
56
<OutputType>Exe</OutputType>
67
<Nullable>enable</Nullable>
78
<ImplicitUsings>enable</ImplicitUsings>
@@ -10,6 +11,13 @@
1011
<PackAsTool>true</PackAsTool>
1112
<PackageType>McpServer</PackageType>
1213

14+
<!-- Set up the MCP server to be a self-contained application that does not rely on a shared framework -->
15+
<SelfContained>true</SelfContained>
16+
<PublishSelfContained>true</PublishSelfContained>
17+
18+
<!-- Set up the MCP server to be a single file executable -->
19+
<PublishSingleFile>true</PublishSingleFile>
20+
1321
<!-- Set recommended package metadata -->
1422
<PackageReadmeFile>README.md</PackageReadmeFile>
1523
<PackageId>SampleMcpServer</PackageId>
@@ -25,8 +33,8 @@
2533
</ItemGroup>
2634

2735
<ItemGroup>
28-
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.0-preview.5.25277.114" />
29-
<PackageReference Include="ModelContextProtocol" Version="0.3.0-preview.2" />
36+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.0-preview.6.25358.103" />
37+
<PackageReference Include="ModelContextProtocol" Version="0.4.0-preview.1" />
3038
</ItemGroup>
3139

3240
</Project>

0 commit comments

Comments
 (0)