mirror of
https://github.com/sveltejs/ai-tools.git
synced 2026-07-05 12:12:00 +08:00
Compare commits
1 Commits
@sveltejs/
...
use-includ
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af8d994fa3 |
5
.changeset/happy-carrots-refuse.md
Normal file
5
.changeset/happy-carrots-refuse.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'@sveltejs/mcp': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: turn off no-inspect in eslint for mcp
|
||||||
5
.changeset/smart-loops-sniff.md
Normal file
5
.changeset/smart-loops-sniff.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'@sveltejs/opencode': minor
|
||||||
|
---
|
||||||
|
|
||||||
|
feat: distribute skills through opencode plugin
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
"description": "A plugin for all things Svelte development, MCP, skills, and more.",
|
"description": "A plugin for all things Svelte development, MCP, skills, and more.",
|
||||||
"lspServers": {
|
"lspServers": {
|
||||||
"svelte": {
|
"svelte": {
|
||||||
"command": "svelteserver",
|
"command": "svelte-language-server",
|
||||||
"args": ["--stdio"],
|
"args": ["--stdio"],
|
||||||
"extensionToLanguage": {
|
"extensionToLanguage": {
|
||||||
".svelte": "svelte"
|
".svelte": "svelte"
|
||||||
|
|||||||
71
.github/workflows/sync-agents-md.yml
vendored
71
.github/workflows/sync-agents-md.yml
vendored
@@ -1,71 +0,0 @@
|
|||||||
name: Sync Agents Documentation
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
paths:
|
|
||||||
- 'instructions/AGENTS.md'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
sync-agents:
|
|
||||||
# prevents this action from running on forks
|
|
||||||
if: github.repository == 'sveltejs/mcp'
|
|
||||||
name: Sync AGENTS.md to OpenCode Package and Docs
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
|
||||||
with:
|
|
||||||
node-version: 24
|
|
||||||
package-manager-cache: false # pnpm is not installed yet
|
|
||||||
|
|
||||||
- name: Install pnpm
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
PNPM_VER=$(jq -r '.packageManager | if .[0:5] == "pnpm@" then .[5:] else "packageManager in package.json does not start with pnpm@\n" | halt_error(1) end' package.json)
|
|
||||||
echo installing pnpm version $PNPM_VER
|
|
||||||
npm i -g pnpm@$PNPM_VER
|
|
||||||
|
|
||||||
- name: Sync AGENTS.md
|
|
||||||
run: pnpm sync-agents-md
|
|
||||||
|
|
||||||
- name: Check for changes
|
|
||||||
id: git-check
|
|
||||||
run: |
|
|
||||||
git diff --exit-code packages/opencode/instructions/opencode-agents.md documentation/docs/10-introduction/.generated/agents.md || echo "changed=true" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Create Pull Request
|
|
||||||
if: steps.git-check.outputs.changed == 'true'
|
|
||||||
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
commit-message: 'chore: sync AGENTS.md to opencode package and documentation'
|
|
||||||
branch: chore/sync-agents-md
|
|
||||||
delete-branch: true
|
|
||||||
title: 'chore: sync AGENTS.md to opencode package and documentation'
|
|
||||||
body: |
|
|
||||||
## Summary
|
|
||||||
Automatically synced AGENTS.md to the opencode package and documentation.
|
|
||||||
|
|
||||||
This PR was triggered by changes to `instructions/AGENTS.md`.
|
|
||||||
|
|
||||||
## Changes
|
|
||||||
- Synced `packages/opencode/instructions/opencode-agents.md` with latest AGENTS.md
|
|
||||||
- Updated `documentation/docs/10-introduction/.generated/agents.md` with latest content
|
|
||||||
|
|
||||||
## Generated by
|
|
||||||
GitHub Action: Sync Agents Documentation
|
|
||||||
labels: |
|
|
||||||
chore
|
|
||||||
documentation
|
|
||||||
automated
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
You are able to use the Svelte MCP server, where you have access to comprehensive Svelte 5 and SvelteKit documentation. Here's how to use the available tools effectively:
|
|
||||||
|
|
||||||
## Available Svelte MCP Tools:
|
|
||||||
|
|
||||||
### 1. list-sections
|
|
||||||
|
|
||||||
Use this FIRST to discover all available documentation sections. Returns a structured list with titles, use_cases, and paths.
|
|
||||||
When asked about Svelte or SvelteKit topics, ALWAYS use this tool at the start of the chat to find relevant sections.
|
|
||||||
|
|
||||||
### 2. get-documentation
|
|
||||||
|
|
||||||
Retrieves full documentation content for specific sections. Accepts single or multiple sections.
|
|
||||||
After calling the list-sections tool, you MUST analyze the returned documentation sections (especially the use_cases field) and then use the get-documentation tool to fetch ALL documentation sections that are relevant for the user's task.
|
|
||||||
|
|
||||||
### 3. svelte-autofixer
|
|
||||||
|
|
||||||
Analyzes Svelte code and returns issues and suggestions.
|
|
||||||
You MUST use this tool whenever writing Svelte code before sending it to the user. Keep calling it until no issues or suggestions are returned.
|
|
||||||
|
|
||||||
### 4. playground-link
|
|
||||||
|
|
||||||
Generates a Svelte Playground link with the provided code.
|
|
||||||
After completing the code, ask the user if they want a playground link. Only call this tool after user confirmation and NEVER if code was written to files in their project.
|
|
||||||
@@ -17,6 +17,30 @@ To get the most out of the MCP server we recommend including the following promp
|
|||||||
|
|
||||||
> [!NOTE] This is already setup for you when using `npx sv add mcp`
|
> [!NOTE] This is already setup for you when using `npx sv add mcp`
|
||||||
|
|
||||||
@include .generated/agents.md
|
```md
|
||||||
|
You are able to use the Svelte MCP server, where you have access to comprehensive Svelte 5 and SvelteKit documentation. Here's how to use the available tools effectively:
|
||||||
|
|
||||||
|
## Available MCP Tools:
|
||||||
|
|
||||||
|
### 1. list-sections
|
||||||
|
|
||||||
|
Use this FIRST to discover all available documentation sections. Returns a structured list with titles, use_cases, and paths.
|
||||||
|
When asked about Svelte or SvelteKit topics, ALWAYS use this tool at the start of the chat to find relevant sections.
|
||||||
|
|
||||||
|
### 2. get-documentation
|
||||||
|
|
||||||
|
Retrieves full documentation content for specific sections. Accepts single or multiple sections.
|
||||||
|
After calling the list-sections tool, you MUST analyze the returned documentation sections (especially the use_cases field) and then use the get-documentation tool to fetch ALL documentation sections that are relevant for the user's task.
|
||||||
|
|
||||||
|
### 3. svelte-autofixer
|
||||||
|
|
||||||
|
Analyzes Svelte code and returns issues and suggestions.
|
||||||
|
You MUST use this tool whenever writing Svelte code before sending it to the user. Keep calling it until no issues or suggestions are returned.
|
||||||
|
|
||||||
|
### 4. playground-link
|
||||||
|
|
||||||
|
Generates a Svelte Playground link with the provided code.
|
||||||
|
After completing the code, ask the user if they want a playground link. Only call this tool after user confirmation and NEVER if code was written to files in their project.
|
||||||
|
```
|
||||||
|
|
||||||
If your MCP client supports it, we also recommend using the [svelte-task](prompts#svelte-task) prompt to instruct the LLM on the best way to use the MCP server.
|
If your MCP client supports it, we also recommend using the [svelte-task](prompts#svelte-task) prompt to instruct the LLM on the best way to use the MCP server.
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
You are able to use the Svelte MCP server, where you have access to comprehensive Svelte 5 and SvelteKit documentation. Here's how to use the available tools effectively:
|
|
||||||
|
|
||||||
## Available Svelte MCP Tools:
|
|
||||||
|
|
||||||
### 1. list-sections
|
|
||||||
|
|
||||||
Use this FIRST to discover all available documentation sections. Returns a structured list with titles, use_cases, and paths.
|
|
||||||
When asked about Svelte or SvelteKit topics, ALWAYS use this tool at the start of the chat to find relevant sections.
|
|
||||||
|
|
||||||
### 2. get-documentation
|
|
||||||
|
|
||||||
Retrieves full documentation content for specific sections. Accepts single or multiple sections.
|
|
||||||
After calling the list-sections tool, you MUST analyze the returned documentation sections (especially the use_cases field) and then use the get-documentation tool to fetch ALL documentation sections that are relevant for the user's task.
|
|
||||||
|
|
||||||
### 3. svelte-autofixer
|
|
||||||
|
|
||||||
Analyzes Svelte code and returns issues and suggestions.
|
|
||||||
You MUST use this tool whenever writing Svelte code before sending it to the user. Keep calling it until no issues or suggestions are returned.
|
|
||||||
|
|
||||||
### 4. playground-link
|
|
||||||
|
|
||||||
Generates a Svelte Playground link with the provided code.
|
|
||||||
After completing the code, ask the user if they want a playground link. Only call this tool after user confirmation and NEVER if code was written to files in their project.
|
|
||||||
@@ -25,8 +25,7 @@
|
|||||||
"debug:generate-summaries": "pnpm --filter @sveltejs/mcp-server run debug:generate-summaries",
|
"debug:generate-summaries": "pnpm --filter @sveltejs/mcp-server run debug:generate-summaries",
|
||||||
"release": "pnpm --filter @sveltejs/mcp run build && changeset publish",
|
"release": "pnpm --filter @sveltejs/mcp run build && changeset publish",
|
||||||
"changeset:version": "changeset version && pnpm --filter @sveltejs/mcp run update:version && git add --all",
|
"changeset:version": "changeset version && pnpm --filter @sveltejs/mcp run update:version && git add --all",
|
||||||
"sync-opencode-skills": "rm -rf packages/opencode/skills && cp -r plugins/svelte/skills packages/opencode/skills",
|
"sync-opencode-skills": "rm -rf packages/opencode/skills && cp -r plugins/svelte/skills packages/opencode/skills"
|
||||||
"sync-agents-md": "rm -f packages/opencode/instructions/opencode-agents.md && rm -f documentation/docs/10-introduction/.generated/agents.md && mkdir -p packages/opencode/instructions && mkdir -p documentation/docs/10-introduction/.generated && cp instructions/AGENTS.md packages/opencode/instructions/opencode-agents.md && cp instructions/AGENTS.md documentation/docs/10-introduction/.generated/agents.md"
|
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"svelte",
|
"svelte",
|
||||||
|
|||||||
@@ -1,11 +1,5 @@
|
|||||||
# @sveltejs/mcp
|
# @sveltejs/mcp
|
||||||
|
|
||||||
## 0.1.20
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- fix: turn off no-inspect in eslint for mcp ([`2245cb2`](https://github.com/sveltejs/mcp/commit/2245cb2dc9e2d217869b6a800795ce59ffb40c51))
|
|
||||||
|
|
||||||
## 0.1.19
|
## 0.1.19
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sveltejs/mcp",
|
"name": "@sveltejs/mcp",
|
||||||
"version": "0.1.20",
|
"version": "0.1.19",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"mcpName": "dev.svelte/mcp",
|
"mcpName": "dev.svelte/mcp",
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
"subfolder": "packages/mcp-stdio",
|
"subfolder": "packages/mcp-stdio",
|
||||||
"source": "github"
|
"source": "github"
|
||||||
},
|
},
|
||||||
"version": "0.1.20",
|
"version": "0.1.19",
|
||||||
"websiteUrl": "https://svelte.dev/docs/mcp/overview",
|
"websiteUrl": "https://svelte.dev/docs/mcp/overview",
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
{
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
{
|
{
|
||||||
"registryType": "npm",
|
"registryType": "npm",
|
||||||
"identifier": "@sveltejs/mcp",
|
"identifier": "@sveltejs/mcp",
|
||||||
"version": "0.1.20",
|
"version": "0.1.19",
|
||||||
"runtimeHint": "npx",
|
"runtimeHint": "npx",
|
||||||
"transport": {
|
"transport": {
|
||||||
"type": "stdio"
|
"type": "stdio"
|
||||||
|
|||||||
@@ -1,23 +1,5 @@
|
|||||||
# @sveltejs/opencode
|
# @sveltejs/opencode
|
||||||
|
|
||||||
## 0.1.2
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- feat: allow for local opencode config ([#156](https://github.com/sveltejs/mcp/pull/156))
|
|
||||||
|
|
||||||
## 0.1.1
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- fix: actually push skills to right config path ([`c2c1b3e`](https://github.com/sveltejs/mcp/commit/c2c1b3e5e788b14eea17cd37a83ca55433cc4072))
|
|
||||||
|
|
||||||
## 0.1.0
|
|
||||||
|
|
||||||
### Minor Changes
|
|
||||||
|
|
||||||
- feat: distribute skills through opencode plugin ([#151](https://github.com/sveltejs/mcp/pull/151))
|
|
||||||
|
|
||||||
## 0.0.3
|
## 0.0.3
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -71,15 +71,8 @@ function get_config_paths() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Project-local: ./.opencode/svelte.json (cwd)
|
// returning config_dir first so it has higher priority
|
||||||
let project_path: string | null = null;
|
return [config_dir_path, global_path];
|
||||||
const project_config = join(process.cwd(), '.opencode', 'svelte.json');
|
|
||||||
if (existsSync(project_config)) {
|
|
||||||
project_path = project_config;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Lowest priority first, highest priority last (project overrides global)
|
|
||||||
return [global_path, config_dir_path, project_path];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function load_config_file(config_path: string): ConfigLoadResult {
|
function load_config_file(config_path: string): ConfigLoadResult {
|
||||||
@@ -128,9 +121,6 @@ function merge_with_defaults(user_config: Partial<McpConfig>): McpConfig {
|
|||||||
|
|
||||||
export function get_mcp_config(ctx: PluginInput) {
|
export function get_mcp_config(ctx: PluginInput) {
|
||||||
const config_paths = get_config_paths();
|
const config_paths = get_config_paths();
|
||||||
let merged: Partial<McpConfig> = {};
|
|
||||||
|
|
||||||
// Iterate from lowest to highest priority, merging as we go
|
|
||||||
for (const path of config_paths) {
|
for (const path of config_paths) {
|
||||||
if (path && existsSync(path)) {
|
if (path && existsSync(path)) {
|
||||||
const result = load_config_file(path);
|
const result = load_config_file(path);
|
||||||
@@ -139,28 +129,23 @@ export function get_mcp_config(ctx: PluginInput) {
|
|||||||
ctx.client.tui.showToast({
|
ctx.client.tui.showToast({
|
||||||
body: {
|
body: {
|
||||||
title: 'Svelte: Invalid opencode plugin config',
|
title: 'Svelte: Invalid opencode plugin config',
|
||||||
message: `${result.parse_error} (${path})\nSkipping this config file`,
|
message: `${result.parse_error}\nUsing default values`,
|
||||||
variant: 'warning',
|
variant: 'warning',
|
||||||
duration: 7000,
|
duration: 7000,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}, 7000);
|
}, 7000);
|
||||||
continue;
|
return default_config;
|
||||||
}
|
}
|
||||||
const parsed = v.safeParse(config_schema, result.data);
|
const parsed = v.safeParse(config_schema, result.data);
|
||||||
if (parsed.success) {
|
if (parsed.success) {
|
||||||
merged = {
|
return merge_with_defaults(parsed.output);
|
||||||
mcp: { ...merged.mcp, ...parsed.output.mcp },
|
|
||||||
subagent: { ...merged.subagent, ...parsed.output.subagent },
|
|
||||||
instructions: { ...merged.instructions, ...parsed.output.instructions },
|
|
||||||
skills: { ...merged.skills, ...parsed.output.skills },
|
|
||||||
};
|
|
||||||
} else {
|
} else {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
ctx.client.tui.showToast({
|
ctx.client.tui.showToast({
|
||||||
body: {
|
body: {
|
||||||
title: 'Svelte: Invalid opencode plugin config',
|
title: 'Svelte: Invalid opencode plugin config',
|
||||||
message: `Invalid config schema (${path})\nSkipping this config file`,
|
message: `${result.parse_error}\nUsing default values`,
|
||||||
variant: 'warning',
|
variant: 'warning',
|
||||||
duration: 7000,
|
duration: 7000,
|
||||||
},
|
},
|
||||||
@@ -170,5 +155,5 @@ export function get_mcp_config(ctx: PluginInput) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return merge_with_defaults(merged);
|
return default_config;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,9 +13,7 @@ export const svelte_plugin: Plugin = async (ctx) => {
|
|||||||
input.mcp ??= {};
|
input.mcp ??= {};
|
||||||
input.instructions ??= [];
|
input.instructions ??= [];
|
||||||
// @ts-expect-error -- types are wrong in the opencode package...will fix there and remove this
|
// @ts-expect-error -- types are wrong in the opencode package...will fix there and remove this
|
||||||
input.skills ??= {};
|
input.skills ??= [];
|
||||||
// @ts-expect-error -- types are wrong in the opencode package...will fix there and remove this
|
|
||||||
input.skills.paths ??= [];
|
|
||||||
// by default we use svelte as the name for the svelte MCP server
|
// by default we use svelte as the name for the svelte MCP server
|
||||||
let svelte_mcp_name = 'svelte';
|
let svelte_mcp_name = 'svelte';
|
||||||
// we loop over every mcp server to see if any of them is already the svelte MCP server
|
// we loop over every mcp server to see if any of them is already the svelte MCP server
|
||||||
@@ -42,7 +40,7 @@ export const svelte_plugin: Plugin = async (ctx) => {
|
|||||||
if (mcp_config.skills?.enabled !== false) {
|
if (mcp_config.skills?.enabled !== false) {
|
||||||
const skills_dir = join(current_dir, 'skills');
|
const skills_dir = join(current_dir, 'skills');
|
||||||
// @ts-expect-error -- skills is a new opencode feature
|
// @ts-expect-error -- skills is a new opencode feature
|
||||||
input.skills.paths.push(skills_dir);
|
input.skills.push(skills_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the user doesn't have the MCP server already we add one based on config
|
// if the user doesn't have the MCP server already we add one based on config
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
You are able to use the Svelte MCP server, where you have access to comprehensive Svelte 5 and SvelteKit documentation. Here's how to use the available tools effectively:
|
You are able to use the Svelte MCP server, where you have access to comprehensive Svelte 5 and SvelteKit documentation. Here's how to use the available tools effectively:
|
||||||
|
|
||||||
## Available Svelte MCP Tools:
|
## Available MCP Tools:
|
||||||
|
|
||||||
### 1. list-sections
|
### 1. list-sections
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sveltejs/opencode",
|
"name": "@sveltejs/opencode",
|
||||||
"version": "0.1.2",
|
"version": "0.0.3",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"homepage": "https://github.com/sveltejs/mcp#readme",
|
"homepage": "https://github.com/sveltejs/mcp#readme",
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "svelte",
|
"name": "svelte",
|
||||||
"description": "A plugin for all things related to Svelte development, MCP, skills, and more.",
|
"description": "A plugin for all things related to Svelte development, MCP, skills, and more.",
|
||||||
"version": "1.0.1",
|
"version": "1.0.0",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Svelte"
|
"name": "Svelte"
|
||||||
},
|
},
|
||||||
"lspServers": {
|
"lspServers": {
|
||||||
"svelte": {
|
"svelte": {
|
||||||
"command": "svelteserver",
|
"command": "svelte-language-server",
|
||||||
"args": ["--stdio"],
|
"args": ["--stdio"],
|
||||||
"extensionToLanguage": {
|
"extensionToLanguage": {
|
||||||
".svelte": "svelte"
|
".svelte": "svelte"
|
||||||
|
|||||||
Reference in New Issue
Block a user