Skip to main content
Glama
burkeholland

VS Code MCP Button Generator

by burkeholland

copilot_buttons_from_github

Generate VS Code install buttons for GitHub files by specifying owner, repo, path, and optional branch, simplifying code sharing and collaboration.

Instructions

Generate VS Code install buttons for a GitHub file using owner/repo/path and optional branch.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branchNomain
kindYesInstall kind
ownerYes
pathYesPath within the repo
repoYes

Implementation Reference

  • Core tool handler implementation: constructs the raw GitHub URL from repo details and generates the Copilot install buttons markdown using the helper function.
    export function generateCopilotInstallButtonsFromGithub(kind: CopilotInstallKind, owner: string, repo: string, path: string, branch = 'main'): string { const raw = buildRawGithubUrl(owner, repo, branch, path); return generateCopilotInstallButtons(kind, raw); }
  • Input schema definition for the tool using Zod validators for parameters: kind, owner, repo, path, branch.
    inputSchema: { kind: z.enum(["chat-instructions", "chat-prompt", "chat-mode"]).describe("Install kind"), owner: z.string(), repo: z.string(), path: z.string().describe("Path within the repo"), branch: z.string().default("main"), }
  • src/index.ts:166-183 (registration)
    Registration of the 'copilot_buttons_from_github' MCP tool, including title, description, input schema, and thin handler that delegates to the core implementation.
    server.registerTool( "copilot_buttons_from_github", { title: "Copilot install buttons (GitHub)", description: "Generate VS Code install buttons for a GitHub file using owner/repo/path and optional branch.", inputSchema: { kind: z.enum(["chat-instructions", "chat-prompt", "chat-mode"]).describe("Install kind"), owner: z.string(), repo: z.string(), path: z.string().describe("Path within the repo"), branch: z.string().default("main"), } }, async ({ kind, owner, repo, path, branch }) => { const markdown = generateCopilotInstallButtonsFromGithub(kind, owner, repo, path, branch ?? 'main'); return { content: [{ type: "text", text: markdown }] }; } );
  • Helper function to build the raw GitHub content URL from owner, repo, branch, and path.
    export function buildRawGithubUrl(owner: string, repo: string, branch: string, path: string): string { return `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${path}`; }
  • Helper function that generates the markdown for VS Code stable and insiders install buttons given the raw URL and kind.
    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}`; }

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