Skip to content

Commit b3eacff

Browse files
committed
Merge branch 'main' of https://github.com/modelcontextprotocol/csharp-sdk into copilot/fix-binary-data-encoding
2 parents 14fedca + 8e57ac6 commit b3eacff

105 files changed

Lines changed: 12974 additions & 195 deletions

File tree

Some content is hidden

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636

3737
steps:
3838
- name: 📥 Clone the repo
39-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
39+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4040
with:
4141
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
4242

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
publish-coverage:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
13+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1414
- name: Setup .NET
1515
uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0
1616
with:

.github/workflows/copilot-setup-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
contents: read
1212

1313
steps:
14-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
14+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1515

1616
- name: Install .NET SDK
1717
uses: actions/setup-dotnet@v5.1.0

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
runs-on: ubuntu-latest
2828
steps:
2929
- name: Checkout
30-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
30+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3131

3232
- name: .NET Setup
3333
uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0

.github/workflows/markdown-link-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
19+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2020

2121
- name: Markup Link Checker (mlc)
2222
uses: becheran/mlc@7ec24825cefe0c9c8c6bac48430e1f69e3ec356e # v1.2.0

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545

4646
steps:
4747
- name: Clone the repo
48-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
48+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4949
with:
5050
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
5151

@@ -73,7 +73,7 @@ jobs:
7373
version_suffix_args: ${{ github.event_name != 'release' && format('--version-suffix "{0}"', inputs.version_suffix_override || format('ci.{0}', github.run_number)) || '' }}
7474

7575
steps:
76-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
76+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7777

7878
- name: Setup .NET
7979
uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0
@@ -103,7 +103,7 @@ jobs:
103103
packages: write
104104

105105
steps:
106-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
106+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
107107

108108
- name: Setup .NET
109109
uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0
@@ -138,7 +138,7 @@ jobs:
138138
packages: write
139139

140140
steps:
141-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
141+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
142142

143143
- name: Download build artifacts
144144
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
@@ -158,7 +158,7 @@ jobs:
158158
permissions: { }
159159

160160
steps:
161-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
161+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
162162

163163
- name: Setup .NET
164164
uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0

Directory.Packages.props

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@
7777
<PackageVersion Include="Microsoft.Extensions.TimeProvider.Testing" Version="10.1.0" />
7878
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
7979
<PackageVersion Include="Moq" Version="4.20.72" />
80-
<PackageVersion Include="OpenTelemetry" Version="1.14.0" />
81-
<PackageVersion Include="OpenTelemetry.Exporter.InMemory" Version="1.14.0" />
82-
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.14.0" />
83-
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.14.0" />
84-
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.14.0" />
85-
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.14.0" />
80+
<PackageVersion Include="OpenTelemetry" Version="1.15.0" />
81+
<PackageVersion Include="OpenTelemetry.Exporter.InMemory" Version="1.15.0" />
82+
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.15.0" />
83+
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.15.0" />
84+
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.15.0" />
85+
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.15.0" />
8686
<PackageVersion Include="Serilog.Extensions.Hosting" Version="10.0.0" />
8787
<PackageVersion Include="Serilog.Extensions.Logging" Version="10.0.0" />
8888
<PackageVersion Include="Serilog.Sinks.Console" Version="6.1.1" />

ModelContextProtocol.slnx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<Project Path="samples/ChatWithTools/ChatWithTools.csproj" />
4545
<Project Path="samples/EverythingServer/EverythingServer.csproj" />
4646
<Project Path="samples/InMemoryTransport/InMemoryTransport.csproj" />
47+
<Project Path="samples/LongRunningTasks/LongRunningTasks.csproj" />
4748
<Project Path="samples/ProtectedMcpClient/ProtectedMcpClient.csproj" />
4849
<Project Path="samples/ProtectedMcpServer/ProtectedMcpServer.csproj" />
4950
<Project Path="samples/QuickstartClient/QuickstartClient.csproj" />

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ var response = await chatClient.GetResponseAsync(
8888

8989
## Getting Started (Server)
9090

91+
> [!TIP]
92+
> You can use the [MCP Server project template](https://learn.microsoft.com/dotnet/ai/quickstarts/build-mcp-server?pivots=visualstudio) to quickly get started with creating your own MCP server.
93+
9194
Here is an example of how to create an MCP server and register all tools from the current application.
9295
It includes a simple echo tool as an example (this is included in the same file here for easy of copy and paste, but it needn't be in the same file...
9396
the employed overload of `WithTools` examines the current assembly for classes with the `McpServerToolType` attribute, and registers all methods with the

docs/concepts/elicitation/elicitation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Here's an example implementation of how a console application might handle elici
9898

9999
### URL Elicitation Required Error
100100

101-
When a tool cannot proceed without first completing a URL-mode elicitation (for example, when third-party OAuth authorization is needed), and calling `ElicitAsync` is not practical (for example in <xref: ModelContextProtocol.AspNetCore.HttpServerTransportOptions.Stateless> is enabled disabling server-to-client requets), the server may throw a <xref:ModelContextProtocol.UrlElicitationRequiredException>. This is a specialized error (JSON-RPC error code `-32042`) that signals to the client that one or more URL-mode elicitations must be completed before the original request can be retried.
101+
When a tool cannot proceed without first completing a URL-mode elicitation (for example, when third-party OAuth authorization is needed), and calling `ElicitAsync` is not practical (for example in <xref: ModelContextProtocol.AspNetCore.HttpServerTransportOptions.Stateless> is enabled disabling server-to-client requests), the server may throw a <xref:ModelContextProtocol.UrlElicitationRequiredException>. This is a specialized error (JSON-RPC error code `-32042`) that signals to the client that one or more URL-mode elicitations must be completed before the original request can be retried.
102102

103103
#### Throwing UrlElicitationRequiredException on the Server
104104

0 commit comments

Comments
 (0)