Added FSharp Templates for MCP#7548
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds an F# MCP server project template with both local (stdio) and remote (HTTP) transport options, and updates packaging to correctly transform F# project files.
Changes:
- Introduce new F# template content for local and remote MCP servers (README, Program.fs, project files, tooling, config).
- Add MSBuild packaging support to transform
.fsproj-ininto.fsproj. - Align template grouping behavior by adding
groupIdentityto the C# template.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ProjectTemplates/Microsoft.McpServer.ProjectTemplates/templates/McpServer-FSharp/remote/README.md | Adds remote (HTTP) template README with conditional content and IDE connection examples |
| src/ProjectTemplates/Microsoft.McpServer.ProjectTemplates/templates/McpServer-FSharp/remote/Properties/launchSettings.json | Adds HTTP/HTTPS launch profiles for the remote template |
| src/ProjectTemplates/Microsoft.McpServer.ProjectTemplates/templates/McpServer-FSharp/remote/Program.fs | Adds ASP.NET Core host wiring for MCP over HTTP |
| src/ProjectTemplates/Microsoft.McpServer.ProjectTemplates/templates/McpServer-FSharp/remote/McpServer-FSharp.http | Adds an HTTP-file example for calling the MCP tool endpoint |
| src/ProjectTemplates/Microsoft.McpServer.ProjectTemplates/templates/McpServer-FSharp/remote/McpServer-FSharp.fsproj-in | Adds remote F# project template including conditional self-contained settings |
| src/ProjectTemplates/Microsoft.McpServer.ProjectTemplates/templates/McpServer-FSharp/local/README.md | Adds local (stdio) template README including NuGet packaging guidance |
| src/ProjectTemplates/Microsoft.McpServer.ProjectTemplates/templates/McpServer-FSharp/local/Program.fs | Adds console host wiring for MCP over stdio |
| src/ProjectTemplates/Microsoft.McpServer.ProjectTemplates/templates/McpServer-FSharp/local/McpServer-FSharp.fsproj-in | Adds local F# project template configured for packing as an MCP server tool |
| src/ProjectTemplates/Microsoft.McpServer.ProjectTemplates/templates/McpServer-FSharp/local/.mcp/server.json | Adds MCP server manifest for packaged/local consumption |
| src/ProjectTemplates/Microsoft.McpServer.ProjectTemplates/templates/McpServer-FSharp/common/Tools/RandomNumberTools.fs | Adds a sample MCP tool implementation (random number) |
| src/ProjectTemplates/Microsoft.McpServer.ProjectTemplates/templates/McpServer-FSharp/.template.config/template.json | Defines F# template parameters, conditions, and conditional file operations |
| src/ProjectTemplates/Microsoft.McpServer.ProjectTemplates/templates/McpServer-FSharp/.template.config/ide.host.json | Exposes key template parameters in IDE hosts |
| src/ProjectTemplates/Microsoft.McpServer.ProjectTemplates/templates/McpServer-FSharp/.template.config/dotnetcli.host.json | Configures CLI parameter names/visibility for the F# template |
| src/ProjectTemplates/Microsoft.McpServer.ProjectTemplates/templates/McpServer-CSharp/.template.config/template.json | Adds groupIdentity to align grouping with the F# template |
| src/ProjectTemplates/Microsoft.McpServer.ProjectTemplates/Microsoft.McpServer.ProjectTemplates.csproj | Updates packaging to exclude .fsproj-in and transform them into .fsproj |
| app.MapMcp() |> ignore | ||
| app.UseHttpsRedirection() |> ignore |
| "SelfContained": { | ||
| "longName": "self-contained", | ||
| "shortName": "" | ||
| }, |
| "usageExamples": [ | ||
| "" | ||
| ] |
🎉 Good job! The coverage increased 🎉
Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1455212&view=codecoverage-tab |
🎉 Good job! The coverage increased 🎉
Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1457094&view=codecoverage-tab |
This pull request adds a new F# project template for creating Model Context Protocol (MCP) servers, alongside enhancements to the packaging and configuration of project templates. The new F# template supports both local (stdio) and remote (HTTP) transports, includes sample code and configuration, and aligns with the existing C# template structure. Additionally, the packaging logic in the main
.csprojis updated to handle F# templates and content appropriately.F# MCP Server Template Addition
template.json,dotnetcli.host.json,ide.host.json), project files for both local and remote server types, sample tool implementation (RandomNumberTools.fs), a sample program entry point for each transport, and documentation (README.md). The template supports both self-contained and framework-dependent builds, and provides guidance for publishing to NuGet and local development. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]Project Template Packaging Improvements
.csprojto include and correctly transform both.csproj-in(C#) and.fsproj-in(F#) template files, ensuring they are packaged and processed as content.C# Template Metadata Update
groupIdentityto the C# MCP server template configuration for improved template grouping and discoverability.Microsoft Reviewers: Open in CodeFlow