Commit graph csharp-sdk/samples
Author SHA1 Message Date
Jeff Handley
2c5d1ed2be
Document and demonstrate allowed hosts and CORS policy guidance (#1554)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Stephen Halter <halter73@gmail.com>
2026-05-01 19:03:30 -07:00
dependabot[bot]
a693ce2d8c
Bump OpenTelemetry and 3 others (#1514)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-26 16:38:22 -05:00
Stephen Halter
8eb4023c20
Add stateless doc, prefer stateless mode and disable legacy SSE by default (#1468) 2026-03-27 13:56:16 -07: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
Copilot
84cd6917bb
Mark RunSessionHandler experimental (MCPEXP002) (#1383)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: halter73 <54385+halter73@users.noreply.github.com>
Co-authored-by: jeffhandley <1031940+jeffhandley@users.noreply.github.com>
2026-02-24 15:02:34 -08: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
dbf91bcb1a
Change ProtectedResourceMetadata URI properties to strings and build resource strings directly (#1264)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: halter73 <54385+halter73@users.noreply.github.com>
Co-authored-by: Stephen Halter <halter73@gmail.com>
2026-02-12 22:28:43 -05:00
Copilot
6a4e4d27dc
Skip .NET Framework tests on non-Windows platforms (#1226)
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-30 14:56:24 -08: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
eca882e48c
Update Anthropic SDK to 12.2.0 (#1164)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com>
Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
2026-01-19 18:00:39 +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
Mike Kistler
50e29c572d
Add examples of icons on tools, resources, prompts, and server implementation to EverythingServer (#1096)
Co-authored-by: Stephen Halter <halter73@gmail.com>
2026-01-09 08:49:37 -06:00
Copilot
f9239b0fb7
Migrate from Anthropic.SDK to official Anthropic package (#1083)
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-10 08:58:41 -05:00
Stephen Halter
970207989e
Fall back to well-known URL in client if 401 response is missing resource_metadata parameter (#1054) 2025-12-05 14:12:51 -08: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
Eirik Tsarpalis
a9427f9f12
Tweak the file-based MCP server sample (#1019) 2025-11-24 16:42:20 +02:00
Jeff Handley
9395394c1b
Address additional feedback on Versioning doc (#999) 2025-11-20 21:59:28 -05:00
Stephen Toub
15139cc569
Add tools support to sampling (#976) 2025-11-20 09:52:23 -05:00
Peder Holdgaard Pedersen
54576033eb
Add file-based MCP server sample for .NET 10 (#3) (#931) 2025-11-12 12:59:14 -08:00
Peder Holdgaard Pedersen
baa7d6e320
Update ModelId in ChatOptions to new version (#926) 2025-11-06 10:58:01 -08:00
Copilot
3bff0adc2f
Add McpMetaAttribute for attaching metadata to tools, prompts, and resources (#857)
* 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>
2025-10-17 09:02:54 -04:00
Mike Kistler
fb07d666a6
Convert EverythingServer to use Streamable HTTP (#709)
* 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>
2025-10-16 14:39:42 -07:00
Stephen Toub
bfc0980ef5
Add net10.0 assets and run some fixers (#875) 2025-10-15 15:27:43 -04:00
Stephen Halter
3255adb4d6
Propagate tool call exceptions through filters (#844)
* Add McpProtocolException specifically for JSON-RPC errors
2025-10-14 19:10:55 -07:00
Den Delimarsky
445ea42adc
Update sample with URI validation (#824) 2025-10-03 10:00:51 -07:00
Eirik Tsarpalis
7628b3064f
Onboard repo to the .NET 10 sdk (#822)
* Onboard repo to the .NET 10 sdk

* Remove redundant property.

* Remove console logger

* Disabling failing tests in .NET 10.
2025-09-30 20:36:12 +03: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
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
Stephen Halter
d344c65120
Add middleware and authz support for server-side handlers (#733) 2025-09-10 10:07:45 -07:00
Peder Holdgaard Pedersen
0f0aad020b
Per Session Tools Sample (#724) 2025-09-08 07:34:09 -07:00
sabbadino
0cf449eaca
Improved samples: added weather tool in AspNetCoreSseServer and option to connect via http to AspNetCoreSseServer. (#469) 2025-08-26 19:07:41 -07:00
S-Luiten
f9129f5b28
Improvements to dynamic client registration (#609)
* Add a delegate for handling the dynamic client registration response.
* Support passing an initial access token for dynamic client registration.
2025-08-26 14:24:00 -07:00
Stephen Halter
b067261ca7
Prune idle sessions before starting new ones (#701) 2025-08-18 11:04:27 -07:00
Stephen Halter
5e5b1af29b
Remove 'Sse' from AspNetCoreSseServer sample name (#665) 2025-08-01 10:47:11 -07:00
Stephen Toub
da86d52241
Add an in-memory transport sample (#664)
* Add an in-memory transport sample

* Rename sample
2025-07-31 21:37:49 -04:00
Stephen Toub
1232456153
Update to M.E.AI 9.7.0 (#602) 2025-07-09 23:41:57 -04:00
Den Delimarsky 🌺
cdf88e7f5d
Authorization Support (Using ASP.NET Core Native AuthN/AuthZ Integration) (#377) 2025-07-03 14:39:28 -07:00
Eirik Tsarpalis
92fd8b246f
Fix relative path resolution in sample app. (#572)
* Fix relative path resolution in sample app.

* Update samples/QuickstartClient/Program.cs

* Fix build
2025-07-01 13:58:31 +03: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
Eirik Tsarpalis
0b26b7bf22
Fix URI template derivation and lookup (#530)
* 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.
2025-06-23 19:49:38 +03:00
Stephen Toub
521bb7bde2
Fix QuickstartClient path (#528)
* Fix QuickstartClient path

* Make dotnet run work instead of F5
2025-06-19 15:35:13 -04: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
Stephen Halter
703b0fe50b
Add ModelContextProtocol.Core package (#428) 2025-06-02 15:16:45 -07:00
Stephen Toub
5cc7c00456
Add elicitation capability (#467)
* Add elicitation capability
2025-05-29 22:03:03 -04:00
Andy Gocke
849809771d
Serilog AOT has been fixed as of 4.3.0 (#434)
See https://github.com/serilog/serilog/releases/tag/v4.3.0
2025-05-19 11:57:55 +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
26c3622101
Use WithResources in EverythingServer sample (#400) 2025-05-10 06:13:42 -04:00
Mike Kistler
2eeb61f4fa
Add static resources to EverythingServer sample (#361)
* Add static resources
* Apply suggestions from PR review

---------

Co-authored-by: Stephen Halter <halter73@gmail.com>
2025-04-28 21:15:37 -05:00
Vladimir Negacevschi
86dd11a199
Improve WeatherTools.GetAlerts description in sample (#363)
The latest api.weather.gov API spec requires to use the 2 letter abbreviation for the state (e.g. NY), when getting the alerts for a state.
2025-04-28 18:08:45 -07:00