Skip to main content
Glama

get_all_components

Retrieve all UI components from the Magic UI design system via MCP Magic UI, enabling clients and AI assistants to access and utilize available elements for integration and development.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The inline asynchronous handler function that implements the logic for the 'get_all_components' tool. It attempts to return raw registry data from GitHub, falling back to parsed components from ComponentParser if unavailable, formatted as JSON text content.
    async () => { // Get the raw content of registry.json const rawData = githubService.getRawRegistryData(); // If no data, return processed components as fallback if (!rawData || rawData.length === 0) { const components = componentParser.getAllComponents(); return { content: [{ type: "text", text: JSON.stringify(components, null, 2), }], }; } // Return the raw content of registry.json return { content: [{ type: "text", text: JSON.stringify(rawData, null, 2), }], }; }
  • src/server.ts:24-50 (registration)
    Registration of the 'get_all_components' tool using McpServer.tool(), with no input parameters (empty schema) and the inline handler function.
    server.tool( "get_all_components", {}, async () => { // Get the raw content of registry.json const rawData = githubService.getRawRegistryData(); // If no data, return processed components as fallback if (!rawData || rawData.length === 0) { const components = componentParser.getAllComponents(); return { content: [{ type: "text", text: JSON.stringify(components, null, 2), }], }; } // Return the raw content of registry.json return { content: [{ type: "text", text: JSON.stringify(rawData, null, 2), }], }; } );
  • Helper method in ComponentParser class that returns an array of all loaded components, used as a fallback data source in the tool handler.
    getAllComponents(): Component[] { return Array.from(this.components.values()); }

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/idcdev/mcp-magic-ui'

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