MCP Server Starter Template

by revskill10

Not rated
GitHub

About

A starter template for building Model Context Protocol (MCP) servers, designed for UI libraries and component registries.

Details

Author
revskill10
Categories
Developer Tools

Setup

Install MCP Server Starter Template in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/revskill10/hello-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

A starter template for building Model Context Protocol (MCP) servers, designed for UI libraries and component registries.

A comprehensive starter template for buildingModel Context Protocol (MCP) servers, specifically designed for UI libraries and component registries. This template provides a robust foundation for creating MCP servers that can fetch, categorize, and provide component information to AI assistants like Claude.

Check out thestackzero-labs/mcpwhich uses this template to expose its UI components and blocks to AI models. You can also checkout the UI referenced projectstackzero/ui

- Ready-to-use MCP serverwith TypeScript support
- Component registry integrationfor UI libraries
- Categorized component organizationwith flexible category system
- Zod schema validationfor type safety
- Development toolsincluding hot reload and inspector
- Example implementationusing a real project URL for demonstration
- Extensible architecturefor custom component types and categories

- Node.js 18 or higher
- pnpm (recommended) or npm
- Basic understanding of TypeScript and MCP

This template is specifically designed for libraries following theregistryformat (likeshadcn/ui), making it ideal for:

- UI component libraries
- Design systems
- Component registries that need to be accessible via AI assistants
- Tools, utilities, and frameworks that require a structured way to expose UI components to AI models

Read more about components registries like shadcn/ui hereComponent Registries.

With some customizations however, it can be adapted for other types of MCP servers as well.

git clone https://github.com/mnove/mcp-starter.git cd mcp-starter

Editsrc/lib/config.tsto point to your own component registry:

export const mcpConfig = { projectName: "your-project-name", // Replace with your actual project URL baseUrl: "https://your-ui-library.com", registryUrl: "https://your-ui-library.com/r", registryFileUrl: "https://your-ui-library.com/registry.json", };

Note: This template currently useshttps://ui.stackzero.coas a demonstration URL. Youmustreplace this with your actual project URL for production use.

Customizesrc/lib/categories.tsto match your component structure:

export const componentCategories = { Buttons: ["button-primary", "button-secondary", "button-ghost"], Forms: ["input-text", "input-email", "textarea"], // Add your categories here };

Modifysrc/server.tsto customize your server information:

const server = new McpServer({ name: "your-mcp-server-name", version: "1.0.0", });

This opens the MCP Inspector to test your server tools interactively.

The MCP server provides the following tools:

Returns a comprehensive list of all UI components from your registry.

Dynamic tools are created for each category defined incomponentCategories:

- getButtons- Get all button components
- getForms- Get all form components
- etc.

- Component implementation details
- Usage examples
- Installation instructions
- Related components

mcp-starter/ ├── src/ │ ├── server.ts # Main MCP server implementation │ ├── lib/ │ │ ├── config.ts # Configuration settings │ │ └── categories.ts # Component categories │ └── utils/ │ ├── api.ts # API fetching utilities │ ├── formatters.ts # Data formatting helpers │ ├── schemas.ts # Zod validation schemas │ └── index.ts # Utility exports ├── dist/ # Built files ├── package.json └── README.md

- Update schemasinsrc/utils/schemas.ts:

export const CustomComponentSchema = z.object({ name: z.string(), category: z.string(), // Add your fields });
export async function fetchCustomComponents() { // Your implementation }
server.tool("getCustomComponents" /.../);

Simply add new categories tosrc/lib/categories.ts:

export const componentCategories = { // Existing categories... Navigation: ["navbar", "sidebar", "breadcrumbs"], DataDisplay: ["table", "card", "badge"], };

The server will automatically create tools for new categories.

Categories help organize components logically, making it easier for AI assistants to find and suggest relevant components based. Also, some models and IDE have a limit on the number of tools they can handle, so categorizing helps to keep the number of tools manageable.

Your component registry should follow this structure:

{ "registry": [ { "name": "button-primary", "type": "registry:component", "description": "Primary button component" } ] }

Component Details (/r/{component-name}.json)

{ "name": "button-primary", "type": "registry:component", "files": [ { "content": "// Component implementation" } ] }

- Configure in your MCP client (e.g., Claude Desktop):

{ "mcpServers": { "your-mcp-server": { "command": "node", "args": ["/path/to/mcp-starter/dist/server.js"] } } }

You can also publish this template as an NPM package for easy installation in other projects.
- Updatepackage.jsonwith your details
- Build and publish:

SeeCONTRIBUTING.mdfor details on how to contribute to this project.

This project is licensed under the MIT License - see theLICENSEfile for details.

- Built withModel Context Protocol SDK
- Inspired by the need for better AI-component integration
- Thanks to the MCP community for their contributions

⚠️ Important: Remember to replacehttps://ui.stackzero.cowith your actual project URL before using this template in production!

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

An MCP server to help AI assistants to answer questions and generate AccelByte Extend SDK code more effectively .

Local stdio MCP server that lets AI coding agents read and maintain structured architecture, rules, and decisions directly from your repository.

Official Context7 MCP server that brings up-to-date, version-specific library documentation and code examples into AI coding prompts.

Remote, no-auth MCP server providing AI-powered codebase context and answers

Instead of direct calling MCP tools, mcpcode server transforms MCP tool calls into TypeScript programs, enabling smarter, lower-latency orchestration by LLMs.

Help agents automatically write and test stories for your UI components

Official Svelte MCP server, provides docs and suggestions on the generated code.

Supercharge your Agent with Semantic Code Intelligence and save 💰 in the process!

Execute any LLM-generated code in the YepCode secure and scalable sandbox environment and create your own MCP tools using JavaScript or Python, with full support for NPM and PyPI packages

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.