: { ... } } }` per the VS Code * MCP extension's configuration spec. */ final class VSCodeClient extends AbstractMCPClient { /** * {@inheritDoc} */ public function get_client_slug(): string { return 'vscode'; } /** * {@inheritDoc} */ public function get_client_name(): string { return 'VS Code'; } /** * {@inheritDoc} * * @param string $server_url Already-sanitised server URL. * @param string $auth_token Already-issued Application Password (may be empty). * * @return array */ public function get_config_snippet( string $server_url, string $auth_token ): array { return array( 'servers' => array( $this->derive_server_key( $server_url ) => array( 'command' => 'npx', 'args' => array( '-y', '@automattic/mcp-wordpress-remote@latest' ), 'env' => $this->build_env( $server_url, $auth_token ), ), ), ); } /** * {@inheritDoc} */ public function get_icon(): string { return '▤'; } /** * {@inheritDoc} */ public function get_description(): string { return __( 'Visual Studio Code', 'acrossai-mcp-manager' ); } /** * {@inheritDoc} * * F078 (2026-08-24) — corrected macOS user-level path from the incorrect * `~/.vscode/mcp.json` (Cursor-style) to the documented VS Code path. * Source: https://code.visualstudio.com/docs/agents/reference/mcp-configuration */ public function get_config_file(): string { return '~/Library/Application Support/Code/User/mcp.json'; } /** * {@inheritDoc} * * Verified 2026-10-07. `mcp.json` lives beside `settings.json` in VS Code's * user-profile folder, whose three locations are documented at * {@link https://code.visualstudio.com/docs/configure/settings}: * * macOS ~/Library/Application Support/Code/User/ * Windows %APPDATA%\\Code\\User\\ * Linux ~/.config/Code/User/ * * This is the first client where the three paths genuinely diverge rather * than being one home-relative path written three ways. * * @since 0.3.9 * @return array */ public function get_config_files(): array { return array( 'macos' => '~/Library/Application Support/Code/User/mcp.json', 'windows' => '%APPDATA%\\Code\\User\\mcp.json', 'linux' => '~/.config/Code/User/mcp.json', ); } /** * {@inheritDoc} */ public function get_top_level_key(): string { return 'servers'; } /** * {@inheritDoc} */ public function get_instructions(): string { return __( 'Generate a password → copy the JSON → open the user-level ~/Library/Application Support/Code/User/mcp.json (or run Cmd/Ctrl + Shift + P → "MCP: Open User Configuration"). Workspace-scope: paste under servers in .vscode/mcp.json at the repo root.', 'acrossai-mcp-manager' ); } /** * {@inheritDoc} * * F078 — VS Code auto-starts new MCP servers when the config is saved; * a Reload Window is only needed as a fallback. */ public function get_restart_step_text(): string { return __( 'VS Code auto-starts the new MCP server when the config file is saved. If it does not appear, run Cmd/Ctrl + Shift + P → "MCP: List Servers" and start it, or reload the window (Cmd/Ctrl + Shift + P → Developer: Reload Window).', 'acrossai-mcp-manager' ); } /** * {@inheritDoc} */ public function get_priority(): int { return 30; } }