Pranav Senthilnathan
83523b0a42
Add initial task extension conformance coverage ( #1734 )
...
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7c99928c-a943-49f4-9a63-8b04a0e4d18b
2026-07-24 17:16:20 -07:00
Jeff Handley
2ca96f548b
Extract Tasks into the ModelContextProtocol.Extensions.Tasks extension package ( #1693 )
...
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Tarek Mahmoud Sayed <tarekms@ntdev.microsoft.com>
2026-07-14 18:53:58 -04:00
Pranav Senthilnathan
374e76eecd
Fix missing resultType on complete result responses ( #1684 )
...
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Tarek Mahmoud Sayed <tarekms@ntdev.microsoft.com>
2026-07-12 18:24:21 -07:00
Stephen Halter
fd38f51e27
Tighten draft protocol negotiation boundaries ( #1692 )
...
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Tarek Mahmoud Sayed <tarekms@ntdev.microsoft.com>
2026-07-12 14:30:49 -07:00
Pranav Senthilnathan
a8d374b280
Fix request-scoped draft client capabilities ( #1685 )
...
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Tarek Mahmoud Sayed <tarekms@ntdev.microsoft.com>
2026-07-12 10:56:10 -07:00
Stephen Halter
d6b1615988
Follow-ups to #1610 : de-draft 2026-07-28 terminology, renumber error codes, ProtocolVersion floor ( #1671 )
2026-06-25 14:07:52 -07:00
Stephen Halter
6c323e783b
Default draft protocol support: sessionless + handshake-less (SEP-2575 + SEP-2567) ( #1610 )
2026-06-23 21:24:22 -07:00
Pranav Senthilnathan
dbb7a20176
Implement SEP-2663 Tasks Extension ( #1579 )
...
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-11 13:10:45 -07:00
Aditya Singh
af6fcff595
Add McpClientOptions.InitializeMeta to set _meta on the initialize request ( #1599 )
2026-06-05 16:52:31 -07:00
Tarek Mahmoud Sayed
ed19286a08
Align x-mcp-header implementation with SEP-2243 spec clarifications ( #1619 )
...
Co-authored-by: Tarek Mahmoud Sayed <tarekms@ntdev.microsoft.com>
2026-06-05 15:45:08 -07:00
Stephen Halter
f6dbe4372f
Multi Round-Trip Requests (MRTR) ( #1458 )
2026-06-03 16:19:31 -07:00
Tarek Mahmoud Sayed
157f855e51
Add RegisterTools API to McpClient for pre-populating tool cache ( #1590 )
...
Co-authored-by: Tarek Mahmoud Sayed <tarekms@ntdev.microsoft.com>
2026-05-26 13:31:31 -07:00
Mike Kistler
b8c4d951ec
Implementation for SEP-2243 Http Standardization ( #1553 )
...
Co-authored-by: Tarek Mahmoud Sayed <tarekms@microsoft.com>
Co-authored-by: Tarek Mahmoud Sayed <tarekms@ntdev.microsoft.com>
Co-authored-by: Tarek Mahmoud Sayed <10833894+tarekgh@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-14 15:39:37 -07:00
Copilot
7662ce6b70
Make ClientTransportClosedException public and unify transport exception handling ( #1467 )
...
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: halter73 <54385+halter73@users.noreply.github.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
2026-03-29 20:21:03 -04:00
Copilot
49bf17077d
Fix WithMeta + WithProgress causing tool invocation failure ( #1464 )
...
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
2026-03-27 15:41:58 -04:00
Copilot
7dcdbafe9d
Add 3-arg RequestContext constructor and obsolete 2-arg to eliminate null-forgiving operator usage ( #1462 )
2026-03-27 12:33:23 -07:00
Stephen Toub
b965a7eca6
Add client completion notification and details ( #1368 )
...
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-02 09:17:22 -05:00
Copilot
919e8383f0
Register ping handler in McpSessionHandler to support server-initiated pings ( #1391 )
...
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>
2026-02-26 18:53:20 -05:00
Copilot
8c46411f82
Fix McpClientPrompt/Resource types to use RequestOptions like McpClientTool does ( #1370 )
...
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
2026-02-23 23:40:54 -05:00
Copilot
0a0a575a3d
Normalize CallToolResult.StructuredContent to JsonElement? ( #1357 )
...
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>
2026-02-23 18:04:09 -05:00
Copilot
571e4dc127
Make LoggingMessageNotificationParams.Data required per MCP spec ( #1353 )
...
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
2026-02-23 11:37:35 -05:00
Copilot
80b1ad21d7
Use ReadOnlyMemory<byte> for binary data to eliminate UTF-16 transcoding ( #1070 )
...
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: ericstj <8918108+ericstj@users.noreply.github.com>
Co-authored-by: Eric StJohn <ericstj@microsoft.com>
2026-02-19 14:08:05 -08:00
Copilot
8e57ac6b0e
Centralize test timeout constants to fix sporadic CI failures ( #1210 )
...
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ericstj <8918108+ericstj@users.noreply.github.com>
Co-authored-by: Eric StJohn <ericstj@microsoft.com>
2026-01-29 22:06:17 -05:00
Eirik Tsarpalis
10e4f5b20f
Implement MCP task support (SEP-1686) ( #1170 )
...
Co-authored-by: Stephen Halter <halter73@gmail.com>
2026-01-27 19:21:02 -08:00
Copilot
46d30444a8
Fix ToJsonObject serialization failure with anonymous types and add support for custom JsonSerializerOptions ( #1113 )
...
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: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
2026-01-20 11:21:11 +02:00
Copilot
774411b22c
Add 2025-11-25 as supported version ( #1130 )
...
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
2026-01-15 09:59:42 -05:00
Mackinnon Buck
b8311756b4
Streamable HTTP resumability + redelivery + SSE polling via server-side disconnect ( #1077 )
...
Co-authored-by: Stephen Halter <halter73@gmail.com>
2026-01-14 22:54:25 -08:00
Copilot
bafbb0a8ba
Fix CreateSamplingHandler to use ChatRole.Tool for tool result messages ( #1128 )
...
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>
Co-authored-by: MackinnonBuck <10456961+MackinnonBuck@users.noreply.github.com>
Co-authored-by: Mackinnon Buck <mackinnon.buck@gmail.com>
2026-01-06 16:58:41 -05:00
Copilot
862492d32f
Add SubscribeToResourceAsync overload with handler delegate ( #1069 )
...
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
2025-12-05 18:15:24 -05:00
Peder Holdgaard Pedersen
d99f882884
Add McpClientTool.WithMeta ( #1027 )
...
Co-authored-by: Stephen Toub <stoub@microsoft.com>
2025-12-05 15:41:44 -05:00
Stephen Toub
4a84412331
Add McpClient/Session methods using .Protocol types ( #1063 )
2025-12-05 13:45:12 -05:00
Mike Kistler
c447973972
Add request options bag to high level requests and include Meta ( #970 )
...
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-04 17:32:12 -05:00
Copilot
627de76ca6
Remove McpClient.Enumerate*Async methods ( #1060 )
2025-12-04 11:05:40 -08:00
Copilot
136755f2be
Remove obsolete APIs from codebase and standardize MCP diagnostic IDs ( #985 )
...
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: MackinnonBuck <10456961+MackinnonBuck@users.noreply.github.com>
Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com>
Co-authored-by: Mackinnon Buck <mackinnon.buck@gmail.com>
Co-authored-by: jeffhandley <1031940+jeffhandley@users.noreply.github.com>
Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com>
2025-12-02 10:28:46 -08:00
Stephen Toub
15139cc569
Add tools support to sampling ( #976 )
2025-11-20 09:52:23 -05:00
Mackinnon Buck
d540dc1fb1
Make RequestId non-required ( #984 )
2025-11-18 16:03:31 -08:00
Copilot
00bb5b2678
Add Description property to Implementation type per MCP spec ( #966 )
...
* Initial plan
* Add Description property to Implementation type
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
* Add test to validate client Description from server perspective
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>
2025-11-17 10:42:40 -05:00
Stephen Toub
98a0261585
Tweak how McpClientTool.InvokeAsync exposes some content ( #941 )
...
Rather than always serializing to a JsonElement, which IChatClients that consume the tool won't be able to reason about, convert the content into AIContents that they can reason about.
2025-11-06 21:47:19 -05:00
Copilot
b90f17bccb
Add public constructors to McpClient types for reusing cached definitions ( #938 )
...
* Initial plan
* Add public constructor to McpClientTool for reusing tool definitions
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
* Fix McpClientTool constructor per review feedback
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
* Add public constructors for McpClientPrompt, McpClientResource, and McpClientResourceTemplate
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>
2025-11-06 13:59:17 -05:00
Mackinnon Buck
121929da36
Audit protocol types ( #892 )
2025-11-04 15:41:10 -08:00
Copilot
f28639119b
Implement SEP-973: Icons and metadata support for Implementations, Resources, Tools, and Prompts ( #802 )
...
* Initial plan
* Initial plan for SEP-973 implementation
Co-authored-by: MackinnonBuck <10456961+MackinnonBuck@users.noreply.github.com>
* Implement SEP-973: Add Icon class and icon support to Implementation, Resource, Tool, and Prompt
Co-authored-by: MackinnonBuck <10456961+MackinnonBuck@users.noreply.github.com>
* Complete SEP-973 implementation with documentation and fix property consistency
Co-authored-by: MackinnonBuck <10456961+MackinnonBuck@users.noreply.github.com>
* Address code review feedback: improve tests, remove docs, split test files
Co-authored-by: MackinnonBuck <10456961+MackinnonBuck@users.noreply.github.com>
* Fix tests to use S.T.J. source generator
* Styling fixes
* Simplify Icons property documentation as suggested in code review
Co-authored-by: MackinnonBuck <10456961+MackinnonBuck@users.noreply.github.com>
* Rename Icon.Src property to Icon.Source for more .NET-y naming
Co-authored-by: MackinnonBuck <10456961+MackinnonBuck@users.noreply.github.com>
* Add icon support to McpServerTool infrastructure and attributes
Co-authored-by: MackinnonBuck <10456961+MackinnonBuck@users.noreply.github.com>
* Cleanup
* Refactor icon tests to use Delegate overload instead of MethodInfo pattern
Co-authored-by: MackinnonBuck <10456961+MackinnonBuck@users.noreply.github.com>
* Change Icon.Sizes property from string to IList<string> per spec update
Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
* Add icon support to Prompts and Resources (CreateOptions and Attributes)
Co-authored-by: MackinnonBuck <10456961+MackinnonBuck@users.noreply.github.com>
* Add client-server integration tests for Icons and WebsiteUrl
Co-authored-by: MackinnonBuck <10456961+MackinnonBuck@users.noreply.github.com>
* Fix nullability warnings
* Revert "Add client-server integration tests for Icons and WebsiteUrl"
This reverts commit f37de15569e54e86a0709121c9bdf80c5045511c.
* More nullability fixes
* Add more tests
* Address code review feedback: add Theme property, fix docs, improve test patterns
Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
* Update Icon tests to exercise Theme property
Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
* Add Theme property assertions to client-server integration tests
Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
* Fix nullability
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: MackinnonBuck <10456961+MackinnonBuck@users.noreply.github.com>
Co-authored-by: Mackinnon Buck <mackinnon.buck@gmail.com>
Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
Co-authored-by: David Cantú <dacantu@microsoft.com>
2025-10-08 12:23:01 -07:00
David Cantú
5f992994c3
Decouple Handlers and Collections from protocol types ( #765 )
...
* 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
2025-09-24 09:42:03 -05:00
Eirik Tsarpalis
7cfe0ef621
Add McpSessions.NegotiatedProtocolVersion property. ( #794 )
2025-09-19 13:11:01 +03:00
Mackinnon Buck
38b4a26998
Restructure IMcpEndpoint, IMcpClient, and IMcpServer ( #723 )
...
* Remove `McpEndpoint` & `IMcpClient`
* Revise naming, add abstract classes
* Fix missing renames
* Move extension methods to instance methods
* Add back old API, but obsoleted
* Add back obsoleted factory classes
* Move deprecation attributes
* `SseClientTransport` -> `HttpClientTransport`
* Update src/ModelContextProtocol.Core/Server/AugmentedServiceProvider.cs
Co-authored-by: Stephen Halter <halter73@gmail.com>
* PR feedback
* PR feedback
* Add back dispose lock
* Fix docs projects
* PR feedback
* Undo `docs/*.md` changes
---------
Co-authored-by: Stephen Halter <halter73@gmail.com>
2025-09-16 10:22:10 -07:00
Eirik Tsarpalis
55bda787ae
Styling: remove a few redundant parens from object initializer expressions. ( #548 )
...
* Styling: remove a few redundant parens from object initializer expressions.
* Fix build error.
2025-06-26 16:55:54 +03:00
Stephen Toub
2bcff315f8
Update content according to latest spec ( #513 )
...
* 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
2025-06-16 19:39:41 -04:00
Eirik Tsarpalis
d7d9eab3f8
Pass session id's to MCP endpoints. ( #466 )
...
* Pass session id's to MCP endpoints.
* Update src/ModelContextProtocol/Client/McpClient.cs
Co-authored-by: Stephen Halter <halter73@gmail.com>
* Update src/ModelContextProtocol.AspNetCore/StreamableHttpHandler.cs
Co-authored-by: Stephen Halter <halter73@gmail.com>
* Make init callback asynchronous.
* Address feedback.
---------
Co-authored-by: Stephen Halter <halter73@gmail.com>
2025-06-12 17:56:57 +03:00
Stephen Toub
106ab8064f
Clean up namespaces ( #410 )
...
No meaningful code changes, just lots of namespace shuffling to have fewer namespaces and to put things in better namespaces.
2025-05-14 14:50:26 -04:00
Stephen Toub
d86b3277d4
Add McpServer/ClientResource{Template} and friends ( #391 )
...
* Add McpServer/ClientResource{Template} and friends
This PR copies the same design used by tools and prompts to add McpServerResource, McpServerResourceAttribute, McpServerResourceTypeAttribute, McpClientResource, and then all of those for ResourceTemplate as well.
Unlike the others, [McpServerResource] is permitted not only on methods but also on properties. This convenience is afforded because such resources aren't parameterized, and thus can be easily modeled as properties, likely auto-props, e.g.
```C#
[McpServerResource]
public static BlobResourceContents MyAmazingData { get; } = Create();
```
Details about resources can be encoded into the attributes or provided via McpServerResource{Template}.Create methods. If not URI is explicitly defined, one is derived from the member name and arguments. For templates, this means manufacturing a URI template that includes variables for all non-DI parameters.
This also fixes a few issues discovered along the way:
- McpClientExtensions are updated to use `ValueTask<T>` instead of `Task<T>` where relevant.
- McpServerPrompt was missing handling for progress notifications; that's been rectified. It was also missing configuring the description on the ProtocolPrompt.
- Renamed IMcpServerPrimitive.Name to Id. For resources, names aren't unique.
- After going back and forth, updated McpServer to not fail for missing handlers and to instead register default handlers. It simplifies the implementation and makes it more consistent.
- Added a bunch of primitive types into the McpJsonUtilities JSON source generator context so that such primitives are usable with tools/prompts/resources without folks being required to add them into their own context for Native AOT. I think we should consider pushing this down to AIJsonUtilities, instead, and that will then flow up to McpJsonUtilities automatically.
* Address feedback
2025-05-09 18:21:11 -04:00
Stephen Halter
e3ff552824
Improve testing for StreamableHttpHandler and IdleTrackingBackgroundService ( #345 )
...
* 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
2025-04-24 10:49:02 -07:00