Skip to content

Instantly share code, notes, and snippets.

@cynthiateeters
Created July 26, 2025 02:17
Show Gist options
  • Select an option

  • Save cynthiateeters/86ea315e533cedab9fd2bde0ddb768ce to your computer and use it in GitHub Desktop.

Select an option

Save cynthiateeters/86ea315e533cedab9fd2bde0ddb768ce to your computer and use it in GitHub Desktop.

Troubleshooting User-Level MCP in VS Code (Windows Focus)

This guide centers on the single most efficient way to configure Model Context Protocol (MCP) servers—especially Context7—in user scope on Windows, without touching workspace settings.


1. Use MCP: Open User Configuration

The MCP: Open User Configuration command automates locating or creating your user-level MCP file and opens it directly:

C:\Users\<YourUsername>\AppData\Roaming\Code\User\mcp.json

Steps:

  1. Press Ctrl+Shift+P to open the Command Palette.
  2. Type MCP: Open User Configuration and hit Enter.
  3. VS Code opens mcp.json. If the file doesn’t exist, VS Code creates it with {}.

Benefits:

  • No manual navigation or guesswork.
  • Keeps workspace-level .vscode folders untouched for team projects.
  • Ensures a consistent, global MCP environment across all your VS Code instances.

2. Add Your MCP Servers (Context7 Example)

With the file open, define servers under the top-level servers key:

{
  "servers": {
    "context7": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp@latest"],
      "gallery": true
    }
  }
}
  • type: "stdio" runs the server over stdin/stdout.
  • command: "npx" avoids global installs and loads latest version.
  • gallery: true makes Context7 visible in the MCP gallery UI.

Save the file to register your server.


3. Common Windows Pitfalls & Fixes

Issue Symptom Fix
npx Not Found (ENOENT) Server doesn’t launch Use CMD wrapper:
"command": "cmd",
"args": ["/c", "npx -y @upstash/context7-mcp@latest"]

Or add Node.js to System PATH and restart VS Code. | | Permissions Errors | "Operation not permitted" | Run VS Code as Administrator or adjust PowerShell policy:

Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
``` |
| File Not Created/Open        | No `mcp.json` present  | Ensure `chat.mcp.discovery.enabled` is `true` in `settings.json`, or manually create the file. |
| WSL vs Windows Mismatch      | Changes affect only WSL | Run the command in **Windows-native** VS Code, not in WSL.   |

---

### 4. Verify & Test

1. **Reload VS Code**: Command Palette → **Developer: Reload Window**.
2. **List Servers**: Command Palette → **MCP: Show Installed Servers** → Look for `context7` under **User Servers**.
3. **Test a Tool**: In Copilot chat, ask:

get-library-docs @upstash/context7-mcp

A valid JSON response confirms Context7 is active.

---

### 5. Best Practices

- **Backup** `%USERPROFILE%\.mcp.json` for easy migration.
- **Use `npx`** to always run the latest MCP version.
- **Separate MCP config** from workspace settings to preserve shared repos.
- **Check Logs**: Help → Toggle Developer Tools → Console for MCP errors.

---

With **MCP: Open User Configuration** as your focus, setting up user-scope MCP servers on Windows becomes seamless, reliable, and entirely decoupled from workspace-level configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment