Introduce local vs. remote mcpserver template option#7168
Merged
jeffhandley merged 4 commits intodotnet:mainfrom Dec 20, 2025
Merged
Introduce local vs. remote mcpserver template option#7168jeffhandley merged 4 commits intodotnet:mainfrom
jeffhandley merged 4 commits intodotnet:mainfrom
Conversation
1. Move the VS/VS Code local config documentation blurb up in the README 2. Add a Known Issues section to the README 3. When using VS (not CLI or VS Code), use HTTPS instead of HTTP
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a local vs. remote transport option for the MCP server project template and moves it to a new dedicated package. The changes enable developers to choose between creating a local MCP server using stdio transport (as a console app) or a remote MCP server using HTTP transport (as an ASP.NET Core web application).
Key changes include:
- Addition of a
--transportparameter with choices of "local" (default) or "remote" to select the transport type - Creation of separate template source directories (
local/andremote/) for each transport mode - Conditional HTTPS redirection based on the host identifier (Visual Studio vs. VS Code/CLI) to work around known certificate issues
- Update to ModelContextProtocol packages from version 0.4.0-preview.3 to 0.5.0-preview.1
Reviewed changes
Copilot reviewed 32 out of 52 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/ProjectTemplates/Microsoft.McpServer.ProjectTemplates/** |
New package containing the mcpserver template with local/remote transport options |
src/ProjectTemplates/Microsoft.Extensions.AI.Templates/** |
Removed mcpserver template files, updated AIChatWeb template identity |
test/ProjectTemplates/Microsoft.McpServer.ProjectTemplates.IntegrationTests/** |
Added snapshot and execution tests for the new mcpserver template package |
test/ProjectTemplates/Infrastructure/** |
Enhanced test utilities to support the new transport parameter and .http file scrubbing |
eng/packages/ProjectTemplates.props |
Updated ModelContextProtocol package versions and added AspNetCore variant |
...ctTemplates/Microsoft.McpServer.ProjectTemplates/templates/McpServer-CSharp/remote/README.md
Outdated
Show resolved
Hide resolved
jeffhandley
added a commit
to jeffhandley/extensions
that referenced
this pull request
Dec 20, 2025
* Move the mcpserver template into a new Microsoft.McpServer.ProjectTemplates package * Add local/remote option to McpServer template. Bump to MCP 0.5.0-preview.1. * Address feedback on the mcpserver remote template 1. Move the VS/VS Code local config documentation blurb up in the README 2. Add a Known Issues section to the README 3. When using VS (not CLI or VS Code), use HTTPS instead of HTTP * Fix typo in README
jeffhandley
added a commit
that referenced
this pull request
Dec 20, 2025
* Move the mcpserver template into a new Microsoft.McpServer.ProjectTemplates package * Add local/remote option to McpServer template. Bump to MCP 0.5.0-preview.1. * Address feedback on the mcpserver remote template 1. Move the VS/VS Code local config documentation blurb up in the README 2. Add a Known Issues section to the README 3. When using VS (not CLI or VS Code), use HTTPS instead of HTTP * Fix typo in README
This was referenced Jan 13, 2026
This was referenced Jan 13, 2026
Merged
Bump Microsoft.Extensions.Http.Resilience from 10.1.0 to 10.2.0
askpt/openfeature-dotnet-workshop#96
Closed
Closed
This was referenced Jan 19, 2026
Bump Microsoft.Extensions.AI.Abstractions from 10.1.1 to 10.2.0
modelcontextprotocol/csharp-sdk#1163
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This also moves the mcpserver project template to its own (new) package:
Microsoft.McpServer.ProjectTemplates. Bump ModelContextProtocol to 0.5.0-preview.1 for the template (both local and remote).Note there is a known issue for using http mcp servers in VS Code when using the dev-cert. To work around that, we only use HTTPS for the template when the host is Visual Studio; using VS Code or the CLI results in using HTTP. The README contains a Known Issues section to call this out.
Microsoft Reviewers: Open in CodeFlow
Usage: dotnet new mcpserver [options] [template options] Options: -n, --name <name> The name for the output being created. If no name is specified, the name of the output directory is used. -o, --output <output> Location to place the generated output. --dry-run Displays a summary of what would happen if the given command line were run if it would result in a template creation. [default: False] --force Forces content to be generated even if it would change existing files. [default: False] --no-update-check Disables checking for the template package updates when instantiating a template. [default: False] --project <project> The project that should be used for context evaluation. -lang, --language <C#> Specifies the template language to instantiate. --type <project> Specifies the template type to instantiate. Template options: -t, --transport <local|remote> Whether to create a 'local' (stdio transport) or 'remote' (http transport) MCP server Type: choice local A console application will be created to use the stdio transport as a local MCP server remote An ASP.NET Core web application will be created to use the http transport as a remote MCP server Default: local --aot Whether to enable the MCP server for publishing as a native AOT application. Type: bool Default: false --self-contained Whether to enable the MCP server for publishing as a self-contained application. Type: bool Default: true -f, --framework <net10.0|net8.0|net9.0> The target framework for the project. Type: choice net10.0 .NET 10 net9.0 .NET 9 net8.0 .NET 8 Default: net10.0