### Install a Server via Sidebar Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/README.md Describes the process of installing a server by clicking an 'Install' button in the sidebar. This involves handling RPC calls, potentially using AI-assisted setup, parsing READMEs, and opening the MCP install URI. ```typescript // User: click "Install" on server card // → ExtensionPanel handles installFromConfigType RPC // → May show AI-assisted setup if no direct config // → readmeExtractionRequest parses README // → openMcpInstallUri opens mcp://install/ URI // → VS Code's MCP handler writes configuration ``` -------------------------------- ### Installation with Input Placeholders Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/configuration.md Configure an MCP installation using input placeholders for sensitive information like API keys and URLs. This allows for dynamic configuration during setup. ```json { "command": "npx", "args": ["-y", "@my-org/mcp"], "env": { "API_KEY": "${input:apiKey}", "API_URL": "${input:apiUrl}" }, "inputs": [ { "type": "promptString", "id": "apiKey", "description": "API Key", "password": true }, { "type": "promptString", "id": "apiUrl", "description": "API URL" } ] } ``` -------------------------------- ### AI-Assisted Setup Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/extension-panel.md Initiates AI-powered MCP server installation with automatic configuration extraction from a repository's README. It requires repository details and optional cloud MCP details. ```typescript messenger.onRequest(aiAssistedSetupType, async (payload) => { const { repo, cloudMcpDetails } = payload; // Extract config from README and prepare installation return await performAiSetup(repo, cloudMcpDetails); }) ``` -------------------------------- ### Install MCP Server via Chat Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/mcp-agent.md Use this command to install an MCP server. The agent finds the repository, parses the README configuration, and opens an MCP install URI to initiate the installation via VS Code's handler. ```text User: "@mcp /install firecrawl" → Finds firecrawl repository → readmeExtractionRequest parses README configuration → openMcpInstallUri opens mcp://install/ URI → VS Code's MCP handler initiates installation ``` -------------------------------- ### Install All Dependencies Source: https://github.com/vikashloomba/copilot-mcp/blob/main/CLAUDE.md Installs dependencies for both the extension and the web UI. Run from the root directory. ```bash npm run install:all ``` -------------------------------- ### Example Usage of addSkillsFromSource Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/skills-client.md Demonstrates how to use the addSkillsFromSource function to install specific skills for given agents and logs the installation results. ```typescript const result = await addSkillsFromSource('anthropics/mcp-skills', { skillNames: ['database', 'web'], agents: ['claude-code', 'cline'], global: false, cwd: process.cwd() }); console.log(`Installed: ${result.installed.length}`); console.log(`Failed: ${result.failed.length}`); ``` -------------------------------- ### Start Web UI Development Server Source: https://github.com/vikashloomba/copilot-mcp/blob/main/CLAUDE.md Starts the development server for the web UI. Navigate to the /web directory before running. ```bash npm run start ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/README.md Install extension dependencies using `npm install`. For both extension and web UI dependencies, use `npm run install:all`. ```bash npm install # Extension deps ``` ```bash npm run install:all # + web UI deps ``` -------------------------------- ### Install Skills from Repository Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/README.md Demonstrates how to install specific skills from a given GitHub repository using the `addSkillsFromSource` function. It allows specifying skill names, agents, and installation scope (global or local). ```typescript import { addSkillsFromSource } from './skills-client'; const result = await addSkillsFromSource('owner/repo', { skillNames: ['skill1', 'skill2'], agents: ['claude-code', 'cline'], global: false }); // Returns: { installed, failed, source, ... } ``` -------------------------------- ### aiAssistedSetupType Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/extension-panel.md Initiates AI-powered MCP server installation with automatic configuration extraction. This handler streamlines the setup process by leveraging AI to extract configuration details from a repository. ```APIDOC ## aiAssistedSetupType ### Description Initiates AI-powered MCP server installation with automatic configuration extraction. ### Method messenger.onRequest ### Parameters #### Request Payload - **repo** (object) - Required - Repository object containing details like fullName, url, readme, etc. - **cloudMcpDetails** (object) - Optional - CloudMCP configuration details if available. ### Response - **boolean** - true if setup succeeded ``` -------------------------------- ### Install Command Detection Patterns Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/repo-search-and-git.md Lists the patterns searched for within README files to detect the presence of common installation commands. ```text - "command": "npx" - "command": "uvx" - "command": "pip" - "command": "docker" - "command": "pipx" ``` -------------------------------- ### Install Skills Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/extension-panel.md Handles requests to install selected skills for specified agents. It requires the source, skill names, agents, and installation scope. ```typescript messenger.onRequest(skillsInstallType, async (payload) => { return addSkillsFromSource({ source: payload.source, skillNames: payload.selectedSkillNames, agents: payload.selectedAgents, global: payload.installScope === 'global', }); }) ``` -------------------------------- ### Install Skill for Agent Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/skills-and-installer.md Asynchronously installs a skill for a specific agent. Supports options for global installation and current working directory. Logs success and potential symlink fallback. ```typescript const result = await installSkillForAgent( '/path/to/skill/source', 'database-helper', 'claude-code', { global: false, cwd: process.cwd() } ); if (result.success) { console.log(`Installed to: ${result.path}`); if (result.symlinkFailed) { console.log('Note: Copied instead of symlinked (symlink unavailable)'); } } ``` -------------------------------- ### VS Code Settings Example Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/README.md Example configuration for Copilot MCP within VS Code settings. Adjust 'logLevel' for verbosity and 'telemetryLevel' for data collection. ```json { "copilotMcp.logLevel": "info", "telemetry.telemetryLevel": "all" } ``` -------------------------------- ### CliInstallRequest Interface Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/types.md Represents a complete installation request for the CLI, extending InstallCommandPayload with transport and mode specifics. Use this for full client-side installation requests. ```typescript interface CliInstallRequest extends InstallCommandPayload { transport: InstallTransport; mode: InstallMode; } ``` -------------------------------- ### TypeScript Interface for Skill Installation Records Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/README.md Defines the structure for installation records returned by skill installation processes. Includes fields for success status, path, and error details. ```typescript interface InstallRecordDto { skillName: string; agent: AgentType; success: boolean; path: string; error?: string; // Reason for failure symlinkFailed?: boolean; // Fell back to copy } ``` -------------------------------- ### Open MCP Install URI Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/mcp-agent.md Opens the MCP server installation URI, handling configuration extraction from the README and supporting various transport types like stdio, HTTP, and SSE. Use this function to initiate the installation process for an MCP server. ```typescript export async function openMcpInstallUri(options: { command: string; args: string[]; env?: Record; url?: string; headers?: Array<{ name: string; value: string }>; name: string; type?: "http" | "sse"; }): Promise ``` -------------------------------- ### SkillsInstallRequest and SkillsInstallResponse Interfaces Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/types.md Defines the request and response structures for installing skills. Use SkillsInstallRequest to initiate a skill installation and SkillsInstallResponse to check the outcome. ```typescript interface SkillsInstallRequest { searchItem: SkillsSearchItemDto; source: string; selectedSkillNames: string[]; installScope: SkillsInstallScope; installAllAgents: boolean; selectedAgents: AgentType[]; } interface SkillsInstallResponse { source: string; selectedSkills: string[]; targetAgents: AgentType[]; installed: InstallRecordDto[]; failed: InstallRecordDto[]; } interface InstallRecordDto { skillName: string; agent: AgentType; success: boolean; path: string; canonicalPath?: string; mode: "symlink" | "copy"; symlinkFailed?: boolean; error?: string; } type SkillsInstallScope = "project" | "global"; ``` -------------------------------- ### MCP Server Configuration Example Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/README.md An example of MCP server configuration, specifying command, arguments, environment variables, and server endpoint. This configuration can be placed in `.vscode/mcp.json` or `mcp.json`. ```json { "command": "npx", "args": ["-y", "@server-name"], "env": { "API_KEY": "value" }, "type": "http", "url": "http://localhost:8000" } ``` -------------------------------- ### InstallRecord Interface Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/skills-client.md Defines the structure for recording individual skill installation outcomes. ```typescript interface InstallRecord { skillName: string; agent: AgentType; success: boolean; path: string; canonicalPath?: string; mode: InstallMode; symlinkFailed?: boolean; error?: string; } ``` -------------------------------- ### Stdio Command Server Configuration Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/configuration.md Example configuration for a server that runs as a command-line process. Use this when the server is an executable on your system. ```json { "command": "npx", "args": ["@anthropic/mcp-server-github"], "env": { "GITHUB_TOKEN": "ghp_..." } } ``` -------------------------------- ### InstalledSkillDto and SkillsListInstalledResponse Interfaces Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/types.md Represents an installed skill and the response for listing all installed skills. Use these to view details about skills currently installed in the system. ```typescript interface InstalledSkillDto { name: string; description: string; path: string; canonicalPath: string; scope: SkillsInstallScope; agents: AgentType[]; uninstallPolicy: "agent-select" | "all-agents"; uninstallPolicyReason?: string; } interface SkillsListInstalledResponse { skills: InstalledSkillDto[]; } ``` -------------------------------- ### Install Skill for Agent Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/skills-and-installer.md Installs a skill for a specified agent, preferring symlinks but falling back to copying if symlinks fail. It handles existing installations and provides detailed results. ```typescript export async function installSkillForAgent( skillDir: string, skillName: string, agent: AgentType, options?: { global?: boolean; cwd?: string; mode?: InstallMode; } ): Promise ``` ```typescript interface InstallResult { success: boolean; path: string; // Installation path canonicalPath?: string; // Canonical path if symlink mode: InstallMode; symlinkFailed?: boolean; // true if symlink attempted but failed error?: string; } ``` -------------------------------- ### List Installed Skills for Agent Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/skills-and-installer.md Retrieves a list of all skills currently installed for a given agent, including global and project-specific installations. ```typescript export async function listInstalledSkills( agent: AgentType, options?: { global?: boolean; cwd?: string; } ): Promise ``` -------------------------------- ### listInstalledSkills Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/skills-and-installer.md Lists all skills that are currently installed for a given agent, returning an array of installed skill metadata. ```APIDOC ## listInstalledSkills ### Description Lists skills installed for an agent. ### Signature ```typescript export async function listInstalledSkills( agent: AgentType, options?: { global?: boolean; cwd?: string; } ): Promise ``` ### Parameters #### Path Parameters - **agent** (AgentType) - Required - Target agent - **options.global** (boolean) - Optional - Use global or project location - **options.cwd** (string) - Optional - Project working directory ### Returns - **Promise** - array of installed skills with metadata ``` -------------------------------- ### installSkillForAgent Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/skills-and-installer.md Installs a skill for a specific agent, either by creating a symbolic link or by copying the skill files. It handles cleaning up existing installations and provides detailed results, including fallback mechanisms for symlink failures. ```APIDOC ## installSkillForAgent ### Description Installs a skill for a specific agent via symlink or copy. ### Signature ```typescript export async function installSkillForAgent( skillDir: string, skillName: string, agent: AgentType, options?: { global?: boolean; cwd?: string; mode?: InstallMode; } ): Promise ``` ### Parameters #### Path Parameters - **skillDir** (string) - Required - Source directory path containing SKILL.md - **skillName** (string) - Required - Skill name for the install directory - **agent** (AgentType) - Required - Target agent (e.g., "claude-code", "cline") - **options.global** (boolean) - Optional - Install to global or project location (default: `false`) - **options.cwd** (string) - Optional - Project working directory - **options.mode** (InstallMode) - Optional - Install method: "symlink" or "copy" (default: `"symlink"`) ### Returns - **Promise** ### InstallResult Interface ```typescript interface InstallResult { success: boolean; path: string; // Installation path canonicalPath?: string; // Canonical path if symlink mode: InstallMode; symlinkFailed?: boolean; // true if symlink attempted but failed error?: string; } ``` ### Behavior 1. Determines target directory based on agent config and options 2. Cleans existing installation (removes old files) 3. Attempts to create symlink (preferred on all platforms) 4. Falls back to copy if symlink fails (Windows without admin, etc.) 5. Handles symlink parent directories being symlinks themselves 6. Returns detailed result with fallback mode indication ### Symlink Fallback Logic - Attempts symlink creation on all platforms - If symlink fails, automatically copies instead (not an error) - Sets `symlinkFailed: true` in result to indicate copy was used - Allows installation to proceed on restrictive environments ### Cross-platform Handles Windows/Unix path separators and symlink policies ``` -------------------------------- ### Git Clone Command Examples Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/repo-search-and-git.md Illustrates the command-line syntax for cloning a Git repository with or without specifying a reference (branch or tag). ```bash git clone --depth 1 {url} {tempDir} ``` ```bash git clone --depth 1 --branch {ref} {url} {tempDir} ``` -------------------------------- ### skillsInstallType Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/extension-panel.md Installs selected skills for specified agents. This handler facilitates the process of adding skills to agent profiles, with options for global or agent-specific installation. ```APIDOC ## skillsInstallType ### Description Installs selected skills for specified agents. ### Method messenger.onRequest ### Parameters #### Request Payload - **source** (string) - Required - The source of the skills to install. - **selectedSkillNames** (string[]) - Required - An array of skill names to install. - **selectedAgents** (string[]) - Required - An array of agent identifiers to install skills for. - **installScope** (string) - Required - The scope of installation, either 'global' or agent-specific. ### Response Type SkillsInstallResponse ``` -------------------------------- ### showUpdatesToUser Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/extension.md Displays WHATS_NEW.md on first install or upgrade, attempting multiple render paths. Records impression in telemetry if successful. ```APIDOC ## showUpdatesToUser ### Description Displays WHATS_NEW.md on first install or upgrade, attempting multiple render paths (Markdown preview, text document, web link). This function manages version checking, content staging, rendering attempts, and telemetry reporting. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Method Signature ```typescript async function showUpdatesToUser(context: vscode.ExtensionContext): Promise ``` ### Parameters - **context** (`vscode.ExtensionContext`) - Required - Extension context for storage of shown version ### Behavior 1. Retrieves current and previously-shown extension versions 2. Skips if the version has already been shown 3. Attempts to stage remote WHATS_NEW.md (falls back to bundled copy on timeout/error) 4. Tries rendering in order: Markdown preview → text document → web URL 5. Records impression in telemetry only if at least one render path succeeds 6. Updates global state so the same version is not shown again ### Storage Key `copilotMcp.whatsNewVersionShown` ``` -------------------------------- ### Define Install Command Payload Types Source: https://github.com/vikashloomba/copilot-mcp/blob/main/REGISTRY_INSTALL_IMPLEMENTATION_PLAN.md Defines the interfaces for the input and command payload used in registry installations. These types ensure consistency and type safety for installation data. ```typescript interface InstallInput { type: 'promptString'; id: string; description?: string; password?: boolean; } interface InstallCommandPayload { name: string; command?: string; args?: string[]; env?: Record; url?: string; headers?: Array<{ name: string; value: string }>; inputs?: InstallInput[]; } ``` -------------------------------- ### InstallTransport and InstallMode Types Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/types.md Defines the possible values for installation transport methods (stdio, http, sse) and installation modes (package, remote). These types specify the delivery and installation strategies. ```typescript type InstallTransport = "stdio" | "http" | "sse"; type InstallMode = "package" | "remote"; ``` -------------------------------- ### InstallInput Type Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/mcp-agent.md Defines the structure for input prompts within an installation command. It supports string prompts, including options for password fields and descriptions. ```typescript type InstallInput = { type: "promptString"; id: string; description?: string; password?: boolean; }; ``` -------------------------------- ### Install All Skills from a Source Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/skills-client.md Installs all skills from a specified GitHub repository for the 'claude-code' agent, making them globally available. Requires the `addSkillsFromSource` function. ```typescript const result = await addSkillsFromSource( 'https://github.com/anthropics/mcp-skills', { agents: ['claude-code'], global: true } ); console.log(`Installed: ${result.installed.length}`); ``` -------------------------------- ### GitCloneError: Timeout Message Example Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/repo-search-and-git.md Example error message for a cloning timeout, with guidance on checking authentication and SSH keys. ```text Clone timed out after 60s. This often happens with private repos that require authentication. Ensure you have access and your SSH keys or credentials are configured: - For SSH: ssh-add -l (to check loaded keys) - For HTTPS: gh auth status (if using GitHub CLI) ``` -------------------------------- ### AddSkillsOptions Interface Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/skills-client.md Defines configuration options for adding (installing) skills. Allows specifying skill names, agents, installation mode, and directory context. ```typescript interface AddSkillsOptions { skillNames?: string[]; agents?: AgentType[] | ['*']; global?: boolean; mode?: InstallMode; fullDepth?: boolean; cwd?: string; includeInternal?: boolean; } ``` -------------------------------- ### Install Specific Skills with Error Handling Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/skills-client.md Installs a specified list of skills for multiple agents using the 'copy' mode, with detailed error handling for authentication and timeouts. Requires the `addSkillsFromSource` function. ```typescript try { const result = await addSkillsFromSource('owner/repo', { skillNames: ['skill1', 'skill2'], agents: ['claude-code', 'cline'], mode: 'copy' }); if (result.failed.length > 0) { console.warn('Some installations failed:', result.failed); } } catch (error) { if (error.isAuthError) { console.error('Authentication required'); } else if (error.isTimeout) { console.error('Clone operation timed out'); } } ``` -------------------------------- ### Development Mode Watch Source: https://github.com/vikashloomba/copilot-mcp/blob/main/CLAUDE.md Starts the development server in watch mode to observe changes. Run from the root directory. ```bash npm run watch ``` -------------------------------- ### Extract MCP Install Config from README Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/mcp-agent.md Use this function to parse a GitHub README file and extract structured server installation configuration. It identifies commands, arguments, environment variables, transport types, and user input prompts. ```typescript export async function readmeExtractionRequest(readme: string): Promise ``` ```typescript { name: string; // Server name command?: string; // e.g., "npx", "uvx", "pip" args?: string[]; // Command arguments env?: Record; // Environment variables url?: string; // Remote endpoint URL (if HTTP/SSE) type?: "http" | "sse"; // Transport type headers?: Array<{name: string; value: string}>; // HTTP headers inputs?: InstallInput[]; // User input prompts } ``` -------------------------------- ### CopilotMcpViewProvider Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/extension-panel.md Manages the webview sidebar panel for MCP server discovery, installation, and skill management. It handles both the main panel and launcher panel. ```APIDOC ## Class CopilotMcpViewProvider Implements `vscode.WebviewViewProvider` for managing webview communication and RPC handlers. ### Static View Type Constants: - `viewType` (string): "copilotMcpView" - Main sidebar panel ID - `launcherViewType` (string): "copilotMcpLauncherView" - Activity bar launcher panel ID ### Constructor ```typescript constructor(extensionUri: vscode.Uri) ``` #### Parameters - **extensionUri** (`vscode.Uri`) - Required - Extension root directory URI --- ``` -------------------------------- ### addSkillsFromSource Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/skills-client.md Installs selected skills from a source for specified agents. It discovers skills, filters them, auto-detects agents if necessary, and installs each skill-agent combination sequentially, collecting success and failure records. ```APIDOC ## addSkillsFromSource ### Description Installs selected skills from a source for specified agents. It discovers skills, filters them, auto-detects agents if necessary, and installs each skill-agent combination sequentially, collecting success and failure records. ### Method `async` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **source** (`string`) - Required - Source (URL, path, shorthand) - **options.skillNames** (`string[]`) - Optional - Specific skills to install (empty = all) - **options.agents** (`AgentType[]` or `['*']`) - Optional - Target agents (Auto-detect if not provided) - **options.global** (`boolean`) - Optional - Install globally or project-level (Default: `false`) - **options.mode** (`InstallMode`) - Optional - Installation method (Default: `'symlink'`) - **options.fullDepth** (`boolean`) - Optional - Discover all subdirectories (Default: `false`) - **options.cwd** (`string`) - Optional - Project working directory - **options.includeInternal** (`boolean`) - Optional - Include internal skills (Default: `false`) ### Returns ```typescript interface AddSkillsResult { source: string; selectedSkills: string[]; targetAgents: AgentType[]; installed: InstallRecord[]; failed: InstallRecord[]; } ``` ### Example ```typescript const result = await addSkillsFromSource('anthropics/mcp-skills', { skillNames: ['database', 'web'], agents: ['claude-code', 'cline'], global: false, cwd: process.cwd() }); console.log(`Installed: ${result.installed.length}`); console.log(`Failed: ${result.failed.length}`); ``` ``` -------------------------------- ### Parse Valid Owner/Repo String Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/utilities-and-helpers.md Example of successfully parsing a valid owner/repo string. ```typescript parseOwnerRepo('anthropic/mcp-servers') // → { owner: 'anthropic', repo: 'mcp-servers' } ``` -------------------------------- ### readmeExtractionRequest Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/mcp-agent.md Extracts MCP server installation configuration from a GitHub README using an AI agent. It parses the README content to identify and structure installation commands, environment variables, and other necessary configuration details. ```APIDOC ## readmeExtractionRequest ### Description Extracts MCP server installation configuration from a GitHub README using an AI agent. It parses the README content to identify and structure installation commands, environment variables, and other necessary configuration details. ### Method ```typescript export async function readmeExtractionRequest(readme: string): Promise ``` ### Parameters #### Path Parameters - **readme** (string) - Yes - Full README.md content from GitHub repository ### Response #### Success Response - **InstallCommandPayload** — structured installation configuration ### Request Example ```json { "readme": "Full README.md content..." } ``` ### Response Example ```json { "name": "string", "command": "string", "args": [ "string" ], "env": { "key": "string" }, "url": "string", "type": "http" | "sse", "headers": [ { "name": "string", "value": "string" } ], "inputs": [ { "name": "string", "type": "string" } ] } ``` ``` -------------------------------- ### InstallMode Type Definition Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/skills-and-installer.md Defines the possible modes for installing a skill. Use 'symlink' to link directly to the source or 'copy' to duplicate skill files. ```typescript type InstallMode = 'symlink' | 'copy'; ``` -------------------------------- ### Docker Server Configuration Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/configuration.md Example configuration for running a server within a Docker container. This is useful for isolated and reproducible server environments. ```json { "command": "docker", "args": ["run", "--rm", "my-mcp-image"] } ``` -------------------------------- ### InstallCommandPayload Interface Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/mcp-agent.md Defines the structure for a payload used in installation commands. It includes details such as the command name, arguments, environment variables, and headers. ```typescript interface InstallCommandPayload { name: string; command?: string; args?: string[]; env?: Record; url?: string; type?: "http" | "sse"; headers?: Array<{ name: string; value: string }>; inputs?: InstallInput[]; } ``` -------------------------------- ### getMcpConfigType Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/extension-panel.md Retrieves installed MCP servers from various configuration sources. ```APIDOC ## getMcpConfigType ### Description Retrieves installed MCP servers from all sources (global settings, user mcp.json, workspace settings, .vscode/mcp.json). Later sources override earlier ones. ### Method RPC Request Handler ### Endpoint messenger.onRequest(getMcpConfigType, ...) ### Parameters #### Request Payload None ### Response #### Success Response - **servers** (Record; url?: string; type?: "stdio" | "http" | "sse"; _source: "user" | "workspace"; _configSource: "user_settings" | "user_mcp_json" | "workspace_settings" | "workspace_mcp_json"; _readonly?: boolean; [key: string]: any; }>) - An object where keys are server names and values are their configurations. ### Response Example ```json { "servers": { "my-server": { "command": "node", "args": ["index.js"], "env": { "PORT": "8080" }, "url": "http://localhost:8080", "type": "http", "_source": "workspace", "_configSource": "workspace_settings" } } } ``` ``` -------------------------------- ### Handle Get MCP Config Request Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/extension-panel.md Retrieves all installed MCP servers from various configuration sources. This handler does not require any payload. ```typescript messenger.onRequest(getMcpConfigType, async () => { return { servers: await getAllServers() }; }) ``` -------------------------------- ### Build All Extension and Web UI Source: https://github.com/vikashloomba/copilot-mcp/blob/main/CLAUDE.md Builds both the extension and the web UI. Run from the root directory. ```bash npm run build:all ``` -------------------------------- ### HTTP Remote Server Configuration Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/configuration.md Example configuration for a server accessible via HTTP. Use this for remote servers that communicate over standard HTTP requests. ```json { "url": "http://localhost:8000/mcp", "type": "http", "headers": [ { "name": "Authorization", "value": "Bearer token" } ] } ``` -------------------------------- ### SSE Remote Server Configuration Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/configuration.md Example configuration for a server using Server-Sent Events (SSE) for communication. Use this for real-time updates from a remote endpoint. ```json { "url": "https://api.example.com/mcp", "type": "sse" } ``` -------------------------------- ### Get Installed Skill Uninstall Policy Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/extension-panel.md Determines whether skill uninstall requires all agents or per-agent selection based on the provided scope and agents. Includes an optional reason for the policy. ```typescript function getInstalledSkillUninstallPolicy( scope: SkillsInstallScope, agents: AgentType[], workspaceCwd?: string ): { uninstallPolicy: "agent-select" | "all-agents"; uninstallPolicyReason?: string } ``` -------------------------------- ### Build Web UI for Production Source: https://github.com/vikashloomba/copilot-mcp/blob/main/CLAUDE.md Builds the web UI for production deployment. Navigate to the /web directory before running. ```bash npm run build ``` -------------------------------- ### Deploy Extension Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/README.md Publish the extension to the marketplace using `npm run deploy`. This command requires a marketplace token. First, package the extension using `npm run package-extension` to create the `.vsix` file. ```bash npm run package-extension # Creates .vsix file ``` ```bash npm run deploy # Publish to marketplace (requires token) ``` -------------------------------- ### OutputLogger Usage Example Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/utilities-and-helpers.md Demonstrates how to use the singleton outputLogger to log messages at different levels and to show the output channel. Ensure the outputLogger is imported from './utilities/outputLogger'. ```typescript import { outputLogger } from './utilities/outputLogger'; outputLogger.debug('Detailed info', { userId: 123 }); outputLogger.info('Operation completed'); outputLogger.warn('Potential issue', new Error('Warning details')); outputLogger.error('Operation failed', new Error('Details')); outputLogger.show(); ``` -------------------------------- ### GitCloneError: Authentication Failure Message Example Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/repo-search-and-git.md Example error message for an authentication failure during cloning, with troubleshooting steps for SSH and HTTPS. ```text Authentication failed for {url}. - For private repos, ensure you have access - For SSH: Check your keys with 'ssh -T git@github.com' - For HTTPS: Run 'gh auth login' or configure git credentials ``` -------------------------------- ### Create VSIX Package Source: https://github.com/vikashloomba/copilot-mcp/blob/main/CLAUDE.md Creates a VSIX package for distribution of the extension. Run from the root directory. ```bash npm run package-extension ``` -------------------------------- ### GitCloneError: Generic Failure Message Example Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/repo-search-and-git.md Example error message for a generic cloning failure, including the URL and the specific error message. ```text Failed to clone {url}: {error message} ``` -------------------------------- ### Package Extension for Production Source: https://github.com/vikashloomba/copilot-mcp/blob/main/CLAUDE.md Packages the extension for production deployment. Run from the root directory. ```bash npm run package ``` -------------------------------- ### Run Tests Source: https://github.com/vikashloomba/copilot-mcp/blob/main/CLAUDE.md Executes the test suite for the project. Run from the root directory. ```bash npm run test ``` -------------------------------- ### AgentConfig Interface Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/types.md Configuration for a specific AI agent's skill installation. Defines agent name, display name, skill directories, and installation detection. ```typescript interface AgentConfig { name: string; displayName: string; skillsDir: string; globalSkillsDir: string | undefined; detectInstalled: () => Promise; showInUniversalList?: boolean; } ``` ```typescript { name: 'claude-code', displayName: 'Claude Code', skillsDir: '.claude/skills', globalSkillsDir: '/home/user/.claude/skills', detectInstalled: async () => existsSync('/home/user/.claude'), showInUniversalList: true } ``` -------------------------------- ### CopilotMcpViewProvider Constructor Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/extension-panel.md Initializes the CopilotMcpViewProvider with the extension's root URI. ```typescript constructor(extensionUri: vscode.Uri) ``` -------------------------------- ### Check if Internal Skills Should Be Installed Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/skills-and-installer.md Determines if internal skills should be installed based on environment variables. Returns true if the INSTALL_INTERNAL_SKILLS environment variable is set to '1' or 'true'. ```typescript export function shouldInstallInternalSkills(): boolean ``` -------------------------------- ### Development Build Commands Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/README.md Run `npm run watch` for continuous rebuilding. Use `npm run watch:esbuild` for extension-only rebuilding or `npm run watch:webview` for web UI rebuilding. ```bash npm run watch # Continuous rebuild ``` ```bash npm run watch:esbuild # Extension only ``` ```bash npm run watch:webview # Web UI only ``` -------------------------------- ### openMcpInstallUri Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/mcp-agent.md Opens a URI to install an MCP server, extracting configuration from its README. This function supports various transport types including stdio, HTTP, and SSE, and handles the process of opening the URI via the default system handler. ```APIDOC ## openMcpInstallUri ### Description Opens the MCP server installation URI with configuration extracted from the README. Handles stdio, HTTP, and SSE transport types. ### Method `async function` ### Parameters #### Parameters - **command** (string) - Required - Command to execute (e.g., "npx", "uvx", "pip") - **args** (string[]) - Required - Command arguments - **env** (Record) - Optional - Environment variables to set - **url** (string) - Optional - Remote HTTP/SSE endpoint URL - **headers** (Array<{name: string; value: string}>) - Optional - HTTP headers for remote installs - **name** (string) - Required - MCP server display name - **type** ("http" | "sse") - Optional - Transport type for remote servers (defaults to "http") ### Returns `Promise` — resolves when the URI is opened ### Behavior 1. Validates input and logs telemetry for install attempt 2. Converts the config to a native MCP install URI (`mcp://install/...`) 3. Opens the URI in the default handler via `vscode.env.openExternal` 4. Logs success or error telemetry ### Transport Types - **stdio:** Local command execution (npx, uvx, pip, pipx, docker) - **http:** Remote HTTP endpoint - **sse:** Remote Server-Sent Events endpoint ### Telemetry - `chat.install.uriOpened` — when URI is successfully opened - `error.chat.install` — on failure ### Source `src/McpAgent.ts` ``` -------------------------------- ### Uninstall Skill for Agent Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/skills-and-installer.md Removes a specific skill from an agent's installation directory, whether it's a global or project-local installation. The function handles cases where the skill might not exist. ```typescript export async function uninstallSkillForAgent( skillName: string, agent: AgentType, options?: { global?: boolean; cwd?: string; } ): Promise ``` -------------------------------- ### Construct ShellExecution for Claude MCP Install Source: https://github.com/vikashloomba/copilot-mcp/blob/main/REGISTRY_INSTALL_IMPLEMENTATION_PLAN.md Constructs a ShellExecution object for installing the Claude MCP using the command line. This is used when invoking the CLI via VS Code's task API. ```typescript new vscode.ShellExecution(claudeBinary, ['mcp', 'add-json', payload.name, configJson]) ``` -------------------------------- ### GitHub Search Query Structure Example Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/repo-search-and-git.md Illustrates the structure of a GitHub search query used internally to find MCP servers, combining general search terms with specific filters. ```text "mcp" in:name,description,topics "{query}" in:name,description language:typescript/python ``` -------------------------------- ### Get All Servers Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/extension-panel.md Consolidates servers from all sources with proper precedence and metadata labeling. Merge order is global settings, user mcp.json, workspace settings, and .vscode/mcp.json files. ```typescript async function getAllServers(): Promise> ``` -------------------------------- ### tryStageRemoteWhatsNew Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/extension.md Fetches the latest WHATS_NEW.md from the GitHub repository and stages it for display in VS Code. Returns the URI to the staged file or undefined on failure. ```APIDOC ## tryStageRemoteWhatsNew ### Description Fetches the latest WHATS_NEW.md from the GitHub repository and stages it for display in VS Code. This function handles fetching, validation, path rewriting, and writing to global storage. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Method Signature ```typescript async function tryStageRemoteWhatsNew(context: vscode.ExtensionContext): Promise ``` ### Parameters - **context** (`vscode.ExtensionContext`) - Required - Extension context for global storage access ### Returns - **Promise** - URI to the staged file, or undefined on any failure ### Behavior 1. Fetches from `https://raw.githubusercontent.com/VikashLoomba/copilot-mcp/main/WHATS_NEW.md` with a 3-second timeout 2. Validates the response (must be 200 status, start with `#`, and have length between 200 and 1MB) 3. Rewrites relative image/link paths to absolute raw GitHub URLs for security 4. Writes the file to extension global storage 5. Returns the staged URI or undefined on any failure ### Error Handling Never throws; all errors result in returning undefined for fallback to bundled copy ``` -------------------------------- ### Extension Activation Entry Point Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/README.md The main entry point for the extension, called when VS Code starts or the extension is first used. It initializes various services including logging, authentication, language models, and UI components. ```typescript export async function activate(context: vscode.ExtensionContext) ``` -------------------------------- ### handler Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/mcp-agent.md The main request handler for the `@mcp` chat participant. It processes user commands for searching and installing MCP servers, analyzes user intent, and delegates to appropriate internal agents. It also tracks telemetry for search and install operations. ```APIDOC ## handler ### Description Main request handler for the `@mcp` chat participant. Processes search and install commands from the user. ### Type vscode.ChatRequestHandler ### Behavior Analyzes the user's intent and delegates to appropriate agents: - **Search intent:** Generates optimized search queries and retrieves repositories using `searchMcpServers2` - **Install intent:** Extracts MCP server configuration from README and initiates installation via `openMcpInstallUri` - **Unknown intent:** Logs intent mismatch and returns helpful guidance ### Telemetry tracked - `chat.search.start` / `chat.search.success` / `chat.search.error` — search operations - `chat.install.start` / `chat.install.success` / `chat.install.error` — install operations - `chat.unknownIntent` — intent classification failures ### Source `src/McpAgent.ts` ``` -------------------------------- ### Display WHATS_NEW.md Updates to User Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/extension.md Shows WHATS_NEW.md on first install or upgrade, attempting multiple rendering methods. Skips if already shown and records telemetry on successful display. Stores the shown version to prevent repeated displays. ```typescript async function showUpdatesToUser(context: vscode.ExtensionContext): Promise ``` -------------------------------- ### Parse Direct URL Source Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/utilities-and-helpers.md Example of parsing a direct URL source identifier. ```typescript parseSource('https://docs.example.com/docs/skill.md') // → { type: 'direct-url', url: 'https://docs.example.com/docs/skill.md' } ``` -------------------------------- ### Parse GitHub Shorthand Source Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/utilities-and-helpers.md Example of parsing a GitHub shorthand source identifier. ```typescript parseSource('owner/repo') // → { type: 'github', url: 'owner/repo' } ``` -------------------------------- ### Parse Local Path Source Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/utilities-and-helpers.md Example of parsing a local relative path source identifier. ```typescript parseSource('./local/skills') // → { type: 'local', localPath: '/home/user/local/skills', url: '/home/user/local/skills' } ``` -------------------------------- ### checkCloudMcpType Source: https://github.com/vikashloomba/copilot-mcp/blob/main/_autodocs/api-reference/extension-panel.md Checks if a repository is available on CloudMCP and retrieves install configuration. This function is invoked via messenger.onRequest. ```APIDOC ## checkCloudMcpType ### Description Checks if a repository is available on CloudMCP and retrieves install configuration. ### Method messenger.onRequest ### Parameters #### Request Payload - **repoUrl** (string) - Required - GitHub repository URL - **repoName** (string) - Required - Repository name - **repoFullName** (string) - Optional - Full name (owner/repo) - **owner** (string) - Required - Repository owner ### Response Type CloudMcpCheckResult ### Response Example ```json { "success": true, "exists": true, "installConfig": { "name": "install", "command": "install", "args": [], "env": {}, "inputs": [] }, "error": null } ``` ```