Skip to content

Rename ModelContextProtocol and ModelContextProtocol.Hosting packages #7

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link

@Copilot Copilot AI commented May 29, 2025

This PR implements the package renaming strategy to better reflect the package hierarchy and usage patterns:

Changes Made

Package Renaming

  • ModelContextProtocolModelContextProtocol.Core: The core package now clearly indicates it provides fundamental MCP functionality without hosting features
  • ModelContextProtocol.HostingModelContextProtocol: The main package now includes hosting and dependency injection extensions, making it the primary entry point for most users

Namespace Updates

  • Updated all internal classes from ModelContextProtocol.Hosting namespace to ModelContextProtocol namespace:
    • SingleSessionMcpServerHostedService
    • McpServerOptionsSetup
    • Updated using statements in extension classes

Documentation Changes

  • Created new README for ModelContextProtocol.Core: Shows core-only functionality including basic client usage and manual server creation without dependency injection
  • Deleted ModelContextProtocol.Hosting README: No longer needed as the main package now uses the root repository README
  • Root README now serves ModelContextProtocol package: Provides comprehensive documentation including AddMcpServer() and hosting features

Package Descriptions

  • ModelContextProtocol.Core: "Core .NET SDK for the Model Context Protocol (MCP)"
  • ModelContextProtocol: ".NET SDK for the Model Context Protocol (MCP) with hosting and dependency injection extensions"

Impact

This change provides a clearer package structure:

  • ModelContextProtocol.Core: For users who want just the core protocol implementation
  • ModelContextProtocol: For users who want the full experience with hosting, DI, and automatic tool discovery

The namespace changes are internal only and don't affect public APIs. All existing functionality remains unchanged.

Fixes #6.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits May 29, 2025 16:41
…ol.Core, ModelContextProtocol.Hosting -> ModelContextProtocol

Co-authored-by: halter73 <[email protected]>
@Copilot Copilot AI changed the title [WIP] Rename ModelContextProtocol and ModelContextProtocol.Hosting packages Rename ModelContextProtocol and ModelContextProtocol.Hosting packages May 29, 2025
@Copilot Copilot AI requested a review from halter73 May 29, 2025 16:47
Copilot finished work on behalf of halter73 May 29, 2025 16:48
Copy link
Owner

@halter73 halter73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to move the files to the directories they would be in if they started with the current PackageId, and update the csproj file names to match their folder and PackageId.

@@ -4,8 +4,8 @@
<TargetFrameworks>net9.0;net8.0;netstandard2.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IsPackable>true</IsPackable>
<PackageId>ModelContextProtocol</PackageId>
<Description>.NET SDK for the Model Context Protocol (MCP)</Description>
<PackageId>ModelContextProtocol.Core</PackageId>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, when I said minimal changes, I did not mean to not move files around. In addition to renaming this PackageId to ModelContextProtocol.Core, we should rename this file to ModelContextProtocol.Core.csproj and put it in the src/ModelContextProtocol.Core directory. After doing that, the src/ModelContextProtocol.Hosting folder should be renamed to src/ModelContextProtocol and ModelContextProtocol.Hosting.csproj should be renamed to ModelContextProtocol.csrpoj. It's important to move directories in this order because we don't want to clobber anything.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Completed the directory reorganization in the exact order you specified:

  1. Moved src/ModelContextProtocol to src/ModelContextProtocol.Core and renamed ModelContextProtocol.csproj to ModelContextProtocol.Core.csproj
  2. Moved src/ModelContextProtocol.Hosting to src/ModelContextProtocol and renamed ModelContextProtocol.Hosting.csproj to ModelContextProtocol.csproj
  3. Updated solution file and all project references throughout the codebase

All files now match their PackageId folder structure. Changes in commit 671a21a.

Copy link
Author

Copilot AI commented May 29, 2025

Try to move the files to the directories they would be in if they started with the current PackageId, and update the csproj file names to match their folder and PackageId.

Done! Files and directories have been moved to match their PackageId names and all project references have been updated. Commit 671a21a implements the directory reorganization.

Copilot finished work on behalf of halter73 May 29, 2025 17:08
Copy link
Owner

@halter73 halter73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the first section of the main README.md at the root of the project ("# MCP C# SDK") to include links to the ModelContextProtocol.Core package and the ModelContextProtocol.AspNetCore NuGet packages and relative links to their respective READMEs? We should describe its purpose of each package. ModelContextProtocol being the right fit for most projects that don't need HTTP server capabilities. ModelContextProtocol.AspNetCore being the library for HTTP-based MCP servers. And ModelContextProtocol.Core being for people who only need to use the client or low-level server APIs and want the minimum number of dependencies.

Copy link
Author

Copilot AI commented May 29, 2025

Can you update the first section of the main README.md at the root of the project ("# MCP C# SDK") to include links to the ModelContextProtocol.Core package and the ModelContextProtocol.AspNetCore NuG...

Added a "Packages" section to the main README with NuGet package links, badges, relative links to documentation, and clear descriptions of each package's purpose as requested. Commit 6e10645.

Copilot finished work on behalf of halter73 May 29, 2025 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename ModelContextProtocol and ModelContextProtocol.Hosting packages
2 participants