Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 6, 2025

Overview

This PR adds Model Context Protocol (MCP) configuration files to all four templates (WPF, Console, Avalonia, and NuGet) to enhance AI-assisted development capabilities. A new --no-ai parameter allows users to opt-out of including these files.

Changes

Added .vscode/mcp.json Files

Each template now includes a .vscode/mcp.json configuration file with two MCP servers:

{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp"]
    },
    "msdocs": {
      "command": "npx",
      "args": ["-y", "@microsoft/mcp-server-docs"]
    }
  }
}
  • context7: Provides semantic code search and contextual understanding of your codebase
  • msdocs: Enables direct access to Microsoft documentation from AI assistants

The configuration file is placed in the .vscode directory to be recognized by Visual Studio and VS Code.

New --no-ai Parameter

Added a new optional parameter to all templates:

Parameter Description Default
--no-ai Exclude AI configuration files (.vscode/mcp.json) false

Usage example:

# Include .vscode/mcp.json (default behavior)
dotnet new keboo.wpf --name MyApp

# Exclude .vscode/mcp.json
dotnet new keboo.wpf --name MyApp --no-ai true

Documentation Updates

All template README files have been updated with:

  • The new --no-ai parameter in the parameters table
  • Usage examples demonstrating the parameter
  • A new "AI Configuration (Model Context Protocol)" section in Key Features explaining the functionality
  • Links to IDE documentation:

Benefits

  • Enhanced AI assistance: Developers using MCP-compatible AI tools get immediate access to semantic code search and Microsoft documentation
  • IDE integration: Native support in Visual Studio and VS Code through the .vscode/mcp.json configuration
  • Opt-in friendly: Default behavior includes the files, but they can be easily excluded
  • Zero impact: The mcp.json file is configuration-only and doesn't affect build, test, or runtime behavior
  • Consistent pattern: Follows the existing template parameter conventions (--sln, --no-tests, etc.)

Testing

All templates have been tested with both default behavior and --no-ai true:

  • ✅ WPF template (with and without --no-ai)
  • ✅ Console template (with and without --no-ai)
  • ✅ NuGet template (with and without --no-ai)
  • ✅ Avalonia template (with and without --no-ai)

Verified that .vscode/mcp.json is correctly included by default and properly excluded when --no-ai true is specified.

Fixes #388

Original prompt

This section details on the original issue you should resolve

<issue_title>Add mcp.json file to all templates</issue_title>
<issue_description>Include context7, and MS Docs MCPs
https://github.com/mcp

Include a new --no-ai switch that will exclude this file from the template when specified (defaults to false)</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #388

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add mcp.json file to all templates Add MCP (Model Context Protocol) configuration to all templates with --no-ai option Oct 6, 2025
Copilot finished work on behalf of Keboo October 6, 2025 15:05
Copilot AI requested a review from Keboo October 6, 2025 15:05
@Keboo
Copy link
Owner

Keboo commented Oct 6, 2025

@copilot The files should end up in .vscode/mcp.json within each of the templates.

Update the README on each of the templates mentioning this as a feature.
Include the following links
Visual Studio
VS Code

Copy link
Contributor Author

Copilot AI commented Oct 6, 2025

@copilot The files should end up in .vscode/mcp.json within each of the templates.

Update the README on each of the templates mentioning this as a feature.
...

Updated in commit e0a3e8d. The mcp.json files are now located at .vscode/mcp.json in each template, and all documentation has been updated with the requested Visual Studio and VS Code links.

Copilot finished work on behalf of Keboo October 6, 2025 18:05
Comment on lines +8 to +9
"command": "npx",
"args": ["-y", "@microsoft/mcp-server-docs"]
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot the microsoft docs should use this configuration over npx:

    "type": "http",
    "url": "https://learn.microsoft.com/api/mcp"

Copy link
Owner

Choose a reason for hiding this comment

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

@copilot fix this

@Keboo
Copy link
Owner

Keboo commented Oct 8, 2025

@copilot fix the comments

Copilot finished work on behalf of Keboo October 8, 2025 00:44
Copy link
Contributor Author

Copilot AI commented Oct 8, 2025

@copilot fix the comments

Could you clarify what comments need to be fixed? The mcp.json files are currently in standard JSON format (which doesn't support comments). Would you like me to:

  1. Add explanatory comments by converting to JSONC format?
  2. Add code comments somewhere else in the templates?
  3. Fix something specific in the documentation?

@Keboo
Copy link
Owner

Keboo commented Oct 8, 2025

Could you clarify what comments need to be fixed? The mcp.json files are currently in standard JSON format (which doesn't support comments). Would you like me to:

@copilot this comment

#389 (comment)

Copilot finished work on behalf of Keboo October 8, 2025 00:46
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.

Add mcp.json file to all templates

3 participants