Skip to content

开放传输层列表给业务使用 + 优化一些小问题#4

Merged
lindexi merged 6 commits intomainfrom
t/walterlv/transports
Mar 13, 2026
Merged

开放传输层列表给业务使用 + 优化一些小问题#4
lindexi merged 6 commits intomainfrom
t/walterlv/transports

Conversation

@walterlv
Copy link
Member

@walterlv walterlv commented Mar 5, 2026

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR makes several improvements to the DotNetCampus.ModelContextProtocol library:

  1. Exposes the registered transport layer list to consumer code through a new McpServer.Transports property (backed by a List<IServerTransport> instead of HashSet<IServerTransport>).
  2. Centralizes common NuGet package build settings (AOT compatibility, symbols, SourceLink, etc.) into a shared build/Package.props file, promoting reuse across multiple projects.
  3. Optimizes AI-model-facing descriptions by switching from inline (Values: ...) format to a newline-separated format for enum values and polymorphic type hints.

Changes:

  • Expose transport list via McpServer.Transports and switch backing store from HashSet to List with manual dedup
  • Extract common package build properties into build/Package.props; update Ipc and TouchSocket.Http projects to import it and target multiple frameworks

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ServerTransportManager.cs _transports changed from HashSet to List with explicit duplicate check; new Transports property exposed
McpServer.cs New public Transports property delegating to ServerTransportManager.Transports
build/Package.props New shared file centralizing NuGet packaging properties and SourceLink reference
Directory.Build.props Removes per-project Description (now set per-project in each .csproj)
DotNetCampus.ModelContextProtocol.csproj Imports Package.props; removes properties now in shared file
DotNetCampus.ModelContextProtocol.TouchSocket.Http.csproj Imports Package.props; expands to multi-framework; adds Compatibility.cs link
DotNetCampus.ModelContextProtocol.Ipc.csproj Imports Package.props; removes IsPackable=false; adds missing package references
McpServerToolSourceBuilder.cs Switches to ToNullableDisabledGlobalDisplayString() for AOT-safe generic type arguments
JsonPropertySchemaInfo.cs Changes enum/polymorphic hint format from inline (Values: ...) to newline-separated
DotNetCampus.ModelContextProtocol.sln Adds build/Package.props to solution view

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

@lindexi lindexi enabled auto-merge March 11, 2026 09:46
@lindexi lindexi merged commit 9ef5def into main Mar 13, 2026
7 checks passed
@lindexi lindexi deleted the t/walterlv/transports branch March 13, 2026 07:05
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.

3 participants