Compare commits

...

8 Commits

Author SHA1 Message Date
Paolo Ricciuti
0d55c0f61a Merge pull request #68 from sveltejs/changeset-release/main 2025-10-17 07:56:24 +02:00
github-actions[bot]
7d7b08610d Version Packages 2025-10-17 05:56:00 +00:00
Paolo Ricciuti
c08d8d4df7 Merge pull request #74 from sveltejs/renovate/all-minor-patch 2025-10-17 07:55:28 +02:00
paoloricciuti
12dd3c16ac fix: update deps 2025-10-17 01:26:35 +02:00
paoloricciuti
ca17a18677 fix: remove sizes 2025-10-17 00:42:47 +02:00
paoloricciuti
cf62286912 fix: use data: uri for local icon & add icons to tools + resources + prompts 2025-10-17 00:31:23 +02:00
Paolo Ricciuti
a4dfaab1c6 Merge pull request #75 from sveltejs/icon
feat: add svelte icon for mcp server
2025-10-16 23:32:18 +02:00
renovate[bot]
2d50ffd38c chore(deps): update dependency @anthropic-ai/sdk to ^0.67.0 2025-10-16 21:14:38 +00:00
17 changed files with 62 additions and 56 deletions

View File

@@ -1,5 +0,0 @@
---
'@sveltejs/mcp': patch
---
fix: prevent `imported_runes` suggestion from being added for libs that are not svelte

View File

@@ -1,5 +0,0 @@
---
'@sveltejs/mcp': patch
---
feat: add svelte icon and website url for mcp server

View File

@@ -12,6 +12,7 @@
"body": [
"import type { SvelteMcp } from '../../index.js';",
"import * as v from 'valibot';",
"import { icons } from '../../icons/index.js';",
"",
"export function ${1:function_name}(server: SvelteMcp) {",
"\t$0",
@@ -35,6 +36,7 @@
"prefix": "!prompt",
"body": [
"import type { SvelteMcp } from '../../index.js';",
"import { icons } from '../../icons/index.js';",
"",
"/**",
" * Function that actually generates the prompt string. You can use this in the MCP server handler to generate the prompt, it can accept arguments",
@@ -69,6 +71,7 @@
"\t\t\ttitle: '${2:title}',",
"\t\t\tdescription:",
"\t\t\t\t'${3:llm_description}',",
"\t\t\ticons,",
"\t\t},",
"\t\tasync () => {",
"\t\t\treturn {",

View File

@@ -65,6 +65,6 @@
"@sveltejs/mcp-schema": "workspace:^",
"@sveltejs/mcp-server": "workspace:^",
"@tmcp/transport-http": "^0.6.3",
"tmcp": "^1.14.0"
"tmcp": "^1.15.0"
}
}

View File

@@ -35,7 +35,7 @@
"zimmerframe": "^1.1.4"
},
"devDependencies": {
"@anthropic-ai/sdk": "^0.66.0",
"@anthropic-ai/sdk": "^0.67.0",
"@sveltejs/kit": "^2.42.2",
"@types/eslint-scope": "^8.3.2",
"@types/estree": "^1.0.8",

View File

@@ -1,6 +1,7 @@
import type { SvelteMcp } from '../../index.js';
import * as v from 'valibot';
import { format_sections_list } from '../../utils.js';
import { icons } from '../../icons/index.js';
/**
* Function that actually generates the prompt string. You can use this in the MCP server handler to generate the prompt, it can accept arguments
@@ -64,6 +65,7 @@ export function setup_svelte_task(server: SvelteMcp) {
};
},
},
icons,
},
async ({ task }) => {
const available_docs = await format_sections_list();

View File

@@ -1,5 +1,6 @@
import type { SvelteMcp } from '../../index.js';
import { get_sections, fetch_with_timeout } from '../../utils.js';
import { icons } from '../../icons/index.js';
export async function list_sections(server: SvelteMcp) {
const sections = await get_sections();
@@ -42,6 +43,7 @@ export async function list_sections(server: SvelteMcp) {
},
},
uri: 'svelte://{/slug*}.md',
icons,
},
async (uri, { slug }) => {
const section = sections.find((section) => {

View File

@@ -2,6 +2,7 @@ import type { SvelteMcp } from '../../index.js';
import * as v from 'valibot';
import { get_sections, fetch_with_timeout, format_sections_list } from '../../utils.js';
import { SECTIONS_LIST_INTRO, SECTIONS_LIST_OUTRO } from './prompts.js';
import { icons } from '../../icons/index.js';
export function get_documentation(server: SvelteMcp) {
server.tool(
@@ -17,6 +18,7 @@ export function get_documentation(server: SvelteMcp) {
),
),
}),
icons,
},
async ({ section }) => {
let sections: string[];

View File

@@ -1,6 +1,7 @@
import type { SvelteMcp } from '../../index.js';
import { format_sections_list } from '../../utils.js';
import { SECTIONS_LIST_INTRO, SECTIONS_LIST_OUTRO } from './prompts.js';
import { icons } from '../../icons/index.js';
export function list_sections(server: SvelteMcp) {
server.tool(
@@ -8,6 +9,7 @@ export function list_sections(server: SvelteMcp) {
name: 'list-sections',
description:
'Lists all available Svelte 5 and SvelteKit documentation sections in a structured format. Each section includes a "use_cases" field that describes WHEN this documentation would be useful. You should carefully analyze the use_cases field to determine which sections are relevant for the user\'s query. The use_cases contain comma-separated keywords describing project types (e.g., "e-commerce", "blog"), features (e.g., "authentication", "forms"), components (e.g., "slider", "modal"), development stages (e.g., "deployment", "testing"), or "always" for fundamental concepts. Match these use_cases against the user\'s intent - for example, if building an e-commerce site, fetch sections with use_cases containing "e-commerce", "product listings", "shopping cart", etc. If building a slider, look for "slider", "carousel", "animation", etc. Returns sections as "* title: [section_title], use_cases: [use_cases], path: [file_path]". Always run list-sections FIRST for any Svelte query, then analyze ALL use_cases to identify relevant sections, and finally use get_documentation to fetch ALL relevant sections at once.',
icons,
},
async () => {
const formatted_sections = await format_sections_list();

View File

@@ -1,5 +1,6 @@
import type { SvelteMcp } from '../../index.js';
import * as v from 'valibot';
import { icons } from '../../icons/index.js';
async function compress_and_encode_text(input: string) {
const reader = new Blob([input]).stream().pipeThrough(new CompressionStream('gzip')).getReader();
@@ -54,6 +55,7 @@ export function playground_link(server: SvelteMcp) {
outputSchema: v.object({
url: v.string(),
}),
icons,
},
async ({ files, name, tailwind }) => {
const playground_base = new URL('https://svelte.dev/playground');

View File

@@ -4,6 +4,7 @@ import * as v from 'valibot';
import { add_compile_issues } from '../../autofixers/add-compile-issues.js';
import { add_eslint_issues } from '../../autofixers/add-eslint-issues.js';
import { add_autofixers_issues } from '../../autofixers/add-autofixers-issues.js';
import { icons } from '../../icons/index.js';
export function svelte_autofixer(server: SvelteMcp) {
server.tool(
@@ -38,6 +39,7 @@ export function svelte_autofixer(server: SvelteMcp) {
readOnlyHint: true,
openWorldHint: false,
},
icons,
},
async ({
code,

View File

@@ -0,0 +1,14 @@
export const icons = [
{
src: 'https://mcp.svelte.dev/logo.svg',
mimeType: 'image/svg+xml',
},
{
src: 'https://mcp.svelte.dev/logo.png',
mimeType: 'image/png',
},
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QHMcfIbVQ1hvx5G9KIBJ1TclemeheWxlN2RyzdrQLtJg2RE5JqnSQcO9jwxN/hmixqy3nMS8uFMUDGS6wJbVA3j+i8r1bJR4Vz+XFgb+9jXd/CtqxWgzYySHAzphDCiG4KHtvLwVh7i6ib8buHdyIUQ0xZi9KnCdVYNLmlvQk0XrPhn8MqIE/kvYWvfOjoBpj5oj1XDmVDjiScs/dAunrCfZ9WyvnQ8HXkXDe8Uy91BVguYI8sGI8jNRjxCnkfJM8/Do+V5ogrjdy6is4vhmi6PoucAy8QZj6h3E55H5D+V97/6VIA5nthNIKYguCLFzdQspHXZuF2X7wk7w1caOduAuQ/A3Qnhk6HlaOTjIGsLxKtvPpqF3Ll85zXhlSftrz4VYA7tfigHfvWcKH5xrp9KBsxe4h0exOcteOf5bn9OACZEfRrRXMb2rnAgcvE4eZ+AuZitI8yOwmwIz/CXdwZHf2xMvgHmhjzOPt2urDLk4vgjyKWFknyAREoMV9skuou/wVyuzJl0pouYuSWUt3Hw8mbems1jM/P/Pi/f4PXiMAW/TA2w5GVcokspS/y5NCF42y/UpZoFFFBAAQUUUEABJy3+B6BFBuObiHkkAAAAAElFTkSuQmCC',
mimeType: 'image/png',
},
];

View File

@@ -3,6 +3,7 @@ import { McpServer } from 'tmcp';
import { setup_prompts, setup_resources, setup_tools } from './handlers/index.js';
import type { LibSQLDatabase } from 'drizzle-orm/libsql';
import type { Schema } from '@sveltejs/mcp-schema';
import { icons } from './icons/index.js';
export const server = new McpServer(
{
@@ -10,16 +11,7 @@ export const server = new McpServer(
version: '0.0.1',
description: 'The official Svelte MCP server implementation',
websiteUrl: 'https://mcp.svelte.dev',
icons: [
{
src: 'https://mcp.svelte.dev/logo.svg',
mimeType: 'image/svg+xml',
},
{
src: 'https://mcp.svelte.dev/logo.png',
mimeType: 'image/png',
},
],
icons,
},
{
adapter: new ValibotJsonSchemaAdapter(),

View File

@@ -1,5 +1,15 @@
# @sveltejs/mcp
## 0.1.6
### Patch Changes
- fix: prevent `imported_runes` suggestion from being added for libs that are not svelte ([`87af64f`](https://github.com/sveltejs/mcp/commit/87af64f4bc6d07b75640eb987a33655654363997))
- feat: add svelte icon and website url for mcp server ([#75](https://github.com/sveltejs/mcp/pull/75))
- fix: use `data:` uri for local icon & add icons to tools + resources + prompts ([`cf62286`](https://github.com/sveltejs/mcp/commit/cf622869129382a97ad059bb1389f115907adc8e))
## 0.1.5
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@sveltejs/mcp",
"version": "0.1.5",
"version": "0.1.6",
"type": "module",
"license": "MIT",
"mcpName": "dev.svelte/mcp",
@@ -40,6 +40,7 @@
"vitest": "^3.1.3"
},
"dependencies": {
"eslint": "^9.36.0"
"eslint": "^9.36.0",
"tmcp": "^1.15.0"
}
}

View File

@@ -8,13 +8,13 @@
"subfolder": "packages/mcp-stdio",
"source": "github"
},
"version": "0.1.5",
"version": "0.1.6",
"websiteUrl": "https://svelte.dev/docs/mcp/overview",
"packages": [
{
"registryType": "npm",
"identifier": "@sveltejs/mcp",
"version": "0.1.5",
"version": "0.1.6",
"runtimeHint": "npx",
"transport": {
"type": "stdio"

44
pnpm-lock.yaml generated
View File

@@ -70,10 +70,10 @@ importers:
version: link:../../packages/mcp-server
'@tmcp/transport-http':
specifier: ^0.6.3
version: 0.6.3(tmcp@1.14.0(typescript@5.9.2))
version: 0.6.3(tmcp@1.15.0(typescript@5.9.2))
tmcp:
specifier: ^1.14.0
version: 1.14.0(typescript@5.9.2)
specifier: ^1.15.0
version: 1.15.0(typescript@5.9.2)
devDependencies:
'@eslint/compat':
specifier: ^1.3.2
@@ -197,8 +197,8 @@ importers:
version: 1.1.4
devDependencies:
'@anthropic-ai/sdk':
specifier: ^0.66.0
version: 0.66.0(zod@3.25.76)
specifier: ^0.67.0
version: 0.67.0(zod@3.25.76)
'@sveltejs/kit':
specifier: ^2.42.2
version: 2.43.5(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.39.6)(vite@7.1.7(@types/node@24.5.2)(jiti@2.6.0)(tsx@4.20.6)))(svelte@5.39.6)(vite@7.1.7(@types/node@24.5.2)(jiti@2.6.0)(tsx@4.20.6))
@@ -220,6 +220,9 @@ importers:
eslint:
specifier: ^9.36.0
version: 9.36.0(jiti@2.6.0)
tmcp:
specifier: ^1.15.0
version: 1.15.0(typescript@5.9.2)
devDependencies:
'@sveltejs/mcp-server':
specifier: workspace:^
@@ -245,8 +248,8 @@ importers:
packages:
'@anthropic-ai/sdk@0.66.0':
resolution: {integrity: sha512-GBSSby0P4BW/sOdvsTXaHJDPnGEL5tuB4TtsU4SXG7+dVULQ9MkKgNznCALDCgSV5yhrtQlctvEdMqePVIXTiw==}
'@anthropic-ai/sdk@0.67.0':
resolution: {integrity: sha512-Buxbf6jYJ+pPtfCgXe1pcFtZmdXPrbdqhBjiscFt9irS1G0hCsmR/fPA+DwKTk4GPjqeNnnCYNecXH6uVZ4G/A==}
hasBin: true
peerDependencies:
zod: ^3.25.0 || ^4.0.0
@@ -1764,10 +1767,6 @@ packages:
resolution: {integrity: sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==}
engines: {node: '>=12'}
ansis@4.1.0:
resolution: {integrity: sha512-BGcItUBWSMRgOCe+SVZJ+S7yTRG0eGt9cXAHev72yuGcY23hnLA7Bky5L/xLyPINoSN95geovfBkqoTlNZYa7w==}
engines: {node: '>=14'}
ansis@4.2.0:
resolution: {integrity: sha512-HqZ5rWlFjGiV0tDm3UxxgNRqsOTniqoKZu0pIAfh7TZQMGuZK+hH0drySty0si0QXj1ieop4+SkSfPZBPPkHig==}
engines: {node: '>=14'}
@@ -3698,9 +3697,6 @@ packages:
resolution: {integrity: sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==}
engines: {node: '>=14.0.0'}
tmcp@1.14.0:
resolution: {integrity: sha512-9TUZ6Qm2yNjqXcEyqjvsK38n/7z937ingf2fQtXLcUfcS5n9fsweuWRgKvaDCoCiE4Ibihoy7i+MqUWvHw/VNA==}
tmcp@1.15.0:
resolution: {integrity: sha512-ell+gBSC7T5P7ogrROYsoohfLSAu0aXmKzWH8eZqkMX4K0iGc+BYJJC4kb60uJcK7PRZWBOktNGuOq1BLNFA6Q==}
@@ -4087,7 +4083,7 @@ packages:
snapshots:
'@anthropic-ai/sdk@0.66.0(zod@3.25.76)':
'@anthropic-ai/sdk@0.67.0(zod@3.25.76)':
dependencies:
json-schema-to-ts: 3.1.1
optionalDependencies:
@@ -5291,10 +5287,10 @@ snapshots:
'@tmcp/session-manager@0.1.2': {}
'@tmcp/transport-http@0.6.3(tmcp@1.14.0(typescript@5.9.2))':
'@tmcp/transport-http@0.6.3(tmcp@1.15.0(typescript@5.9.2))':
dependencies:
'@tmcp/session-manager': 0.1.2
tmcp: 1.14.0(typescript@5.9.2)
tmcp: 1.15.0(typescript@5.9.2)
'@tmcp/transport-stdio@0.3.1(tmcp@1.15.0(typescript@5.9.2))':
dependencies:
@@ -5563,8 +5559,6 @@ snapshots:
ansi-styles@6.2.3: {}
ansis@4.1.0: {}
ansis@4.2.0: {}
arg@4.1.3: {}
@@ -7577,16 +7571,6 @@ snapshots:
tinyspy@4.0.4: {}
tmcp@1.14.0(typescript@5.9.2):
dependencies:
'@standard-schema/spec': 1.0.0
json-rpc-2.0: 1.7.1
sqids: 0.3.0
uri-template-matcher: 1.1.1
valibot: 1.1.0(typescript@5.9.2)
transitivePeerDependencies:
- typescript
tmcp@1.15.0(typescript@5.9.2):
dependencies:
'@standard-schema/spec': 1.0.0
@@ -7646,7 +7630,7 @@ snapshots:
tsdown@0.15.6(publint@0.3.13)(typescript@5.9.2):
dependencies:
ansis: 4.1.0
ansis: 4.2.0
cac: 6.7.14
chokidar: 4.0.3
debug: 4.4.3