Skip to main content
Glama
burkeholland

VS Code MCP Button Generator

by burkeholland

from_mcp_config

Generate VS Code installation buttons and markdown badges by processing a raw MCP config object and server name, enabling quick setup and configuration for MCP servers.

Instructions

Generate install buttons from a raw MCP JSON-like config object and a server name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mcpNo
nameYesServer display name.

Implementation Reference

  • The handler function for the 'from_mcp_config' tool. It uses fromMcpConfigObject to parse the MCP config into inputs and config, then generates markdown buttons.
    async ({ name, mcp }) => { const { inputs, config } = fromMcpConfigObject(name, mcp ?? {}); const markdown = generateButtonsMarkdown(name, inputs, config); return { content: [{ type: "text", text: markdown }] }; }
  • Input schema for the 'from_mcp_config' tool: requires 'name' string and 'mcp' any object.
    inputSchema: { name: z.string().describe("Server display name."), mcp: z.any(), } },
  • src/index.ts:132-147 (registration)
    Registration of the 'from_mcp_config' tool using server.registerTool, including schema and handler.
    server.registerTool( "from_mcp_config", { title: "Buttons from MCP config", description: "Generate install buttons from a raw MCP JSON-like config object and a server name.", inputSchema: { name: z.string().describe("Server display name."), mcp: z.any(), } }, async ({ name, mcp }) => { const { inputs, config } = fromMcpConfigObject(name, mcp ?? {}); const markdown = generateButtonsMarkdown(name, inputs, config); return { content: [{ type: "text", text: markdown }] }; } );
  • Helper function fromMcpConfigObject that extracts inputs and config from the MCP config object provided to the tool.
    export function fromMcpConfigObject(name: string, configObj: any): { inputs: MCPInput[]; config: CommandConfig } { // Accepts a JSON like the example and converts env placeholders ${input:...} to VS Code expected rendering untouched. const inputs = Array.isArray(configObj.inputs) ? (configObj.inputs as MCPInput[]) : []; // For NPX-based servers, we expect the consumer to specify the npx invocation // Example: { command: 'npx', args: ['-y', '@scope/server@latest', '--flag'], env: { KEY: '${input:id}' } } // If not given, default to npx with no args const config: CommandConfig = configObj.config ?? { command: 'npx', args: [] }; return { inputs, config }; }

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