Skip to content

feat: Add mcp.json to Visual Studio gitignore exceptions - #4735

Open
BenjaminMichaelis wants to merge 2 commits into
github:mainfrom
BenjaminMichaelis:patch-1
Open

BenjaminMichaelis wants to merge 2 commits into
github:mainfrom
BenjaminMichaelis:patch-1

Conversation

@BenjaminMichaelis

@BenjaminMichaelis BenjaminMichaelis commented Sep 23, 2025 •

Copy link
Copy Markdown

Reasons for making this change

As mcp's are becoming more common, sharing a workspace configuration of mcp servers is becoming more and more common with the mcp.json file. (https://code.visualstudio.com/docs/copilot/customization/mcp-servers#_add-an-mcp-server)

Adding this file as an exclusion to the default template so that it can be utilized by the editors and shared via source control.

This file can also be picked up by Visual Studio as seen here

Links to documentation supporting these rule changes

VSCode itself commits this file: https://github.com/microsoft/vscode/blob/main/.vscode/mcp.json

If this is a new template

Link to application or project’s homepage: TODO

Merge and Approval Steps

  • Confirm that you've read the contribution guidelines and ensured your PR aligns
  • Ensure CI is passing
  • Get a review and Approval from one of the maintainers

As mcp's are becoming more common, sharing a workspace configuration of mcp servers is becoming more and more common with the mcp.json file. (https://code.visualstudio.com/docs/copilot/customization/mcp-servers#_add-an-mcp-server)

Adding this file as an exclusion to the default template so that it can be utilized by the editors and shared via source control.

This file can also be picked up by Visual Studio as seen [here](https://learn.microsoft.com/visualstudio/ide/mcp-servers?view=vs-2022&WT.mc_id=8B97120A00B57354#file-locations-for-automatic-discovery-of-mcp-configuration)
@BenjaminMichaelis
BenjaminMichaelis requested a review from a team as a code owner September 23, 2025 18:16
Copilot AI review requested due to automatic review settings September 23, 2025 18:16

Copilot AI 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.

Pull Request Overview

This PR adds an exception for the mcp.json file in the Visual Studio gitignore template to support sharing Model Context Protocol (MCP) server configurations. The change allows the .vscode/mcp.json file to be tracked in version control alongside other VS Code workspace configuration files.

  • Adds !.vscode/mcp.json as an exception to the gitignore pattern
  • Enables sharing of MCP server configurations across development teams
  • Aligns with existing patterns for other VS Code configuration files

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@baronfel

baronfel commented Oct 1, 2025

Copy link
Copy Markdown

TBH I'd go as far as removing the .vscode exclusion entirely - that file is meant for sharing/checking-in on a per-repo basis.

@BenjaminMichaelis

Copy link
Copy Markdown
Author

@baronfel updated in 6d24007 - decided to make it a specific include to be clear rather than an omit, but open to opinion

@mdkhakonmdkhakon12-afk

Copy link
Copy Markdown

#4706

@github-actions

github-actions Bot commented Feb 8, 2026

Copy link
Copy Markdown

This PR is stale because there have been no updates in 90 days. It will close after 365 days of inactivity. Leave a comment if you want to keep it open.

@github-actions github-actions Bot added the stale label Feb 8, 2026
@BenjaminMichaelis

Copy link
Copy Markdown
Author

Keep open please

@github-actions github-actions Bot removed the stale label Feb 9, 2026

@dooleydevin dooleydevin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There are many valid reasons to include files like settings.json and launch.json, so we can't ignore the whole directory like this.

By our contribution guidelines, these rules really belong in the Global/VisualStudioCode.gitignore file, but they are already here and I'd rather not remove them as a part of this PR.

I'm also not sure that the mcp.json file really should be included in source control. From the VSCode docs here it seems they include an inputs parameter that is intended to include secrets:

"inputs": []: an optional array of input variable definitions for sensitive information like API keys.

If we want to include this, I'd ask for a few changes:

  1. Revert your last commit that ignores the whole vscode directory
  2. Include the rule as a comment like so #!.vscode/mcp.json
  3. Include a comment above it that explains why someone might choose to include it in their repository, and the risks of including secrets
  4. Duplicate this change in Global/VisualStudioCode.gitignore

@github-actions

Copy link
Copy Markdown

This PR is stale because there have been no updates in 90 days. It will close after 365 days of inactivity. Leave a comment if you want to keep it open.

@github-actions github-actions Bot added the stale label Jul 24, 2026
SixFive7 added a commit to SixFive7/BrowserAI that referenced this pull request Aug 19, 2026
… its own undoing

CreateProcessW's command line was declared ref char and called as
ref commandLine[0]. Microsoft's own Win32 metadata gives that parameter a span,
and ref char was weaker in three ways at once: no length, an empty buffer that
becomes IndexOutOfRangeException at the indexer rather than the null the API
accepts, and nothing saying which of the two buffers Windows writes back into.
Span<char> for the command line and ReadOnlySpan<char> for the environment now
say exactly that. The span is pinned rather than copied, so the mutation still
lands in our array, and the call site is unchanged apart from losing the [0].

Nothing was known to be wrong with the old shape. That is the point: it is a
declaration that presents as a plausible wrong answer rather than as an error,
which is the class this repository spends the most on. The two invariants it
silently relied on are now stated and asserted -- both buffers NUL-terminated,
neither ever empty -- and the empty environment block is the one that matters,
because it reaches Windows as null and means inherit the parent's environment.
The layout oracle cannot check any of this: NativeMethods.txt admits structs
only, deliberately, so a generated P/Invoke is never a second way to call
Windows from the test assembly.

The .gitignore item had three parts and the first one was a claim that was not
true. Upstream's VisualStudio.gitignore was re-fetched and compared: blob
d5a18de, unmoved since 2026-04-17, identical to our half except in one place.
That one place is why the marker comment's instruction -- refresh it wholesale,
in one paste -- was dangerous. artifacts/ and .artifacts/ are root-anchored
here, and unanchored they matched src/BrowserAI/Artifacts/ on case-insensitive
Windows and made five product source files invisible to git while every other
signal read green. So the procedure now says paste, re-apply, run the suite.
NoSourceFileIsInvisibleToGit makes forgetting a red build; the comment is what
stops the next person having to rediscover why it went red.

.vscode/mcp.json is re-admitted below the marker: github/gitignore#4735 is still
open, and for a project that IS an MCP server a workspace registration used for
testing was silently untracked. Proved with a positive control rather than an
absence -- the file was created, git listed it, and the negation was the rule
that matched. The third part was already done: /staging/ went on 2026-08-16 with
its reason recorded in the file, and the item had gone stale.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants