Agents: MCP + skills
Two surfaces give agents programmatic insight (route tree, type contracts, diagnostics) instead of guessing from raw files.
MCP server (@swelte/mcp)
Transport is stdio only — the IDE spawns the server, no ports or auth.
{ "mcpServers": { "swelte": { "command": "node",
"args": ["./node_modules/@swelte/mcp/dist/index.js"] } } }Or via the bin: swelte-mcp (stdio, no args).
| Tool | What it does |
|---|---|
list_routes | route tree: URL path, RPC fns, .svelte partner |
get_route | one route in detail: V fns, structs, source |
check | swelte check diagnostics (orphans, clashes, backend violations) |
get_config | resolved project config |
validate_data_contract | V response struct vs Svelte $props() per-field match |
scaffold_route | create a route pairing (static | dynamic | api) |
explain_bytecode_error | QuickJS trace / wasm trap → source lines |
Skills
Six playbooks ship inside the npm packages — extracted automatically on npm install into .agents/skills/ (scaffolded projects carry the postinstall hook). A
skill tells the agent how to do the work, the MCP tool gives it the live project facts.
Prefer MCP tools over grepping src/routes/ by hand.
| Skill | Ships in | Use when |
|---|---|---|
swelte-overview | @swelte/core | scaffolding, explaining, navigating (layout, CLI, .swelte/) |
swelte-mcp | @swelte/mcp | querying via the MCP server (routes, contracts, diagnostics) |
swelte-ssr-load | @swelte/ssr-qjs | adding @[load] data, debugging SSR output |
swelte-svelte5 | @swelte/core | creating/fixing .svelte files (runes only) |
swelte-sveltekit-delta | @swelte/core | porting SvelteKit apps, checking parity |
swelte-v-routes | @swelte/core | creating/fixing .v files (attrs, request shape, types) |
Installing skills
Automatic — the scaffold template carries a postinstall hook (npm-skills extract --skip-production --override, scoped via npmSkills.consume.only: ["@swelte/*"] so unrelated packages are never
resolved), so npm install drops each dependency's skills/ into .agents/skills/. Versioned with the packages, no manual copy step.