Commit graph csharp-sdk/samples
Author SHA1 Message Date
Stephen Halter
1b1c7fa8ca
Move the SseResponseStreamTransport out of sample (#47) 2025-03-21 13:47:29 -07:00
Stephen Toub
3e4dd011a1
Simplify client samples (#14)
- Remove duplicate projects
- Replace client sample with a simple chat app
2025-03-20 23:25:10 -04:00
Stephen Toub
3de19d38e4
Change type of Tool.InputSchema to be JsonElement (#4)
* Change type of Tool.InputSchema to be JsonElement

* Add schema validation in the InputSchema property setter.

* Simplify AIFunction tool adapter.

---------

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
2025-03-20 19:16:41 +02:00
Stephen Toub
6b8c288029
Make McpJsonUtilities public and remove IVT to sample (#5)
Also adds in the same encoder used by AIJsonUtilities.
2025-03-20 16:00:23 +02:00
Eirik Tsarpalis
2e1e20645f Add Directory.Build.props, apply CPM, use NB.GitVersioning, update package publishing 2025-03-19 17:27:18 +02:00
Eirik Tsarpalis
c9ed453745 Rename project and namespaces 2025-03-19 15:02:38 +02:00
Stephen Halter
90dfc35fbd
Add AspNetCoreSseServer sample (#81)
* Add AspNetCoreSseMcpTransport sample

* Fix build errors after rebase

* React to McpServerFactory changes

* Make Utf8JsonWriter non thread static

* Fix test errors caused by not rebasing the HttpLister changes on factory overhaul commit
2025-03-18 12:56:44 +02:00
Stephen Toub
4597bbd7c2
Integrate Microsoft.Extensions.AI as a foundational building block (#94)
* Integrate Microsoft.Extensions.AI as a foundational building block

As with logging abstractions coming from M.E.Logging and DI abstractions coming from M.E.DependencyInjection, M.E.AI provides the relevant AI abstractions.

- Adds AsAIFunction and GetAIFunctionsAsync methods for getting functions for tools via a client.
- Uses AIFunctionFactory to implement McpServerBuilderExtensions.WithTools.
- Adds a RequestSamplingAsync overload that accepts ChatMessages/Options.
- Adds an AsSamplingChatClient method that provides an IChatClient usable on the server to request sampling of the client.
- Adds a CreateSamplingHandler method to enable an IChatClient to be easily used to satisfy sampling requests on the client.
- Deprecate McpDotNet.Extensions.AI.

* Address PR feedback
2025-03-17 16:34:00 -04:00
Stephen Toub
08b0a04dab
Overhaul McpClientFactory/McpServerFactory (#87)
Handlers are now specified before connecting the client/server. Otherwise, race conditions exist. Handlers move into being a part of the McpClientOptions/McpServerOptions, so that they're provided to the factories. Where relevant, the handlers are specified as part of the capability descriptors, so that they go hand in hand.

The factories are no longer stateful. Instead of allocating a factory and then calling a create method on it, you just call a static factory method.
2025-03-16 12:08:52 -04:00
Peder Holdgaard Pedersen
63b24a4036
Upgrade Anthropic.SDK to 4.7.1 (#86)
Tweak AnthropicTools sample prompt
2025-03-15 23:07:45 -04:00
Stephen Toub
67320b22d5
Move functionality out of IMcpClient/Server into extensions (#60) 2025-03-13 07:55:06 -04:00
Stephen Toub
fe632617dc
Update to M.E.AI 9.3.0-preview.1.25161.3 (#61) 2025-03-12 15:23:13 +01:00
Stephen Toub
33d2b0d762
Use DescriptionAttribute and HasDefaultValue in server builder extensions (#46) 2025-03-09 11:16:00 +01:00
Stephen Toub
587e05f057
Enable .NET SDK code analyzers (#41) 2025-03-08 17:18:09 +01:00
Toni Wenzel
ec9bdfcf5d
Improve tool handling (#28)
* Improve tool handling

* Rework stuff with new hosting options

* Update readme

* Fix build

* Try run client tests

* Fix build

* Fix issues on linux

* Try to run testserver on linux

* Fix test issue

* Fix code smells
2025-03-07 16:48:55 +01:00
Toni Wenzel
7d69499ad5
Remove warnings from build (#29)
* Remove warnings from build

* More fixes.

* Using const for transport types
2025-03-06 21:02:13 +01:00
Toni Wenzel
257a97a659
Improve how to host McpServer (#30) 2025-03-05 21:15:22 +01:00
Peder Holdgaard Pedersen
89c4913ed7
Microsoft.Extensions.AI.Abstractions integration (#25)
* MEAI integration
* README and xmldocs
2025-02-23 13:23:56 +01:00
Peder Holdgaard Pedersen
8fe797e1f3
Server support (stdio) (#19)
* Server support (stdio)
* TestServer project
* Refactored McpClient class to extract shared endpoint logic (with McpServer) to a base class, McpJsonRpcEndpoint.
* Improved xmldoc comments for protocol types, mirroring specification schema comments.
* Update README.MD
2025-02-08 16:21:26 +01:00
Peder Holdgaard Pedersen
c384c7d3de
Fix CallToolAsync for tools with no arguments (#18) 2025-02-07 09:26:42 +01:00
Peder Holdgaard Pedersen
86f1edfe38
Server instructions added to IMcpClient (#17) 2025-01-24 20:36:05 +01:00
Peder Holdgaard Pedersen
3e35efe79c
Reorganize folders, samples, minor bug fix (#14)
Reorganize folders
Samples
Casing fixes
2025-01-18 12:34:13 +01:00