templui-mcp-server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@templui-mcp-serverget the button component source code"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
TemplUI MCP Server
π The fastest way to integrate TemplUI components into your AI workflow
A Model Context Protocol (MCP) server that provides AI assistants with comprehensive access to TemplUI components. Get component source code, documentation, examples, and metadata for building Go applications with the templ templating language.
β¨ Key Features
π― Go Templ Support - Native support for Go's templ templating language
π¦ Component Source Code - Latest TemplUI component implementations
π¨ Component Demos - Example implementations and usage patterns
π Documentation Access - Complete component documentation from templui.io
π§ JavaScript Integration - Client-side functionality for interactive components
π Metadata Extraction - Component properties, variants, and configuration details
β‘ Smart Caching - Efficient GitHub API integration with rate limit handling
Related MCP server: shadcn MCP Server
π Quick Start
# Basic usage (60 requests/hour)
npx templui-mcp-server
# With GitHub token (5000 requests/hour) - Recommended
npx templui-mcp-server --github-api-key ghp_your_token_here
# Use cached documentation
npx templui-mcp-server --use-cached-docsπ― Get your GitHub token in 2 minutes: GitHub Personal Access Tokens
π Available Tools
Tool | Description |
| Get the source code (.templ file) for a specific component |
| Get demo/example code showing component usage |
| Get complete documentation for a component |
| Get JavaScript code for interactive components |
| Get detailed metadata including props and features |
| List all available components, optionally by category |
π¨ Supported Components
TemplUI provides 42 components across multiple categories:
Form Components
Button, Input, Textarea, Checkbox, Radio, Select Box
Date Picker, Time Picker, Input OTP, Tags Input
Form, Label, Switch, Rating, Slider
Layout Components
Card, Separator, Aspect Ratio, Accordion, Table
Collapsible, Sheet, Sidebar
Navigation Components
Breadcrumb, Pagination, Tabs
Overlay Components
Dialog, Dropdown, Popover, Tooltip
Feedback Components
Alert, Toast, Progress, Skeleton, Copy Button
Display Components
Avatar, Badge, Icon, Code, Chart, Carousel
π οΈ Installation & Setup
1. Install the Package
# Global installation (optional)
npm install -g templui-mcp-server
# Or use npx (recommended)
npx templui-mcp-server --help2. Get GitHub Token (Recommended)
# Visit: https://github.com/settings/tokens
# Generate token with no scopes needed for public repositories
export GITHUB_PERSONAL_ACCESS_TOKEN=ghp_your_token_here3. Test the Server
# Run server
templui-mcp-server --github-api-key ghp_your_token_here
# Server will start and wait for MCP client connectionsπ Integration with AI Tools
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"templui": {
"command": "npx",
"args": ["templui-mcp-server"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
}
}
}
}VS Code with Continue.dev
Add to your Continue configuration:
{
"mcpServers": [
{
"name": "templui",
"command": "npx",
"args": ["templui-mcp-server", "--github-api-key", "ghp_your_token_here"]
}
]
}Cursor
Configure in Cursor's MCP settings:
{
"templui": {
"command": "templui-mcp-server",
"args": ["--github-api-key", "ghp_your_token_here"]
}
}π Usage Examples
Get Component Source Code
// AI Assistant can request:
use_tool("get_component", { "componentName": "button" })
// Returns Go templ source code with helpful commentsGet Component Documentation
// AI Assistant can request:
use_tool("get_component_docs", { "componentName": "dialog" })
// Returns formatted documentation with installation and examplesList Components by Category
// AI Assistant can request:
use_tool("list_components", { "category": "form" })
// Returns all form-related componentsGet Component Examples
// AI Assistant can request:
use_tool("get_component_demo", { "componentName": "carousel" })
// Returns example implementations from the showcaseβοΈ Configuration
Command Line Options
templui-mcp-server [options]
Options:
--github-api-key <token> GitHub personal access token
--use-cached-docs Use cached documentation
--log-level <level> Set log level (error, warn, info, debug)
--help Show help messageEnvironment Variables
GITHUB_PERSONAL_ACCESS_TOKEN # GitHub token for API access
TEMPLUI_DOCS_PATH # Path to documentation files
TEMPLUI_CACHE_DIR # Cache directory location
LOG_LEVEL # Logging levelπ― Use Cases
π€ AI-Powered Development - Let AI assistants build UIs with TemplUI components
π Component Discovery - Explore available components and their usage patterns
π Rapid Prototyping - Get complete component implementations quickly
π Code Generation - Generate Go templ code with proper imports and structure
π Learning Go Templ - Understand component patterns and best practices
π Project Structure
templui-mcp-server/
βββ src/
β βββ index.ts # CLI entry point
β βββ server/ # MCP server implementation
β βββ tools/ # Tool implementations
β βββ utils/ # Utilities (GitHub, docs, cache)
β βββ data/ # Component metadata
β βββ cli/ # Command line interface
βββ samples/ # Sample data (documentation)
βββ package.json
βββ README.mdπ§ Development
Building from Source
# Clone repository
git clone https://github.com/tggo/templui-mcp-server.git
cd templui-mcp-server
# Install dependencies
npm install
# Build TypeScript
npm run build
# Run development version
npm run devUpdating Components
To sync with the latest TemplUI components:
# Automated update (recommended)
npm run update:components
# Dry run to see changes
npm run update:components:dry-run
# Update without publishing to npm
npm run update:components:no-publishThe update script will:
Discover new components from TemplUI repository
Update static component list
Bump version number
Update documentation
Commit, tag, and push to GitHub
Publish to npm (if logged in)
Adding Documentation
Place TemplUI documentation files in samples/templui-site-doc/:
samples/templui-site-doc/
βββ templui.io_docs_components_button.md
βββ templui.io_docs_components_dialog.md
βββ ...π Troubleshooting
Common Issues
Rate Limit Exceeded
Error: API rate limit exceeded Solution: Provide GitHub token with --github-api-keyDocumentation Not Found
Error: Documentation directory not found Solution: Ensure samples/templui-site-doc exists with markdown filesComponent Not Found
Error: Component "xyz" not found Solution: Use list_components to see available components
Debug Mode
# Enable debug logging
templui-mcp-server --log-level debug --github-api-key ghp_your_tokenπ API Reference
Tool Schemas
All tools follow consistent parameter patterns:
interface ComponentRequest {
componentName: string; // Required for most tools
}
interface ListRequest {
category?: string; // Optional category filter
}Response Format
Tools return content in MCP-standard format:
{
content: [
{
type: "text",
text: "Component source code or documentation"
}
]
}π€ Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
π License
MIT License - see LICENSE for details.
π Acknowledgments
TemplUI Team - For the amazing Go templ component library
Go Templ - For the excellent templating language
Anthropic - For the Model Context Protocol specification
Made with β€οΈ for the Go and TemplUI community
Star β this repo if you find it helpful!
π Links
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceEnables AI assistants to discover, install, and generate code examples for shadcn/ui components, providing installation commands and usage examples for 37+ React UI components.Last updatedMIT
- FlicenseAqualityDmaintenanceProvides AI assistants with direct access to shadcn/ui components and blocks, enabling real-time fetching of component source code, documentation, and implementation examples.Last updated64424
- Alicense-qualityCmaintenanceEnables AI assistants to search, understand, and retrieve UI components from ui-layouts.com through tools like search, documentation, metadata, and source code access.Last updated10131MIT
- Flicense-qualityDmaintenanceEnables AI assistants to access documentation of Vue UI components, including props, events, and slots, for generating correct usage code.Last updated7
Related MCP Connectors
Visual email & layout builder that turns AI assistants into a Temway authoring studio.
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analyβ¦
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/tggo/templui-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server