Skip to content

List tools from DI once#115

Merged
stephentoub merged 7 commits intomodelcontextprotocol:mainfrom
halter73:dedup-tools
Mar 27, 2025
Merged

List tools from DI once#115
stephentoub merged 7 commits intomodelcontextprotocol:mainfrom
halter73:dedup-tools

Conversation

@halter73
Copy link
Copy Markdown
Contributor

Prior to this change, the AspNetCoreSseServer sample listed duplicate tools per call to McpServerFactory.Create with the same options.

duplicate tools listing

  • This follows the best practice to not mutate options outside of IConfigureOptions callbacks and sets the stage for more changes to allow for multiple server connections in a single process.
  • Long-term, we should move the repeated work from SetToolsHandler into an IPostConfigureOptions service or IMcpServerConnectionFactory

- Follow best practice to not mutate options outside of IConfigureOptions
- Long-term, we should move the repeated work from SetToolsHandler into
  an IPostConfigureOptions service or IMcpServerConnectionFactory
@halter73 halter73 requested a review from stephentoub March 27, 2025 01:28
@stephentoub stephentoub merged commit 4a53f6f into modelcontextprotocol:main Mar 27, 2025
8 checks passed
@jeffhandley jeffhandley added the breaking-change This issue or PR introduces a breaking change label Feb 20, 2026
@jeffhandley
Copy link
Copy Markdown
Contributor

Adding the breaking-change label retroactively during release notes revision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change This issue or PR introduces a breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants