SM

spences10/mcp-svelte-docs

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

124 stars 8 forks 质量 83 趋势 20MIT

spences10/mcp-svelte-docs 是从 https://github.com/spences10/mcp-svelte-docs. 导入的 MCP 服务器候选

概览

spences10/mcp-svelte-docs 是从 https://github.com/spences10/mcp-svelte-docs. 导入的 MCP 服务器候选

概述(AI 翻译)

提供权威Svelte 5的模型上下文协议(MCP)服务器 以及直接从 TypeScript 提取的 SvelteKit 定义 声明。获取所有的精确语法、参数和示例 Svelte 5 概念通过一个统一的界面实现。

建筑

定义优先的方法:与其使用多个专业工具, 该服务器提供了一个强大的svelte_definition工具 访问28+个涵盖以下内容的全面定义:

  • 所有Svelte 5符文($state、$derived、$props、$effect变体)
  • 现代功能(片段、等待表达式、远程函数)
  • 事件处理(DOM事件、自定义事件、组件 沟通)
  • 迁移指南(Svelte 4到5模式及最佳实践)
  • TypeScript 接口(片段、快照类型)
  • 高级模式(全局状态、常见错误、生命周期) 等价物)

可用工具

svelte_definition

所有Svelte 5和SvelteKit概念的单一强大工具:

示例:

  • svelte_definition("$state") - 完整$state文档
  • svelte_definition("snippets", "quick") - 摘要概述 示例

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

mcp-svelte-docs

A Model Context Protocol (MCP) server providing authoritative Svelte 5 and SvelteKit definitions extracted directly from TypeScript declarations. Get precise syntax, parameters, and examples for all Svelte 5 concepts through a single, unified interface.

Architecture

Definition-First Approach: Rather than multiple specialized tools, this server provides one powerful svelte_definition tool that accesses 28+ comprehensive definitions covering:

  • All Svelte 5 runes ($state, $derived, $props, $effect variants)
  • Modern features (snippets, await expressions, remote functions)
  • Event handling (DOM events, custom events, component communication)
  • Migration guidance (Svelte 4 to 5 patterns and best practices)
  • TypeScript interfaces (Snippet, Snapshot types)
  • Advanced patterns (global state, common mistakes, lifecycle equivalents)

Available Tool

svelte_definition

Single, powerful tool for all Svelte 5 and SvelteKit concepts:

svelte_definition(identifier: string, format?: "syntax"|"quick"|"full")

Examples:

  • svelte_definition("$state") - Complete $state documentation
  • svelte_definition("snippets", "quick") - Snippet overview with example
  • svelte_definition("onclick", "syntax") - Just the TypeScript signature
  • svelte_definition("migration-patterns") - Svelte 4 → 5 migration guide

Response Formats:

  • "syntax" - TypeScript signature only (~50 words)
  • "quick" - Definition + minimal example (~200 words)
  • "full" - Complete documentation with examples (~500-1000 words, default)

Available Identifiers (28+)

Core Runes: $state, $state.raw, $state.snapshot, $derived, $derived.by, $props, $bindable, $effect, $effect.pre, $effect.root, $effect.pending, $effect.tracking

Development Tools: $inspect, $host

Features & Patterns: snippets, onclick, component-events, migration-patterns, await-expressions, remote-functions, global-state, common-mistakes, lifecycle-equivalents

Event Handling: custom-events, event-delegation, event-modifiers

TypeScript Interfaces: snippet, snapshot

Key Features

🎯 Authoritative & TypeScript-First

  • Direct from Source: Definitions extracted from official Svelte 5 TypeScript declarations
  • Always Current: Reflects the actual API, not outdated tutorials
  • Type-Safe: Includes precise parameter types, return values, and constraints

⚡ Single Interface, Complete Coverage

  • One Tool: svelte_definition replaces 16+ specialized tools
  • 28+ Definitions: Every Svelte 5 rune, feature, and pattern covered
  • Consistent Responses: Same interface whether you need $state or remote-functions

🚀 Modern Svelte 5 & SvelteKit Support

  • Await Expressions: Async operations directly in templates (await-expressions)
在 GitHub 查看完整 README

安装

npx -y mcp-svelte-docs
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "mcp-svelte-docs": { "command": "wsl.exe", "args": ["bash", "-c", "npx -y mcp-svelte-docs"] } } }