Skip to main content
Glama
heilgar

Shadcn UI MCP Server

by heilgar

install-component

Install Shadcn UI components using your preferred runtime (npm, pnpm, yarn, bun) by specifying the component name. Simplify UI management through natural language interactions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentYesName of the component to install
runtimeNoUser runtime (npm, pnpm, yarn, bun)

Implementation Reference

  • Main handler function for the 'install-component' tool. Validates component and runtime parameters, fetches component data using cached fetch, determines the installation command based on runtime (defaults to npm), and returns it.
    export const installComponent = async ({component, runtime}: {component: string, runtime?: string}) => {
        try {
            if (!component) {
                return createResponse("Component name is required", true);
            }
            
            if (runtime && !validateRuntime(runtime)) {
                return createResponse(`Invalid runtime: ${runtime}. Must be one of: npm, pnpm, yarn, bun`, true);
            }
            
            const componentData = await fetchAndCacheComponentData(component);
            
            if (!componentData.commands?.[0]) {
                return createResponse(`No installation command found for component '${component}'`, true);
            }
    
            const commands = componentData.commands[0];
            const selectedRuntime = runtime as PackageManager | undefined;
            const command = selectedRuntime ? commands[selectedRuntime] : commands.npm;
    
            if (!command) {
                return createResponse(`No installation command found for runtime '${runtime}'`, true);
            }
    
            return createResponse(command);
        } catch (error) {
            return handleError(error, "Error generating installation command");
        }
    }
  • Zod input schema for the 'install-component' tool defining component (required string) and runtime (optional string).
    toolSchema: {
        component: z.string().describe("Name of the component to install"),
        runtime: z.string().describe("User runtime (npm, pnpm, yarn, bun)").optional()
    },
  • src/index.ts:26-36 (registration)
    Tool definition object in toolDefinitions for 'install-component', including description, JSON Schema parameters, Zod toolSchema, and handler reference.
    "install-component": {
        description: "Install a shadcn/ui component",
        parameters: {
            component: { type: "string", description: "Name of the component to install" },
            runtime: { type: "string", description: "User runtime (npm, pnpm, yarn, bun)", optional: true }
        },
        toolSchema: {
            component: z.string().describe("Name of the component to install"),
            runtime: z.string().describe("User runtime (npm, pnpm, yarn, bun)").optional()
        },
        handler: installComponent   
  • src/index.ts:76-82 (registration)
    Registration loop that calls server.tool() for all tools defined in toolDefinitions, including 'install-component', passing name, schema, and handler.
    for (const [name, definition] of Object.entries(toolDefinitions)) {
        server.tool(
            name,
            definition.toolSchema,
            definition.handler
        );
    }
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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/heilgar/shadcn-ui-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server