Content
# Svelte Analyzer (svelte-analyzer-mcp)
A Model Context Protocol (MCP) server that safely parses and extracts Svelte 4/5 variable specifications (`props`, `$stores`, `on:` events / `dispatch`) without relying on heavy AST parsers, by running an extremely fast combination of regular expression engines on Rust.
## Precautions for AI Agents
The optimal prompts and usage for this tool are described in [SKILL.md](./SKILL.md), please follow them.
## Features
- **Token utilization optimization**: Eliminates the need for AI to load all huge Svelte components, providing only the interface (what arguments and stores are required) in an instant.
- **Svelte 4 & 5 compatibility**: Supports Svelte 4's `export let` and Svelte 5's unique `$props()` destructuring. Also automatically excludes Svelte 5-specific runes like `$state` and `$derived` to prevent unintended store extraction bugs.
## Setup
### 0. Prerequisites
- **Only Rust build toolchain** ([install with rustup](https://rustup.rs/))
※ No need to pre-install other tools as the custom parsing engine is fully embedded!
### 1. Installation (one-line installation)
Remote installation, build, and deployment can be done with a single command directly from GitHub.
```powershell
cargo install --git https://github.com/adasima/svelte-analyzer-mcp --force
```
*(The above command will automatically place `svelte-analyzer-mcp.exe` in `$HOME/.cargo/bin/`)*
### 2. Agent Configuration
Add the following to your agent's configuration file (e.g., `mcp_config.json`) to enable the tool:
```json
"mcpServers": {
"svelte-analyzer-mcp": {
"command": "svelte-analyzer-mcp"
}
}
```
### 3. Fully Automated Installation and Configuration (all tools at once)
To install all tools at once and configure them automatically, run the following one-liner:
```powershell
Invoke-RestMethod "https://raw.githubusercontent.com/adasima/ai-workshop/main/mcp_installer.ps1" | Invoke-Expression
```