Skip to main content
Glama
burkeholland

VS Code MCP Button Generator

by burkeholland

copilot_buttons_from_github

Create VS Code install buttons for GitHub files by specifying owner, repository, and file path. Generates markdown badges for MCP server installation.

Instructions

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

Input Schema

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

Implementation Reference

  • src/index.ts:166-183 (registration)
    Registers the MCP tool 'copilot_buttons_from_github' with Zod input schema and a handler that delegates to the helper function.
    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 }] };
      }
    );
  • The core handler logic: constructs the raw GitHub URL for the file and generates the Copilot-style install buttons markdown.
    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);
    }
  • Zod input schema definition for the tool parameters.
    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"),
    }
  • Helper function to build the raw GitHub file URL from repo details.
    export function buildRawGithubUrl(owner: string, repo: string, branch: string, path: string): string {
      return `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${path}`;
    }

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