Skip to main content
Glama
burkeholland

VS Code MCP Button Generator

by burkeholland

copilot_buttons_from_raw

Create VS Code install buttons for raw URLs to chat instructions, prompts, or modes. Simplify embedding and sharing custom configurations directly in VS Code.

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 'copilot_buttons_from_raw' MCP tool, including title, description, input schema, and inline handler function.
    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 }] }; } );
  • The handler function for the tool, which invokes generateCopilotInstallButtons to produce markdown and returns it as text content.
    async ({ kind, url }) => { const markdown = generateCopilotInstallButtons(kind, url); return { content: [{ type: "text", text: markdown }] }; }
  • Zod input schema defining 'kind' (enum) and 'url' (string URL) parameters.
    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."), }
  • Main helper function that generates the markdown for VS Code stable and insiders install buttons using badges and links.
    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 install link URL for Copilot-style buttons.
    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}`; }

Other Tools

Related Tools

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