@jpisnice/shadcn-ui-mcp-server
Version:
A Model Context Protocol (MCP) server for shadcn/ui components, providing AI assistants with access to component source code, demos, blocks, and metadata.
24 lines (23 loc) • 745 B
JavaScript
import { axios } from '../../utils/axios.js';
import { logError } from '../../utils/logger.js';
export async function handleListBlocks({ category }) {
try {
const blocks = await axios.getAvailableBlocks(category);
return {
content: [{
type: "text",
text: JSON.stringify(blocks, null, 2)
}]
};
}
catch (error) {
logError('Failed to list blocks', error);
throw new Error(`Failed to list blocks: ${error instanceof Error ? error.message : String(error)}`);
}
}
export const schema = {
category: {
type: 'string',
description: 'Filter by category (calendar, dashboard, login, sidebar, products)'
}
};