Skip to main content
Glama
burkeholland

VS Code MCP Button Generator

by burkeholland
buttons.test.ts2.2 kB
import { describe, test, expect } from '@jest/globals'; import { generateButtonsMarkdown, generateCopilotInstallButtons, generateCopilotInstallButtonsFromGithub } from '../lib/buttons.js'; const name = 'supabase'; const inputs = [ { type: 'promptString', id: 'supabase-access-token', description: 'Supabase personal access token', password: true } ]; const config = { command: 'npx', args: ['-y', '@supabase/mcp-server-supabase@latest', '--readonly', '--project-ref=$SUPABASE_MCP_PROJECT_REF'], env: { SUPABASE_ACCESS_TOKEN: '${input:supabase-access-token}', SUPABASE_MCP_PROJECT_REF: '${input:supabase-project-ref}' } }; describe('button generation', () => { test('generates MCP install buttons markdown', () => { const md = generateButtonsMarkdown(name, inputs, config); expect(md).toContain('https://insiders.vscode.dev/redirect/mcp/install'); expect(md).toContain('VS_Code-NPM-0098FF'); expect(md).toContain('VS_Code_Insiders-NPM-24bfa5'); expect(md).toContain(encodeURIComponent(JSON.stringify(inputs))); expect(md).toContain(encodeURIComponent(JSON.stringify(config))); }); test('generates Copilot-style install buttons from raw URL', () => { const rawUrl = 'https://raw.githubusercontent.com/github/awesome-copilot/main/instructions/markdown.instructions.md'; const copilotMd = generateCopilotInstallButtons('chat-instructions', rawUrl); expect(copilotMd).toContain('https://vscode.dev/redirect'); expect(copilotMd).toContain('vscode%3Achat-instructions%2Finstall%3Furl%3D'); expect(copilotMd).toContain(encodeURIComponent(rawUrl)); expect(copilotMd).toContain('VS_Code-Install-0098FF'); expect(copilotMd).toContain('VS_Code_Insiders-Install-24bfa5'); }); test('generates Copilot-style install buttons from GitHub path', () => { const ghMd = generateCopilotInstallButtonsFromGithub('chat-prompt', 'github', 'awesome-copilot', 'prompts/readme-blueprint-generator.prompt.md'); expect(ghMd).toContain('https://vscode.dev/redirect'); expect(ghMd).toContain(encodeURIComponent('https://raw.githubusercontent.com/github/awesome-copilot/main/prompts/readme-blueprint-generator.prompt.md')); }); });

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