-
Notifications
You must be signed in to change notification settings - Fork 692
Simplify and update package README.md files for stable release #1388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jeffhandley
merged 9 commits into
main
from
copilot/update-readmes-for-modelcontextprotocol
Feb 26, 2026
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b3b90a0
Initial plan
Copilot 692a006
Update package READMEs for stable release and add ModelContextProtoco…
Copilot 9382bb5
Simplify package READMEs per PR #1387 pattern
Copilot 1a8bf62
Update MCP links in package READMEs: rename to "Official MCP Document…
Copilot cb9d08c
Add Packages section to ModelContextProtocol README with absolute doc…
Copilot e5ebb50
Add MCP C# SDK Documentation link to top-level README
Copilot 91756aa
Consolidate package READMEs into shared src/PACKAGE.md
Copilot 54f693c
Merge branch 'main' into copilot/update-readmes-for-modelcontextprotocol
stephentoub cd9c758
Remove doc links from package lists
jeffhandley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,52 +1,26 @@ | ||
| # ASP.NET Core extensions for the MCP C# SDK | ||
|
|
||
| [](https://www.nuget.org/packages/ModelContextProtocol/absoluteLatest) | ||
| [](https://www.nuget.org/packages/ModelContextProtocol.AspNetCore) | ||
|
|
||
| The official C# SDK for the [Model Context Protocol](https://modelcontextprotocol.io/), enabling .NET applications, services, and libraries to implement and interact with MCP clients and servers. Please visit our [API documentation](https://modelcontextprotocol.github.io/csharp-sdk/api/ModelContextProtocol.html) for more details on available functionality. | ||
|
|
||
| > [!NOTE] | ||
| > This project is in preview; breaking changes can be introduced without prior notice. | ||
|
|
||
| ## About MCP | ||
|
|
||
| The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to Large Language Models (LLMs). It enables secure integration between LLMs and various data sources and tools. | ||
|
|
||
| For more information about MCP: | ||
|
|
||
| - [Official Documentation](https://modelcontextprotocol.io/) | ||
| - [Protocol Specification](https://modelcontextprotocol.io/specification/) | ||
| - [GitHub Organization](https://github.com/modelcontextprotocol) | ||
| ASP.NET Core extensions for the official C# SDK for the [Model Context Protocol](https://modelcontextprotocol.io/), providing HTTP-based MCP server support. References `ModelContextProtocol`. Please visit the [API documentation](https://modelcontextprotocol.github.io/csharp-sdk/api/ModelContextProtocol.html) for more details on available functionality. | ||
|
|
||
| ## Installation | ||
|
|
||
| To get started, install the package from NuGet | ||
|
|
||
| ``` | ||
| dotnet new web | ||
| dotnet add package ModelContextProtocol.AspNetCore --prerelease | ||
| dotnet add package ModelContextProtocol.AspNetCore | ||
| ``` | ||
|
|
||
| ## Getting Started | ||
|
|
||
| ```csharp | ||
| // Program.cs | ||
| using ModelContextProtocol.Server; | ||
| using System.ComponentModel; | ||
| To get started, see the [Getting Started](https://modelcontextprotocol.github.io/csharp-sdk/concepts/getting-started.html) guide for installation instructions, package-selection guidance, and complete examples for both clients and servers. | ||
|
|
||
| var builder = WebApplication.CreateBuilder(args); | ||
| builder.Services.AddMcpServer() | ||
| .WithHttpTransport() | ||
| .WithToolsFromAssembly(); | ||
| var app = builder.Build(); | ||
| ## About MCP | ||
|
|
||
| app.MapMcp(); | ||
| The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to Large Language Models (LLMs). It enables secure integration between LLMs and various data sources and tools. | ||
|
|
||
| app.Run("http://localhost:3001"); | ||
| For more information about MCP: | ||
|
|
||
| [McpServerToolType] | ||
| public static class EchoTool | ||
| { | ||
| [McpServerTool, Description("Echoes the message back to the client.")] | ||
| public static string Echo(string message) => $"hello {message}"; | ||
| } | ||
| ``` | ||
| - [Official MCP Documentation](https://modelcontextprotocol.io/) | ||
| - [MCP C# SDK Documentation](https://modelcontextprotocol.github.io/csharp-sdk/) | ||
| - [Protocol Specification](https://modelcontextprotocol.io/specification/) | ||
| - [GitHub Organization](https://github.com/modelcontextprotocol) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,100 +1,26 @@ | ||
| # MCP C# SDK Core | ||
|
|
||
| [](https://www.nuget.org/packages/ModelContextProtocol.Core/absoluteLatest) | ||
| [](https://www.nuget.org/packages/ModelContextProtocol.Core) | ||
|
|
||
| Core .NET SDK for the [Model Context Protocol](https://modelcontextprotocol.io/), enabling .NET applications, services, and libraries to implement and interact with MCP clients and servers. Please visit our [API documentation](https://modelcontextprotocol.github.io/csharp-sdk/api/ModelContextProtocol.html) for more details on available functionality. | ||
|
|
||
| > [!NOTE] | ||
| > This project is in preview; breaking changes can be introduced without prior notice. | ||
|
|
||
| ## About MCP | ||
|
|
||
| The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to Large Language Models (LLMs). It enables secure integration between LLMs and various data sources and tools. | ||
|
|
||
| For more information about MCP: | ||
|
|
||
| - [Official Documentation](https://modelcontextprotocol.io/) | ||
| - [Protocol Specification](https://modelcontextprotocol.io/specification/) | ||
| - [GitHub Organization](https://github.com/modelcontextprotocol) | ||
| Core .NET SDK for the [Model Context Protocol](https://modelcontextprotocol.io/), providing client and low-level server APIs with minimal dependencies. Please visit the [API documentation](https://modelcontextprotocol.github.io/csharp-sdk/api/ModelContextProtocol.html) for more details on available functionality. | ||
|
|
||
| ## Installation | ||
|
|
||
| To get started, install the core package from NuGet | ||
|
|
||
| ``` | ||
| dotnet add package ModelContextProtocol.Core --prerelease | ||
| ``` | ||
|
|
||
| ## Getting Started (Client) | ||
|
|
||
| To get started writing a client, the `McpClient.CreateAsync` method is used to instantiate and connect an `McpClient` | ||
| to a server. Once you have an `McpClient`, you can interact with it, such as to enumerate all available tools and invoke tools. | ||
|
|
||
| ```csharp | ||
| var clientTransport = new StdioClientTransport(new StdioClientTransportOptions | ||
| { | ||
| Name = "Everything", | ||
| Command = "npx", | ||
| Arguments = ["-y", "@modelcontextprotocol/server-everything"], | ||
| }); | ||
|
|
||
| var client = await McpClient.CreateAsync(clientTransport); | ||
|
|
||
| // Print the list of tools available from the server. | ||
| foreach (var tool in await client.ListToolsAsync()) | ||
| { | ||
| Console.WriteLine($"{tool.Name} ({tool.Description})"); | ||
| } | ||
|
|
||
| // Execute a tool (this would normally be driven by LLM tool invocations). | ||
| var result = await client.CallToolAsync( | ||
| "echo", | ||
| new Dictionary<string, object?>() { ["message"] = "Hello MCP!" }, | ||
| cancellationToken: CancellationToken.None); | ||
|
|
||
| // echo always returns one and only one text content object | ||
| Console.WriteLine(result.Content.OfType<TextContentBlock>().First().Text); | ||
| ``` | ||
|
|
||
| Clients can connect to any MCP server, not just ones created using this library. The protocol is designed to be server-agnostic, so you can use this library to connect to any compliant server. | ||
|
|
||
| Tools can be easily exposed for immediate use by `IChatClient`s, because `McpClientTool` inherits from `AIFunction`. | ||
|
|
||
| ```csharp | ||
| // Get available functions. | ||
| IList<McpClientTool> tools = await client.ListToolsAsync(); | ||
|
|
||
| // Call the chat client using the tools. | ||
| IChatClient chatClient = ...; | ||
| var response = await chatClient.GetResponseAsync( | ||
| "your prompt here", | ||
| new() { Tools = [.. tools] }); | ||
| dotnet add package ModelContextProtocol.Core | ||
| ``` | ||
|
|
||
| ## Getting Started (Server) | ||
| ## Getting Started | ||
|
|
||
| The core package provides the basic server functionality. Here's an example of creating a simple MCP server without dependency injection: | ||
| To get started, see the [Getting Started](https://modelcontextprotocol.github.io/csharp-sdk/concepts/getting-started.html) guide for installation instructions, package-selection guidance, and complete examples for both clients and servers. | ||
|
|
||
| ```csharp | ||
| using ModelContextProtocol.Server; | ||
| using System.ComponentModel; | ||
| ## About MCP | ||
|
|
||
| // Create server options with tools | ||
| var serverOptions = new McpServerOptions | ||
| { | ||
| ToolCollection = [ | ||
| McpServerTool.Create((string message) => $"hello {message}", new() | ||
| { | ||
| Name = "echo", | ||
| Description = "Echoes the message back to the client." | ||
| }) | ||
| ] | ||
| }; | ||
| The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to Large Language Models (LLMs). It enables secure integration between LLMs and various data sources and tools. | ||
|
|
||
| // Create and run server with stdio transport | ||
| await using var stdioTransport = new StdioServerTransport("EchoServer"); | ||
| await using var server = McpServer.Create(stdioTransport, serverOptions); | ||
| await server.RunAsync(CancellationToken.None); | ||
| ``` | ||
| For more information about MCP: | ||
|
|
||
| For more advanced scenarios with dependency injection, hosting, and automatic tool discovery, see the `ModelContextProtocol` package. | ||
| - [Official MCP Documentation](https://modelcontextprotocol.io/) | ||
| - [MCP C# SDK Documentation](https://modelcontextprotocol.github.io/csharp-sdk/) | ||
| - [Protocol Specification](https://modelcontextprotocol.io/specification/) | ||
| - [GitHub Organization](https://github.com/modelcontextprotocol) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # MCP C# SDK | ||
|
|
||
| [](https://www.nuget.org/packages/ModelContextProtocol) | ||
|
|
||
| The official C# SDK for the [Model Context Protocol](https://modelcontextprotocol.io/), with hosting and dependency injection extensions. References `ModelContextProtocol.Core`. Please visit the [API documentation](https://modelcontextprotocol.github.io/csharp-sdk/api/ModelContextProtocol.html) for more details on available functionality. | ||
|
|
||
| ## Packages | ||
|
|
||
| This SDK consists of three main packages: | ||
|
|
||
| - **[ModelContextProtocol.Core](https://www.nuget.org/packages/ModelContextProtocol.Core)** [](https://www.nuget.org/packages/ModelContextProtocol.Core) - For projects that only need to use the client or low-level server APIs and want the minimum number of dependencies. [Documentation](https://modelcontextprotocol.github.io/csharp-sdk/api/ModelContextProtocol.html) | ||
|
|
||
| - **[ModelContextProtocol](https://www.nuget.org/packages/ModelContextProtocol)** [](https://www.nuget.org/packages/ModelContextProtocol) - The main package with hosting and dependency injection extensions. References `ModelContextProtocol.Core`. This is the right fit for most projects that don't need HTTP server capabilities. [Documentation](https://modelcontextprotocol.github.io/csharp-sdk/api/ModelContextProtocol.html) | ||
|
|
||
| - **[ModelContextProtocol.AspNetCore](https://www.nuget.org/packages/ModelContextProtocol.AspNetCore)** [](https://www.nuget.org/packages/ModelContextProtocol.AspNetCore) - The library for HTTP-based MCP servers. References `ModelContextProtocol`. [Documentation](https://modelcontextprotocol.github.io/csharp-sdk/api/ModelContextProtocol.AspNetCore.html) | ||
|
|
||
| ## Installation | ||
|
|
||
| ``` | ||
| dotnet add package ModelContextProtocol | ||
| ``` | ||
|
|
||
| ## Getting Started | ||
|
|
||
| To get started, see the [Getting Started](https://modelcontextprotocol.github.io/csharp-sdk/concepts/getting-started.html) guide for installation instructions, package-selection guidance, and complete examples for both clients and servers. | ||
|
|
||
| ## About MCP | ||
|
|
||
| The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to Large Language Models (LLMs). It enables secure integration between LLMs and various data sources and tools. | ||
|
|
||
| For more information about MCP: | ||
|
|
||
| - [Official MCP Documentation](https://modelcontextprotocol.io/) | ||
| - [MCP C# SDK Documentation](https://modelcontextprotocol.github.io/csharp-sdk/) | ||
| - [Protocol Specification](https://modelcontextprotocol.io/specification/) | ||
| - [GitHub Organization](https://github.com/modelcontextprotocol) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.