Tailwind Svelte Assistant

by caullenomdahl

220 downloads
Not rated
GitHub

About

Provides documentation and code snippets for SvelteKit and Tailwind CSS.

Details

Author
caullenomdahl
Downloads
220
Categories
Developer Tools, Knowledge Base, Other, AI
Tags
#document

- Automated setup guidance for Tailwind CSS with SvelteKit
- Component template generation with multiple variants
- Tailwind CSS class validation and compatibility checking
- Documentation snippet retrieval from local sources
- Concept explanation using local documentation

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Tailwind Svelte Assistant
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Clone the repository, install dependencies (npm install), build the project (npm run build), and start the server (node build/index.js). The server is typically managed by an MCP client/runner and integrates into environments that support the MCP protocol.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "tailwind svelte assistant": {
            "Tailwind-Svelte-Assistant": {
                "command": "node",
                "args": [
                    "build/index.js"
                ]
            }
        }
    }
}

McpServers

{
    "Tailwind-Svelte-Assistant": {
        "command": "node",
        "args": [
            "build/index.js"
        ]
    }
}

Provides documentation and code snippets for SvelteKit and Tailwind CSS.

A secure, high-performance Model Context Protocol (MCP) server that providescompleteSvelteKit and Tailwind CSS documentation (100% coverage) and code snippets with enhanced security, proper TypeScript implementation, and comprehensive error handling.

- 100% Svelte/SvelteKit Coverage: Official LLM-optimized documentation (1.04 MB)
- 100% Tailwind CSS Coverage: Complete documentation via Repomix extraction (2.1 MB, 249 files)
- Intelligent Search: Search within complete documentation with context
- 12.5x-25x Improvement: From 4-8% coverage to 100% coverage

- Path Traversal Protection: Comprehensive input sanitization prevents directory traversal attacks
- Input Validation: Strict parameter validation with pattern matching and length limits
- Secure File Operations: Bounded file access with path validation and size limits
- Audit Logging: Structured security event logging for monitoring

- Modular Design: Separated concerns into dedicated services and utilities
- TypeScript Excellence: Full type safety with proper interfaces and noanytypes
- ES Modules: Modern JavaScript module system with proper imports
- Error Handling: Comprehensive error classification and safe error messaging

- Content Caching: LRU cache with configurable timeout for improved response times
- File Size Limits: Prevents resource exhaustion with configurable limits
- Async Operations: Non-blocking file operations for better concurrency
- Memory Management: Automatic cache cleanup and garbage collection

src/ ├── index.ts # Main server with security hardening ├── types.ts # TypeScript type definitions ├── services/ │ └── fileService.ts # Secure file operations with caching └── utils/ ├── security.ts # Input validation and path sanitization └── errorHandler.ts # Comprehensive error handling

The easiest way to install this MCP server is throughSmithery:

npx -y @smithery/cli install @CaullenOmdahl/tailwind-svelte-assistant --client claude

- Install the server
- Configure it for Claude Desktop
- Set up all required dependencies

For other MCP clients, use the direct server URL:

https://server.smithery.ai/@CaullenOmdahl/tailwind-svelte-assistant/mcp

Add this to your MCP client configuration:

{ "mcpServers": { "tailwind-svelte-assistant": { "url": "https://server.smithery.ai/@CaullenOmdahl/tailwind-svelte-assistant/mcp", "transport": "http" } } }

- Node.js 20+(required for ES modules support and dependencies)
- npm or yarn
- Git (for cloning repository)

The server uses secure defaults but can be configured via theServerConfiginterface:

const CONFIG: ServerConfig = { maxFileSize: 3  1024  1024, // 3MB max file size (for full docs) cacheTimeout: 5  60  1000, // 5 minutes cache timeout contentBasePath: './content', svelteFullDocsPath: './content/docs/svelte-sveltekit-full.txt', tailwindFullDocsPath: './content/docs/tailwind-docs-full.txt', // ... other paths };

Documentation is automatically downloaded and updated:

# Update all documentation (Svelte + Tailwind) npm run update-content

- Downloads official Svelte LLM-optimized docs (svelte.dev/llms-full.txt)
- Extracts complete Tailwind docs from GitHub via Repomix
- Updates component snippet timestamps
- Generates content summary

- Svelte/SvelteKit: Official LLM-optimized text file (100% coverage)
- Tailwind CSS: GitHub repository via Repomix extraction (249 MDX files)
- Snippets: Local curated component examples (43 files)

- Pattern Matching: Only alphanumeric, hyphens, underscores, and dots allowed
- Length Limits: Configurable maximum input lengths
- Path Sanitization: Removes directory traversal attempts
- Bounds Checking: Ensures file access stays within allowed directories

- Safe Error Messages: No sensitive information exposed to clients
- Structured Logging: JSON-formatted audit logs for security monitoring
- Error Classification: Different handling for different error types
- Graceful Degradation: Fallback responses for non-critical failures

- Path Validation: Verifies resolved paths are within base directories
- File Size Limits: Prevents resource exhaustion attacks
- Read-Only Operations: No write operations exposed to clients
- Cache Isolation: Content caching doesn't expose file system structure

// Automatic content caching with configurable timeout const fileService = new SecureFileService( 1024  1024, // Max file size 5  60 * 1000 // Cache timeout (5 minutes) );

- Memory Limits: File size restrictions prevent memory exhaustion
- Cache Cleanup: Automatic removal of expired cache entries
- Async I/O: Non-blocking file operations
- Error Recovery: Graceful handling of resource limitations

🆕 Complete Documentation Tools (Recommended)

-

get_svelte_full_docs- Get complete Svelte & SvelteKit documentation (1MB, 100% coverage)

- No parameters required
- Returns entire documentation in single LLM-optimized file
- Official format from Svelte team

get_tailwind_full_docs- Get complete Tailwind CSS documentation (2.1MB, 100% coverage)

- No parameters required
- Includes all 249 documentation files
- All utility classes and concepts covered

search_svelte_docs- Search within Svelte/SvelteKit documentation

- Parameters:query(string),limit(optional, default: 5)
- Returns matching sections with surrounding context
- Fast in-memory search

search_tailwind_docs- Search within Tailwind CSS documentation

- Parameters:query(string),limit(optional, default: 5)
- Returns matching sections with surrounding context
- Covers all utility classes

Note: These tools only cover ~4-8% of available documentation. Use the full docs tools above for complete coverage.

- get_sveltekit_doc- Retrieve specific SvelteKit documentation topic
- get_tailwind_info- Get specific Tailwind CSS information
- list_sveltekit_topics- List available SvelteKit docs (limited)
- list_tailwind_info_topics- List Tailwind documentation (limited)

- get_component_snippet- Fetch Svelte component code
- list_snippet_categories- List component categories
- list_snippets_in_category- List snippets in category

- Pattern validationwith regex constraints
- Length limitsfor input parameters
- Comprehensive descriptionswith usage examples
- Security-hardenedinput sanitization

{ "mcpServers": { "tailwind-svelte-assistant": { "url": "https://server.smithery.ai/@CaullenOmdahl/tailwind-svelte-assistant/mcp", "transport": "http" } } }
{ "mcpServers": { "tailwind-svelte-assistant": { "command": "node", "args": ["./dist/index.js"], "env": {} } } }
// Get complete Svelte/SvelteKit documentation (1MB, 100% coverage) await client.callTool("get_svelte_full_docs", {}); // Get complete Tailwind CSS documentation (2.1MB, 100% coverage) await client.callTool("get_tailwind_full_docs", {}); // Search within Svelte documentation await client.callTool("search_svelte_docs", { query: "load function", limit: 5 // optional }); // Search within Tailwind documentation await client.callTool("search_tailwind_docs", { query: "padding utilities", limit: 3 // optional });

Legacy: Specific Topics (Limited Coverage)

// Get specific SvelteKit topic (only covers ~8% of docs) await client.callTool("get_sveltekit_doc", { topic: "routing" }); // Get specific Tailwind info (only covers ~4% of docs) await client.callTool("get_tailwind_info", { query: "padding" }); // List available topics (limited) await client.callTool("list_tailwind_info_topics", {});
// Get a component snippet await client.callTool("get_component_snippet", { component_category: "headers", snippet_name: "navbar-default" }); // List snippet categories await client.callTool("list_snippet_categories", {});

The includedDockerfileprovides a secure, multi-stage build:

# Multi-stage build with security hardening FROM node:18-alpine AS builder # ... build process FROM node:18-alpine AS release # ... production setup with non-root user

- Multi-stage buildreduces attack surface
- Alpine Linuxfor minimal footprint
- Non-root userfor container security
- Production dependencies only

All operations are logged with structured JSON for easy parsing:

{ "timestamp": "2024-01-15T10:30:00.000Z", "level": "info", "operation": "tool_request", "tool": "get_sveltekit_doc", "topic": "routing" }

- Tool requestswith parameters
- Security violationsand blocked requests
- Error conditionswith classification
- Performance metricsand cache hits

- ES Modules: Updated to useimport/exportinstead ofrequire
- TypeScript: Strict typing may require type assertions in some cases
- Error Messages: More secure, less detailed error messages

- Tool Interface: All existing tools work with improved validation
- Content Structure: No changes to content organization
- Docker: Updated base image and security hardening
- Security First: All changes must pass security review
- Type Safety: Maintain strict TypeScript compliance
- Test Coverage: Include tests for new functionality
- Documentation: Update README for any API changes

- Input validation for all user inputs
- Error handling with safe error messages
- TypeScript types withoutany
- Security audit for path operations
- Performance impact assessment

- MCP Specification
-
Security Best Practices
-
TypeScript SDK

# Clear dist and rebuild rm -rf dist && npm run build
# Ensure executable permissions chmod +x dist/index.js

- Ensure Node.js 18+ for ES module support
- Check"type": "module"in package.json

If you discover a security vulnerability, please report it via GitHub issues with thesecuritylabel.

This project maintains the same license as the original Tailwind-Svelte-Assistant project.

- Documentation Coverage: 🔴 4-8% → 🟢100%(12.5x-25x improvement)
- Security: 🔴 Critical vulnerabilities → 🟢 Hardened
- Type Safety: 🟡 Mixed types → 🟢 Strict TypeScript
- Performance: 🟡 No caching → 🟢 5-minute LRU cache
- Architecture: 🔴 Monolithic → 🟢 Modular services
- Error Handling: 🟡 Basic → 🟢 Comprehensive classification

- Svelte/SvelteKit: 1,065,921 bytes (1.04 MB)
- Tailwind CSS: 2,197,160 bytes (2.1 MB, 249 files)
- Total Tokens: 606,587 tokens (Tailwind)
- Update Method: Automated via npm script

- Cold Start: ~50-100ms per file read
- Cache Hit: ~1-5ms response time
- Memory Usage: ~1-3MB per cached full doc
- Cache Efficiency: 80-95% hit rate in typical usage
- Search Performance: <10ms for in-memory search

- Svelte: Official LLM-optimized format from Svelte team
- Tailwind: Extracted via Repomix from official GitHub repository
- Updates: Automated script with fallback mechanisms

This upgraded MCP server transforms the original prototype into a production-ready service withcomplete documentation coverage, enterprise-grade security, performance, and maintainability.

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.

Extentos is a multi-vendor development platform for adding smart-glasses capabilities to existing iOS and Android apps. The simplest analogy is Stripe for smart glasses

An MCP server tailored for React Native–first development using Gluestack UI

Create and read feature flags, review experiments, generate flag types, search docs, and interact with GrowthBook's feature flagging and experimentation platform.

Gives AI agents public URLs (tunnels) for localhost, live HTTP traffic inspection, snapshot publishing, and access control.

Understand, develop, and debug authorization policies in Oso Cloud.

Up-to-date documentation for your coding agent. Covers 1000s of public repos and sites. Built by ref.tools

Points agents to the canonical Agentry install docs for errors, product analytics, and deploy attribution.

Gives coding agents deterministic, read-only documentation handoffs with edit boundaries, ownership, and required checks before repository changes.

Deterministic JSON checks with signed evidence and x402-paid execution

Search Apple's Developer Documentation with smart search and wildcard support.

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.