Remove obsolete APIs from codebase and standardize MCP diagnostic IDs (#985)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: MackinnonBuck <10456961+MackinnonBuck@users.noreply.github.com>
Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com>
Co-authored-by: Mackinnon Buck <mackinnon.buck@gmail.com>
Co-authored-by: jeffhandley <1031940+jeffhandley@users.noreply.github.com>
Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com>
This commit is contained in:
Copilot 2025-12-02 10:28:46 -08:00 • committed by GitHub
commit 136755f2be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -230,10 +230,6 @@ internal sealed partial class McpServerImpl : McpServer
var completeHandler = options.Handlers.CompleteHandler;
var completionsCapability = options.Capabilities?.Completions;
#pragma warning disable CS0618 // Type or member is obsolete
completeHandler ??= completionsCapability?.CompleteHandler;
#pragma warning restore CS0618 // Type or member is obsolete
if (completeHandler is null && completionsCapability is null)
{
return;
@ -266,14 +262,6 @@ internal sealed partial class McpServerImpl : McpServer
var resources = options.ResourceCollection;
var resourcesCapability = options.Capabilities?.Resources;
#pragma warning disable CS0618 // Type or member is obsolete
listResourcesHandler ??= resourcesCapability?.ListResourcesHandler;
listResourceTemplatesHandler ??= resourcesCapability?.ListResourceTemplatesHandler;
readResourceHandler ??= resourcesCapability?.ReadResourceHandler;
subscribeHandler ??= resourcesCapability?.SubscribeToResourcesHandler;
unsubscribeHandler ??= resourcesCapability?.UnsubscribeFromResourcesHandler;
#pragma warning restore CS0618 // Type or member is obsolete
if (listResourcesHandler is null && listResourceTemplatesHandler is null && readResourceHandler is null &&
subscribeHandler is null && unsubscribeHandler is null && resources is null &&
resourcesCapability is null)
@ -427,11 +415,6 @@ internal sealed partial class McpServerImpl : McpServer
var prompts = options.PromptCollection;
var promptsCapability = options.Capabilities?.Prompts;
#pragma warning disable CS0618 // Type or member is obsolete
listPromptsHandler ??= promptsCapability?.ListPromptsHandler;
getPromptHandler ??= promptsCapability?.GetPromptHandler;
#pragma warning restore CS0618 // Type or member is obsolete
if (listPromptsHandler is null && getPromptHandler is null && prompts is null &&
promptsCapability is null)
{
@ -515,11 +498,6 @@ internal sealed partial class McpServerImpl : McpServer
var tools = options.ToolCollection;
var toolsCapability = options.Capabilities?.Tools;
#pragma warning disable CS0618 // Type or member is obsolete
listToolsHandler ??= toolsCapability?.ListToolsHandler;
callToolHandler ??= toolsCapability?.CallToolHandler;
#pragma warning restore CS0618 // Type or member is obsolete
if (listToolsHandler is null && callToolHandler is null && tools is null &&
toolsCapability is null)
{
@ -618,10 +596,6 @@ internal sealed partial class McpServerImpl : McpServer
// We don't require that the handler be provided, as we always store the provided log level to the server.
var setLoggingLevelHandler = options.Handlers.SetLoggingLevelHandler;
#pragma warning disable CS0618 // Type or member is obsolete
setLoggingLevelHandler ??= options.Capabilities?.Logging?.SetLoggingLevelHandler;
#pragma warning restore CS0618 // Type or member is obsolete
// Apply filters to the handler
if (setLoggingLevelHandler is not null)
{