* Initial plan
* Add McpMetaAttribute and integrate with tools, prompts, and resources
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
* Add tests and sample usage for McpMetaAttribute
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
* Add Meta property to options classes and update logic to merge with attributes
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
* Fix missing using directives and clarify McpMetaAttribute documentation
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
* Make Name and Value constructor parameters in McpMetaAttribute and check AIFunction.Metadata.UnderlyingMethod
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
* Change Value type to object and use JsonSerializer.SerializeToNode, fix nullable warnings
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
* Fix UnderlyingMethod property path, use SerializerOptions, and fix JsonObject cref
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
* Simplify MethodInfo resolution to use function.UnderlyingMethod directly
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
* Fix IL2026 trimming warning by providing type info to JsonSerializer.SerializeToNode
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
* Fix remaining issues
* Revert to string-based JSON values for McpMetaAttribute with StringSyntax annotation
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
* Add StringSyntax attribute to Value property and fix sample code to use escaped quotes
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
* Fix tests and a bit of cleanup
* Change approach and add lots of tests
* Use JsonContext for serialization and fix floating point test comparison
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Convert EverythingServer to use Streamable HTTP
* Apply suggestion from @halter73
Co-authored-by: Stephen Halter <halter73@gmail.com>
---------
Co-authored-by: Stephen Halter <halter73@gmail.com>
* Decouple Handlers and Collections (e.g. ToolsHandler and ToolsCollection) from Capabilities by promoting them to the options types.
Also, group all handlers in container classes, for server, I decided to move McpServerHandlers down to Mcp.Core and move the NotificationHandlers there too.
Also, Fix ListResourceTemplatesHandler issue.
* Add remarks for empty protocol capability types
* Keep JsonIgnore properties and mark them as Obsolete
* Continue supporting Obsolete members
* Update Obsolete messages to indicate the member will be removed
* Add EditorBrowsable Never to the remaining obsolete members
* Use lowercase host in resource URI template derivation.
* Address feedback
* Add casing testing for non-templated resource lookups.
* Fix uri primitive lookup
* Use a hardcoded mcp hostname in derived resource template URIs and ensure built-in resources work with the VS Code client.
* Address feedback
* Fix equality comparison
* Use dedicated type for resource collections.
* Update content according to latest spec
* Add Title to a bunch of types
* Add _meta to lots of types
* Address feedback, more cleanup, fix NAOT test failure
* 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
* 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>
* 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>
* 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>
* Remove McpServerConfig and have McpClientFactory accept IClientTransport instances directly.
* Address feedback and use lists when representing stdio arguments.
* Use "Name" for transport descriptors and "EndpointName" for MCP clients and servers.
* Update code samples.
* Fix source file naming
* Move notification handler registrations to capabilities
Currently request handlers are set on the capability objects, but notification handlers are set after construction via an AddNotificationHandler method on the IMcpEndpoint interface. This moves handler specification to be at construction as well. This makes it more consistent with request handlers, simplifies the IMcpEndpoint interface to just be about message sending, and avoids a concurrency bug that could occur if someone tried to add a handler while the endpoint was processing notifications.
* Address more feedback and further cleanup