Skip to content

Commit 751072c

Browse files
Merge branch 'main' into refactor/split-mcp-tasks-capability-server-client
2 parents 6b2f2df + 3118fcd commit 751072c

33 files changed

Lines changed: 775 additions & 69 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "C# (.NET SDK)",
3-
"image": "mcr.microsoft.com/devcontainers/dotnet:1-8.0-jammy",
3+
"image": "mcr.microsoft.com/devcontainers/dotnet:2-10.0",
44
"features": {
55
"ghcr.io/devcontainers/features/dotnet:2": {
6-
"version": "10.0",
7-
"additionalVersions": "9.0"
6+
"version": "9.0",
7+
"additionalVersions": "8.0"
88
},
99
"ghcr.io/devcontainers/features/node:1": {}
1010
},

.github/dependabot.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ updates:
3838
- dependency-name: "Microsoft.Extensions.Hosting.Abstractions"
3939
- dependency-name: "Microsoft.Extensions.Logging.Abstractions"
4040
- dependency-name: "Microsoft.Extensions.AI.OpenAI"
41-
- dependency-name: "Microsoft.Extensions.TimeProvider.Testing"
41+
- dependency-name: "Microsoft.Extensions.TimeProvider.Testing"
4242
- dependency-name: "Microsoft.AspNetCore.*"
4343
- dependency-name: "Microsoft.IdentityModel.*"
4444
- dependency-name: "Microsoft.Bcl.*"
@@ -56,7 +56,6 @@ updates:
5656
# Add labels to dependency update PRs
5757
labels:
5858
- "dependencies"
59-
- "testing"
6059

6160
# Monitor GitHub Actions
6261
- package-ecosystem: "github-actions"
@@ -70,4 +69,3 @@ updates:
7069
# Add labels to GitHub Actions update PRs
7170
labels:
7271
- "dependencies"
73-
- "github-actions"

.github/workflows/ci-build-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
9.0.x
5151
5252
- name: 🔧 Set up Node.js
53-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
53+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
5454
with:
5555
node-version: '20'
5656

@@ -76,7 +76,7 @@ jobs:
7676

7777
- name: 📤 Upload test results artifact
7878
if: always()
79-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
79+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
8080
with:
8181
name: testresults-${{ matrix.os }}-${{ matrix.configuration }}
8282
path: artifacts/testresults/**

.github/workflows/ci-code-coverage.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
pattern: testresults-*
2525

2626
- name: Combine coverage reports
27-
uses: danielpalme/ReportGenerator-GitHub-Action@5.5.4
27+
uses: danielpalme/ReportGenerator-GitHub-Action@5.5.5
2828
with:
2929
reports: "**/*.cobertura.xml"
3030
targetdir: "${{ github.workspace }}/report"
@@ -36,7 +36,7 @@ jobs:
3636
toolpath: "reportgeneratortool"
3737

3838
- name: Upload combined coverage XML
39-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
39+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
4040
with:
4141
name: coverage
4242
path: ${{ github.workspace }}/report
@@ -56,7 +56,7 @@ jobs:
5656
thresholds: "60 80"
5757

5858
- name: Upload combined coverage markdown
59-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
59+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
6060
with:
6161
name: coverage-markdown
6262
path: ${{ github.workspace }}/code-coverage-results.md

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
run: make generate-docs
4141

4242
- name: Upload Pages artifact
43-
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
43+
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
4444
with:
4545
path: 'artifacts/_site'
4646

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
--output "${{ github.workspace }}/artifacts/packages"
9292

9393
- name: Upload artifact
94-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
94+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
9595
if: ${{ !cancelled() }}
9696
with:
9797
name: build-artifacts

Directory.Packages.props

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
44
<System8Version>8.0.22</System8Version>
55
<System9Version>9.0.11</System9Version>
6-
<System10Version>10.0.5</System10Version>
7-
<MicrosoftExtensionsVersion>10.4.1</MicrosoftExtensionsVersion>
6+
<System10Version>10.0.7</System10Version>
7+
<MicrosoftExtensionsVersion>10.5.2</MicrosoftExtensionsVersion>
88
</PropertyGroup>
99

1010
<!-- Product dependencies shared -->
@@ -62,8 +62,8 @@
6262

6363
<!-- Testing dependencies -->
6464
<ItemGroup>
65-
<PackageVersion Include="Anthropic" Version="12.9.0" />
66-
<PackageVersion Include="coverlet.collector" Version="8.0.1">
65+
<PackageVersion Include="Anthropic" Version="12.17.0" />
66+
<PackageVersion Include="coverlet.collector" Version="10.0.0">
6767
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
6868
<PrivateAssets>all</PrivateAssets>
6969
</PackageVersion>
@@ -74,14 +74,14 @@
7474
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="$(System10Version)" />
7575
<PackageVersion Include="Microsoft.Extensions.Options" Version="$(System10Version)" />
7676
<PackageVersion Include="Microsoft.Extensions.TimeProvider.Testing" Version="10.1.0" />
77-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
77+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
7878
<PackageVersion Include="Moq" Version="4.20.72" />
79-
<PackageVersion Include="OpenTelemetry" Version="1.15.1" />
80-
<PackageVersion Include="OpenTelemetry.Exporter.InMemory" Version="1.15.1" />
81-
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.15.1" />
82-
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.15.0" />
83-
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.15.1" />
84-
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.15.1" />
79+
<PackageVersion Include="OpenTelemetry" Version="1.15.3" />
80+
<PackageVersion Include="OpenTelemetry.Exporter.InMemory" Version="1.15.3" />
81+
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.15.3" />
82+
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.15.1" />
83+
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.15.3" />
84+
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.15.2" />
8585
<PackageVersion Include="Serilog.Extensions.Hosting" Version="10.0.0" />
8686
<PackageVersion Include="Serilog.Extensions.Logging" Version="10.0.0" />
8787
<PackageVersion Include="Serilog.Sinks.Console" Version="6.1.1" />
@@ -92,6 +92,6 @@
9292
<PackageVersion Include="xunit.v3" Version="3.2.2" />
9393
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
9494
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
95-
<PackageVersion Include="JsonSchema.Net" Version="9.1.3" />
95+
<PackageVersion Include="JsonSchema.Net" Version="9.2.0" />
9696
</ItemGroup>
9797
</Project>

docs/concepts/getting-started.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,20 @@ public static class EchoTool
101101
}
102102
```
103103

104+
#### Host name validation
105+
106+
For local HTTP servers, keep the set of accepted host names limited to loopback values. This helps protect against DNS rebinding, where a browser reaches a local server through an attacker-controlled DNS name while sending that DNS name in the HTTP `Host` header. ASP.NET Core's Kestrel server doesn't validate `Host` headers by default, so configure `AllowedHosts` with known host names rather than `"*"`.
107+
108+
For production servers, configure the exact public host names for the deployment, and validate the host name at the proxy or load balancer when one is responsible for forwarding client requests. This also avoids reflecting untrusted host names through ASP.NET Core features such as absolute URL generation. See [Host filtering with ASP.NET Core Kestrel web server | Microsoft Learn](https://learn.microsoft.com/aspnet/core/fundamentals/servers/kestrel/host-filtering) and [URL generation concepts | Microsoft Learn](https://learn.microsoft.com/aspnet/core/fundamentals/routing#url-generation-concepts).
109+
110+
#### Browser cross-origin access
111+
112+
**Only** enable CORS if you intentionally want browser-based cross-origin access to this server.
113+
114+
CORS is not a substitute for host name validation. When browser-based cross-origin access is required, limit which browser origins can call the MCP endpoint by using the most restrictive ASP.NET Core CORS policy possible. See [Enable Cross-Origin Requests (CORS) in ASP.NET Core | Microsoft Learn](https://learn.microsoft.com/aspnet/core/security/cors).
115+
116+
For the full HTTP security examples, including `AllowedHosts` and restrictive CORS on `MapMcp`, see [Streamable HTTP transport](transports/transports.md#browser-cross-origin-access).
117+
104118
### Building an MCP client
105119

106120
Create a new console app, add the package, and replace `Program.cs` with the code below. This client connects to the MCP "everything" reference server, lists its tools, and calls one:

docs/concepts/httpcontext/samples/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"Microsoft.AspNetCore": "Warning"
66
}
77
},
8-
"AllowedHosts": "*"
8+
"AllowedHosts": "localhost;127.0.0.1;[::1]"
99
}

docs/concepts/logging/samples/server/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"Microsoft.AspNetCore": "Warning"
66
}
77
},
8-
"AllowedHosts": "*"
8+
"AllowedHosts": "localhost;127.0.0.1;[::1]"
99
}

0 commit comments

Comments
 (0)