Documentation
¶
Index ¶
Constants ¶
const ( ShadcnDocsURL = "https://ui.shadcn.com" ShadcnDocsComponents = ShadcnDocsURL + "/docs/components" ShadcnGitHubURL = "https://github.com/shadcn-ui/ui" ShadcnRawGitHubURL = "https://raw.githubusercontent.com/shadcn-ui/ui/main" // DefaultShadcnRateLimit is the default maximum requests per second DefaultShadcnRateLimit = 5 // ShadcnRateLimitEnvVar is the environment variable for configuring rate limit ShadcnRateLimitEnvVar = "SHADCN_RATE_LIMIT" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheEntry ¶
CacheEntry defines the structure for cached data. Moved here to be shared across shadcnui tools.
type ComponentExample ¶
type ComponentExample struct { Title string `json:"title"` Code string `json:"code"` Description string `json:"description,omitempty"` }
ComponentExample defines a usage example for a component.
type ComponentInfo ¶
type ComponentInfo struct { Name string `json:"name"` Description string `json:"description"` URL string `json:"url"` // Link to the docs page SourceURL string `json:"sourceUrl,omitempty"` // Link to GitHub source APIReference string `json:"apiReference,omitempty"` // If available Installation string `json:"installation,omitempty"` // npx command Usage string `json:"usage,omitempty"` // General usage code block Props map[string]ComponentProp `json:"props,omitempty"` // Component props/variants Examples []ComponentExample `json:"examples,omitempty"` }
ComponentInfo holds all details for a shadcn ui component.
type ComponentProp ¶
type ComponentProp struct { Type string `json:"type"` // e.g., "variant", "string", "boolean" Description string `json:"description"` Required bool `json:"required"` Default string `json:"default,omitempty"` Example string `json:"example,omitempty"` // For variants, this could be code }
ComponentProp defines the structure for a component's property or variant.
type GetComponentDetailsTool ¶
type GetComponentDetailsTool struct{}
GetComponentDetailsTool defines the tool for getting shadcn ui component details.
func (*GetComponentDetailsTool) Definition ¶
func (t *GetComponentDetailsTool) Definition() mcp.Tool
Definition returns the tool's definition.
type GetComponentExamplesTool ¶
type GetComponentExamplesTool struct{}
GetComponentExamplesTool defines the tool for getting shadcn ui component examples.
func (*GetComponentExamplesTool) Definition ¶
func (t *GetComponentExamplesTool) Definition() mcp.Tool
Definition returns the tool's definition.
type HTTPClient ¶
HTTPClient defines the interface for an HTTP client. This interface is maintained for compatibility but tools should migrate to security.Operations
var DefaultHTTPClient HTTPClient = NewRateLimitedHTTPClient()
DefaultHTTPClient is the default HTTP client implementation with rate limiting.
type ListShadcnComponentsTool ¶
type ListShadcnComponentsTool struct{}
ListShadcnComponentsTool defines the tool for listing shadcn ui components. listComponentsCacheKey and listComponentsCacheTTL are now in utils.go
func (*ListShadcnComponentsTool) Definition ¶
func (t *ListShadcnComponentsTool) Definition() mcp.Tool
Definition returns the tool's definition.
type RateLimitedHTTPClient ¶ added in v0.21.1
type RateLimitedHTTPClient struct {
// contains filtered or unexported fields
}
RateLimitedHTTPClient implements HTTPClient with rate limiting
func NewRateLimitedHTTPClient ¶ added in v0.21.1
func NewRateLimitedHTTPClient() *RateLimitedHTTPClient
NewRateLimitedHTTPClient creates a new rate-limited HTTP client with proxy support
type SearchShadcnComponentsTool ¶
type SearchShadcnComponentsTool struct { }
SearchShadcnComponentsTool defines the tool for searching shadcn ui components.
func (*SearchShadcnComponentsTool) Definition ¶
func (t *SearchShadcnComponentsTool) Definition() mcp.Tool
Definition returns the tool's definition.
type UnifiedShadcnTool ¶
type UnifiedShadcnTool struct {
// contains filtered or unexported fields
}
UnifiedShadcnTool provides a single interface for all shadcn ui operations
func (*UnifiedShadcnTool) Definition ¶
func (t *UnifiedShadcnTool) Definition() mcp.Tool
Definition returns the tool's definition for MCP registration
func (*UnifiedShadcnTool) Execute ¶
func (t *UnifiedShadcnTool) Execute(ctx context.Context, logger *logrus.Logger, cache *sync.Map, args map[string]any) (*mcp.CallToolResult, error)
Execute executes the unified shadcn tool
func (*UnifiedShadcnTool) ProvideExtendedInfo ¶ added in v0.22.0
func (t *UnifiedShadcnTool) ProvideExtendedInfo() *tools.ExtendedHelp
ProvideExtendedInfo provides detailed usage information for the shadcn tool