Compare commits

..

7 Commits

Author SHA1 Message Date
paoloricciuti
0c0d7683b4 feat: allow for local opencode config 2026-02-06 17:10:19 +01:00
paoloricciuti
c764308d79 fix: update version of claude plugin 2026-01-31 10:02:31 +01:00
paoloricciuti
01a7e6a8d3 fix: correct command for svelte language server 2026-01-31 09:52:57 +01:00
Paolo Ricciuti
d8ed686e3a chore: use @include in docs (#152) 2026-01-30 16:30:52 -05:00
github-actions[bot]
6f0390d0a9 Version Packages (#153)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-30 16:23:09 +01:00
paoloricciuti
c2c1b3e5e7 fix: actually push skills to right config path 2026-01-30 16:20:36 +01:00
github-actions[bot]
cdfbb907b6 Version Packages (#147)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-30 16:03:12 +01:00
12 changed files with 56 additions and 26 deletions

View File

@@ -0,0 +1,5 @@
---
'@sveltejs/opencode': patch
---
feat: allow for local opencode config

View File

@@ -1,5 +0,0 @@
---
'@sveltejs/mcp': patch
---
fix: turn off no-inspect in eslint for mcp

View File

@@ -1,5 +0,0 @@
---
'@sveltejs/opencode': minor
---
feat: distribute skills through opencode plugin

View File

@@ -10,7 +10,7 @@
"description": "A plugin for all things Svelte development, MCP, skills, and more.",
"lspServers": {
"svelte": {
"command": "svelte-language-server",
"command": "svelteserver",
"args": ["--stdio"],
"extensionToLanguage": {
".svelte": "svelte"

View File

@@ -1,5 +1,11 @@
# @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
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@sveltejs/mcp",
"version": "0.1.19",
"version": "0.1.20",
"type": "module",
"license": "MIT",
"mcpName": "dev.svelte/mcp",

View File

@@ -9,7 +9,7 @@
"subfolder": "packages/mcp-stdio",
"source": "github"
},
"version": "0.1.19",
"version": "0.1.20",
"websiteUrl": "https://svelte.dev/docs/mcp/overview",
"icons": [
{
@@ -25,7 +25,7 @@
{
"registryType": "npm",
"identifier": "@sveltejs/mcp",
"version": "0.1.19",
"version": "0.1.20",
"runtimeHint": "npx",
"transport": {
"type": "stdio"

View File

@@ -1,5 +1,17 @@
# @sveltejs/opencode
## 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
### Patch Changes

View File

@@ -71,8 +71,15 @@ function get_config_paths() {
}
}
// returning config_dir first so it has higher priority
return [config_dir_path, global_path];
// Project-local: ./.opencode/svelte.json (cwd)
let project_path: string | null = null;
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 {
@@ -121,6 +128,9 @@ function merge_with_defaults(user_config: Partial<McpConfig>): McpConfig {
export function get_mcp_config(ctx: PluginInput) {
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) {
if (path && existsSync(path)) {
const result = load_config_file(path);
@@ -129,23 +139,28 @@ export function get_mcp_config(ctx: PluginInput) {
ctx.client.tui.showToast({
body: {
title: 'Svelte: Invalid opencode plugin config',
message: `${result.parse_error}\nUsing default values`,
message: `${result.parse_error} (${path})\nSkipping this config file`,
variant: 'warning',
duration: 7000,
},
});
}, 7000);
return default_config;
continue;
}
const parsed = v.safeParse(config_schema, result.data);
if (parsed.success) {
return merge_with_defaults(parsed.output);
merged = {
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 {
setTimeout(() => {
ctx.client.tui.showToast({
body: {
title: 'Svelte: Invalid opencode plugin config',
message: `${result.parse_error}\nUsing default values`,
message: `Invalid config schema (${path})\nSkipping this config file`,
variant: 'warning',
duration: 7000,
},
@@ -155,5 +170,5 @@ export function get_mcp_config(ctx: PluginInput) {
}
}
return default_config;
return merge_with_defaults(merged);
}

View File

@@ -13,7 +13,9 @@ export const svelte_plugin: Plugin = async (ctx) => {
input.mcp ??= {};
input.instructions ??= [];
// @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
let svelte_mcp_name = 'svelte';
// we loop over every mcp server to see if any of them is already the svelte MCP server
@@ -40,7 +42,7 @@ export const svelte_plugin: Plugin = async (ctx) => {
if (mcp_config.skills?.enabled !== false) {
const skills_dir = join(current_dir, 'skills');
// @ts-expect-error -- skills is a new opencode feature
input.skills.push(skills_dir);
input.skills.paths.push(skills_dir);
}
// if the user doesn't have the MCP server already we add one based on config

View File

@@ -1,6 +1,6 @@
{
"name": "@sveltejs/opencode",
"version": "0.0.3",
"version": "0.1.1",
"type": "module",
"license": "MIT",
"homepage": "https://github.com/sveltejs/mcp#readme",

View File

@@ -1,13 +1,13 @@
{
"name": "svelte",
"description": "A plugin for all things related to Svelte development, MCP, skills, and more.",
"version": "1.0.0",
"version": "1.0.1",
"author": {
"name": "Svelte"
},
"lspServers": {
"svelte": {
"command": "svelte-language-server",
"command": "svelteserver",
"args": ["--stdio"],
"extensionToLanguage": {
".svelte": "svelte"