Option to support declarative tool registration activated by version (e.g. "beta")
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- csharp
- Domain
- api, backend-api-design
Research direction
Start by tracing declarative tool registration, the tool metadata represented by McpServerTool, and the middleware or list-tools path that currently exposes ToolCollection. Define how route or header version matching should be represented and filtered, then verify that versioned tools remain hidden unless the matching client request is present without breaking normal tool discovery.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
Currently, there is no clear way to adding new endpoints under test and keeping those from the broader user audience.
This makes incremental rollouts of new tools challenging because it is not possible to easily have some users opt in progressively to receive new features for stability testing.
Describe the solution you'd like
- When tools are registered, allow it to be registered with a version
- Spitballing:
- Version specification: accept route match (
*/vnext/*) or header (x-mcp-version: vnext) - Example:
[McpServerTool(Name = "my_tool", VersionHeader = "x-mcp-version", VersionMatch = "vnext")]
- Version specification: accept route match (
- This sets up the filter in the middleware automatically and checks incoming headers against the toolset metadata, automatically removing ones that target specific versions; effectively, it says client must transmit the header to see this tool.
Describe alternatives you've considered
Current workaround is to directly manipulate the ToolCollection dynamically:
server.WithListToolsHandler(
async (context, cancellationToken) =>
{
// Resolve HttpContext via DI
var httpContext = context
.Services?.GetRequiredService<IHttpContextAccessor>()
.HttpContext;
// Check for the specific header
bool betaEnabled =
httpContext?.Request.Headers.ContainsKey("x-biblio-enable-beta") ?? false;
if (!betaEnabled)
{
var betaTools =
context.Server?.ServerOptions?.ToolCollection?.Where(tool =>
tool.ProtocolTool.Title?.Contains("(BETA)") ?? false
)
?? [];
foreach (var tool in betaTools.ToList())
{
// 👇 Active removal
context?.Server?.ServerOptions?.ToolCollection?.Remove(tool);
}
}
return new ListToolsResult
{
Tools = [], // Empty; these are additional tools.
};
}
);
Additional context
Similar to these issues:
- Dominant language
- C#
- Stars
- 4.5k
- Forks
- 814
- Avg merge
- 9d 19h
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from modelcontextprotocol/csharp-sdk
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
modelcontextprotocol/csharp-sdk#1867 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
modelcontextprotocol/csharp-sdk#1840 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
modelcontextprotocol/csharp-sdk#1836 ·
-
enhancement needs confirmation
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
modelcontextprotocol/csharp-sdk#678 · 1 comment ·
-
enhancement needs confirmation P3 ready for work
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
modelcontextprotocol/csharp-sdk#515 · 6 comments · 3 reactions ·
All issues in modelcontextprotocol/csharp-sdk
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·