fix: Update VSCode manager to use mcp.json with correct structure - #300
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
…ucture - Change config file paths from settings.json to mcp.json - macOS: ~/Library/Application Support/Code/User/mcp.json - Windows: %APPDATA%/Code/User/mcp.json - Linux: ~/.config/Code/User/mcp.json - Remove mcp root key wrapping in _load_config and _save_config - Support servers and inputs at root level per VS Code docs - Add comprehensive test suite for VSCode manager Fixes #295 Co-authored-by: JoJoJoJoJoJoJo <23650418+JoJoJoJoJoJoJo@users.noreply.github.com>
Use tempfile.gettempdir() instead of hardcoded /tmp/ path for Windows compatibility Co-authored-by: JoJoJoJoJoJoJo <23650418+JoJoJoJoJoJoJo@users.noreply.github.com>
Remove redundant import from method body Co-authored-by: JoJoJoJoJoJoJo <23650418+JoJoJoJoJoJoJo@users.noreply.github.com>
- Update _load_config docstring to reflect full return structure - Capitalize MCP consistently in test comments Co-authored-by: JoJoJoJoJoJoJo <23650418+JoJoJoJoJoJoJo@users.noreply.github.com>
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||||
There was a problem hiding this comment.
Pull request overview
This PR fixes the VSCode MCP configuration to use the correct file location (mcp.json) and structure as specified in the VS Code MCP documentation, replacing the previous incorrect implementation that targeted settings.json with a nested mcp wrapper.
Changes:
- Updated config file paths from
settings.jsontomcp.jsonacross all platforms (macOS, Windows, Linux) - Modified config structure to have
serversat root level instead of nested under anmcpkey - Added comprehensive test suite with 18 tests covering platform-specific paths, config structure validation, and CRUD operations
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/mcpm/clients/managers/vscode.py | Updated config paths to mcp.json and restructured _load_config() and _save_config() methods to use servers at root level with inputs array |
| tests/test_clients/test_vscode.py | Added comprehensive test coverage for VSCode manager including platform-specific path tests, config structure validation, and server CRUD operations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
# [2.13.0](v2.12.1...v2.13.0) (2026-01-15) ### Bug Fixes * Update VSCode manager to use mcp.json with correct structure ([#300](#300)) ([a1adc20](a1adc20)), closes [#295](#295) ### Features * Add MCP manifest for jotform-mcp-server ([#297](#297)) ([99564ab](99564ab)) * Add MCP manifest for ProfessionalWiki-MediaWiki-MCP-Server ([#293](#293)) ([eabf191](eabf191)), closes [#299](#299)
|
🎉 This PR is included in version 2.13.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
User description
VSCode's MCP configuration was incorrectly targeting
settings.jsonwith config wrapped under anmcpkey. Per VS Code MCP docs, it should use a dedicatedmcp.jsonfile withserversat root level.Changes
Config paths: Changed from
settings.jsontomcp.jsonfor all platforms:~/Library/Application Support/Code/User/mcp.json%APPDATA%/Code/User/mcp.json~/.config/Code/User/mcp.jsonConfig structure: Removed
mcpwrapper in_load_config()and_save_config():Added test coverage: 18 tests for VSCode manager including platform-specific paths, config structure validation, and CRUD operations
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
astral.sh/usr/bin/curl curl -LsSf REDACTED tests/test_run.py(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
PR Type
Bug fix, Tests
Description
Changed VSCode config file from
settings.jsontomcp.jsonper VS Code MCP docsRemoved
mcproot key wrapper, movedserversto root levelUpdated
_load_config()and_save_config()to handle new structureAdded comprehensive test suite with 18 tests for VSCode manager functionality
Diagram Walkthrough
File Walkthrough
vscode.py
Update VSCode config to use mcp.json with correct structuresrc/mcpm/clients/managers/vscode.py
settings.jsontomcp.jsonfor allplatforms (Windows, macOS, Linux)
mcproot key wrapping in_load_config()method, now returnsconfig with
serversat root level_save_config()to save config directly without nesting undermcpkeyinputsarray at root level per VS Code MCPspecification
test_vscode.py
Add comprehensive test suite for VSCode managertests/test_clients/test_vscode.py
platform-specific config paths (macOS, Windows, Linux)
serversat root level andinputsarrayadd_server(),get_server(),remove_server(),list_servers()to_client_format()andfrom_client_format()files, and config migration compatibility