* Set IsError on CallToolResponse to true when result is ErrorContent
* Updated the `IsError` determination for a list of AIContent to require that all items in `contentItems` are instances of `ErrorContent` and that the collection is not empty
* Introduce ConvertAiContentEnumerableToCallToolResponse to transform an IEnumerable<AIContent> into a CallToolResponse
* Move location of ConvertAIContentEnumerableToCallToolResponse helper function
---------
Co-authored-by: Andy Tagg <antagg@microsoft.com>
* Adds test to show where trace IDs are encoded
Signed-off-by: Adrian Cole <adrian.cole@elastic.co>
* update impl to params._meta
Signed-off-by: Adrian Cole <adrian.cole@elastic.co>
---------
Signed-off-by: Adrian Cole <adrian.cole@elastic.co>
* Add SchemaCreateOptions in McpServerToolCreateOptions
* Use TransformSchemaNode for SchemaCreateOptions testing
* Add SchemaCreateOptions in McpServerPromptCreateOptions also
* Add idle session pruning tests
* Remove redundant CTS from StreamableHttpHandler
* StreamableHttpServerTransport.HandlePostRequest already creates the equivelant CTS
which DeleteRequest_CompletesSession_WhichCancelsLongRunningToolCalls verifies
* Fix accept header validation for GET
* Use InvalidOperationException for transport-not-connected errors in doc comments
* Fix flaky Cancellation_ThrowsCancellationException test
- Changes IJsonRpcMessage to an abstract base class so RelatedTransport will always be available
- Streamable HTTP supports multiple concurrent HTTP request with their own indpendent SSE response streams
- RelatedTransport indicates the source or destination of the JsonRpcMessage
- Changes the default RequestId to a JSON number for better compatibility with MCP servers in the wild
* Simplify ModelContextProtocol.AspNetCore README
* Add StreamableHttpHandler
* Use "docker info" in CheckIsDockerAvailable
* Call WithHttpTransport in samples, tests and README
* Cleanup test namespaces
* Add CanConnect_WithMcpClient_AfterCustomizingRoute test
* Simplify relative URI handling
* Handle request made directly to the MapMcp route pattern
* Add Messages_FromNewUser_AreRejected test
* Fix README
* Shorten UserIdClaim ValueTuple names
* Remove MaxReconnectAttempts and ReconnectDelay from SseClientTransportOptions
- Add proper AdditionalHeaders support
* Remove code coverage PR commenting
* Only run markdown-link-check when markdown files are updated
* Declare CI workflow permissions
* Refactor release workflow and declare permissions
* Pin all actions to SHAs
* Run CI manually, on all pushes to main, or if code changes in a PR
* NuGet publishing doesn't need any permissions
* AI generated `///` comment updates
* Fix compilation issues
* Fix incorrect XML comment structure
* Update all Client comments
* Update all Configuration comments
* Update all Messages comments
* Update all Transport comments
* Update all Types comments
* Update all Server comments
* Undo some commenting
---------
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Separate ASP.NET Core tests into a distinct project and make the main test project netfx compatible.
* Fix merge conflicts.
* Update tests/ModelContextProtocol.Tests/ModelContextProtocol.Tests.csproj
Co-authored-by: Stephen Halter <halter73@gmail.com>
* Revert "Fix merge conflicts."
This reverts commit 852169b96786bad2144795540fa164e20b4b197e.
* Fix merge conflicts
---------
Co-authored-by: Stephen Halter <halter73@gmail.com>
* Fix race in TransportBase.SetConnected
- Previously the ChannelWriter could already be completed if multiple
threads raced in SetConnected(false)
* Fix WriteMessageAsync IsConnected test
* Fixes#248 - Add CultureInfo.InvariantCulture to string interpolation for langitude and longitude so the sample works everywhere.
* Update samples/QuickstartWeatherServer/Tools/WeatherTools.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
---------
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Update markdown-link-check to ignore external links causing 403 in CI
* Apply wildcards on ignored links
* Bump version of mlc to latest to gain --ignore-links arg
* Do not warn on redirects from markdown-link-check action
* Do not warn on redirects from markdown-link-check action
* Update comment
* Propagate CancellationToken request cancellation to remote endpoint
* Refactor existing tests to have a shared base class
* Add cancellation tests
---------
Co-authored-by: Stephen Toub <stoub@microsoft.com>