Skip to main content
Glama
ceorkm

ReactBits MCP Server

by ceorkm

search_components

Find ReactBits components by name or description using search queries and category filters to locate animated React components for development projects.

Instructions

Search for ReactBits components by name or description

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query
categoryNoFilter by category
limitNoMaximum number of results

Implementation Reference

  • Main handler function that performs the component search by filtering the component registry based on the query string, category, and limit.
    async searchComponents(options: { query: string; category?: string; limit?: number; }): Promise<ReactBitsComponent[]> { const query = options.query?.toLowerCase() || ''; let components = await this.listComponents({ category: options.category }); // Filter by search query components = components.filter(comp => comp.name.toLowerCase().includes(query) || comp.slug.toLowerCase().includes(query) || comp.description?.toLowerCase().includes(query) || comp.category.toLowerCase().includes(query) ); // Apply limit if (options.limit && options.limit > 0) { components = components.slice(0, options.limit); } return components; }
  • MCP server tool call handler for 'search_components' that validates input and delegates to ReactBitsService.
    case 'search_components': { const searchOptions: ComponentSearchOptions = { query: args?.query as string, category: args?.category as string, limit: args?.limit as number, }; if (!searchOptions.query) { throw new Error('Search query is required'); } const results = await reactBitsService.searchComponents(searchOptions); return { content: [ { type: 'text', text: JSON.stringify(results, null, 2), }, ], }; }
  • src/index.ts:69-90 (registration)
    Tool registration in the MCP tools list, defining name, description, and input schema.
    { name: 'search_components', description: 'Search for ReactBits components by name or description', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query', }, category: { type: 'string', description: 'Filter by category', }, limit: { type: 'number', description: 'Maximum number of results', }, }, required: ['query'], }, },
  • TypeScript interface defining the input options for the search_components tool.
    export interface ComponentSearchOptions { query: string; category?: string; style?: ComponentStyle; limit?: number; }

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/ceorkm/reactbits-mcp-server'

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