Skip to content

Update copilot-instructions.md: McpServerFactory was removed - #1892

Merged
tarekgh merged 3 commits into
modelcontextprotocol:mainfrom
Zir0-93:docs/copilot-instructions-mcpserver-create
Oct 5, 2026
Merged

tarekgh merged 3 commits into
modelcontextprotocol:mainfrom
Zir0-93:docs/copilot-instructions-mcpserver-create

Conversation

@Zir0-93

@Zir0-93 Zir0-93 commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1893.

.github/copilot-instructions.md line 258 tells agents to use McpServerFactory, which was marked obsolete in 38b4a26 ("Use McpServer.Create instead") and removed in #985. The instructions file was not part of that diff, so the reference stayed. This changes the line to name McpServer.Create.

Documentation-only change; no code or tests affected.

@chrikrah chrikrah left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approve at b05c876. The change checks out.

$ git grep -n McpServerFactory c40ee04
.github/copilot-instructions.md:258:- Use `McpServerFactory` to create server instances with configured options

$ git grep -n McpServerFactory b05c876

$ git grep -n "static McpServer Create" b05c876 -- 'src/**/*.cs'
src/ModelContextProtocol.Core/Server/McpServer.Methods.cs:60:    public static McpServer Create(

I swept the rest of the file for the same defect. 76 backticked names went in, three came out.

$ git show b05c876:.github/copilot-instructions.md \
    | grep -oP '(?<=`)[A-Za-z.()<>]+(?=`)' | sed 's/^\.//; s/(.*//; s/<.*//' \
    | grep -xP '[A-Z][A-Za-z0-9]*' | sort -u \
    | while read n; do git grep -qw "$n" b05c876 -- src tests samples || echo "ABSENT: $n"; done
ABSENT: AddMcpClient
ABSENT: CustomizableJsonStringEnumConverter
ABSENT: McpEndpoint

non-blocking: CustomizableJsonStringEnumConverter sits at :77 and :249, and b993ae0 (#957) deleted it in the same diff that rewrote McpJsonUtilities.cs:50 to the BCL JsonStringEnumConverter. :60 offers McpEndpoint as the prefix example, and 38b4a26, the commit you cite, deleted that class file. :67 has agents call .AddMcpClient(), where McpServerServiceCollectionExtensions.cs:20 registers only the server side.

Two blind spots in that sweep, both pointing the same way. Whole-word matching makes a name that survives only as a prefix read absent, and McpEndpointRouteBuilderExtensions is what Mcp-plus-endpoint looks like today. A name living only under docs/ reads absent as well, since the pathspec skips it. Whole-tree git grep -w for all three returns nothing but these instruction lines.

@Zir0-93 these are three separate lines from the one you fixed. Take them here if you want them, or say the word and I will open an issue for them. @jeffhandley merged the last change to this file, in #1794.

…nt, AddMcpClient, CustomizableJsonStringEnumConverter)
@Zir0-93

Zir0-93 commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the sweep, good catches. Took all three here: McpServerOptions replaces McpEndpoint as the prefix example, .AddMcpClient() is gone since only the server side registers through DI, and both enum lines now point at the built-in JsonStringEnumConverter.

@chrikrah chrikrah left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@Zir0-93 I would merge this at 412f0f1. The same sweep over the file now prints nothing, and both replacement names exist in src/.

$ git show 412f0f1:.github/copilot-instructions.md \
    | grep -oP '(?<=`)[A-Za-z.()<>]+(?=`)' | sed 's/^\.//; s/(.*//; s/<.*//' \
    | grep -xP '[A-Z][A-Za-z0-9]*' | sort -u \
    | while read n; do git grep -qw "$n" 412f0f1 -- src tests samples || echo "ABSENT: $n"; done
# 74 names in, nothing printed; three were printed at b05c876

$ git grep -n "new JsonStringEnumConverter" 412f0f1 -- src
412f0f1:src/ModelContextProtocol.Core/McpJsonUtilities.cs:50:            options.Converters.Add(new JsonStringEnumConverter());
$ git grep -lw "class McpServerOptions" 412f0f1 -- src
412f0f1:src/ModelContextProtocol.Core/Server/McpServerOptions.cs
# not run: a build, since the diff is one markdown file

@halter73 @tarekgh, could one of you take this? It is docs-only.

@tarekgh tarekgh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The API name updates look correct. These two enum statements need qualification for reflection-disabled and Native AOT scenarios.

Comment thread .github/copilot-instructions.md Outdated
Comment thread .github/copilot-instructions.md Outdated

@tarekgh tarekgh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@tarekgh
tarekgh force-pushed the docs/copilot-instructions-mcpserver-create branch from f33021a to dc86a74 Compare October 5, 2026 16:16
@tarekgh
tarekgh merged commit 3338e88 into modelcontextprotocol:main Oct 5, 2026
4 checks passed
@Zir0-93
Zir0-93 deleted the docs/copilot-instructions-mcpserver-create branch October 6, 2026 14:18
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.

copilot-instructions.md references McpServerFactory, which was removed in #985

4 participants