Skip to main content
Glama
Jpisnice

@jpisnice/shadcn-ui-mcp-server

by Jpisnice

list_components

Retrieve all available shadcn/ui v4 components to understand their structure, usage, and installation for streamlined UI development.

Instructions

Get all available shadcn/ui v4 components

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that fetches available shadcn/ui v4 components using axios and returns a formatted JSON list.
    export async function handleListComponents() {
      try {
        const axios = await getAxiosImplementation();
        const components = await axios.getAvailableComponents();
        return {
          content: [{ 
            type: "text", 
            text: JSON.stringify({ 
              components: components.sort(),
              total: components.length 
            }, null, 2) 
          }]
        };
      } catch (error) {
        logError('Failed to list components', error);
        throw new Error(`Failed to list components: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • Registers the list_components tool by mapping it to the handleListComponents handler function.
    export const toolHandlers = {
      get_component: handleGetComponent,
      get_component_demo: handleGetComponentDemo,
      list_components: handleListComponents,
      get_component_metadata: handleGetComponentMetadata,
      get_directory_structure: handleGetDirectoryStructure,
      get_block: handleGetBlock,
      list_blocks: handleListBlocks
    };
  • Defines the tool schema including name, description, and empty inputSchema for list_components (no parameters needed).
    'list_components': {
      name: 'list_components',
      description: 'Get all available shadcn/ui v4 components',
      inputSchema: {
        type: 'object',
        properties: {}
      }
    },
  • Exports the input schema for the tool (empty object).
    export const schema = {}; 
  • MCP capabilities declaration including schema for list_components tool.
    list_components: {
      description: "Get all available shadcn/ui v4 components",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
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/Jpisnice/shadcn-ui-mcp-server'

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