Skip to main content
Glama
burkeholland

VS Code MCP Button Generator

by burkeholland

copilot_buttons_from_raw

Generate VS Code install buttons for raw URLs containing chat instructions, prompts, or modes to enable quick setup of MCP server configurations.

Instructions

Generate VS Code install buttons for a raw URL to chat instructions, prompts, or chat modes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindYesInstall kind
urlYesRaw GitHub URL or any public raw URL to the file.

Implementation Reference

  • src/index.ts:150-164 (registration)
    Registration of the MCP tool 'copilot_buttons_from_raw'. Includes title, description, input schema validating 'kind' (enum) and 'url' (string url), and handler that invokes generateCopilotInstallButtons to produce markdown content.
    server.registerTool(
      "copilot_buttons_from_raw",
      {
        title: "Copilot install buttons (raw URL)",
        description: "Generate VS Code install buttons for a raw URL to chat instructions, prompts, or chat modes.",
        inputSchema: {
          kind: z.enum(["chat-instructions", "chat-prompt", "chat-mode"]).describe("Install kind"),
          url: z.string().url().describe("Raw GitHub URL or any public raw URL to the file."),
        }
      },
      async ({ kind, url }) => {
        const markdown = generateCopilotInstallButtons(kind, url);
        return { content: [{ type: "text", text: markdown }] };
      }
    );
  • Main execution logic for the tool: generateCopilotInstallButtons constructs VS Code Stable and Insiders markdown install buttons (badges + links) for Copilot chat instructions/prompts/modes from the raw URL.
    export function generateCopilotInstallButtons(kind: CopilotInstallKind, rawUrl: string): string {
      const stableBadge = makeInstallBadge('0098FF', 'VS_Code');
      const insidersBadge = makeInstallBadge('24bfa5', 'VS_Code_Insiders');
      const stableLink = buildCopilotInstallLink(kind, rawUrl, false);
      const insidersLink = buildCopilotInstallLink(kind, rawUrl, true);
      const stable = `[![Install in VS Code](${stableBadge})](${stableLink})`;
      const insiders = `[![Install in VS Code](${insidersBadge})](${insidersLink})`;
      return `${stable}\n${insiders}`;
    }
  • Helper function to build the VS Code redirect install link with proper URL encoding for scheme, kind, and rawUrl.
    function buildCopilotInstallLink(kind: CopilotInstallKind, rawUrl: string, insiders = false) {
      const scheme = insiders ? 'vscode-insiders' : 'vscode';
      const host = insiders ? 'https://insiders.vscode.dev/redirect' : 'https://vscode.dev/redirect';
      // Encode the prefix and the raw URL separately so inner % are not double-encoded
      const prefix = encodeURIComponent(`${scheme}:${kind}/install?url=`);
      const raw = encodeURIComponent(rawUrl);
      return `${host}?url=${prefix}${raw}`;
    }
  • Helper function to generate the shield badge image URL for the install buttons.
    function makeInstallBadge(color: string, label: string) {
      // e.g., VS_Code-Install-0098FF
      return `https://img.shields.io/badge/${encodeURIComponent(label)}-Install-${color}?style=flat-square&logo=visualstudiocode&logoColor=white`;
    }
  • Zod input schema for the tool parameters: kind (enum of chat types) and url (validated URL).
    inputSchema: {
      kind: z.enum(["chat-instructions", "chat-prompt", "chat-mode"]).describe("Install kind"),
      url: z.string().url().describe("Raw GitHub URL or any public raw URL to the file."),
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/burkeholland/mcp-vsc-button-gen'

If you have feedback or need assistance with the MCP directory API, please join our Discord server