Skip to main content

OpenCode

OpenCode has a plugin system that allows developers to add MCP servers, agents and commands programmatically. Svelte has an OpenCode plugin published under @sveltejs/opencode.

Installation

To install the plugin you can edit your OpenCode config (either the global or the local one), adding @sveltejs/opencode to the list of plugins.

{
	"$schema": "https://opencode.ai/config.json",
	"plugin": ["@sveltejs/opencode"]
}

That's it! You now have the Svelte MCP server, skills, and the svelte-file-editor subagent configured for you.

Configuration

By default, everything is enabled, but you can configure the plugin by adding a configuration file:

  • locally, in .opencode/svelte.json
  • globally, in ~/.config/opencode/svelte.json (or, if you have specified the environment variable, in $OPENCODE_CONFIG_DIR/svelte.json)
{
	"$schema": "https://svelte.dev/opencode/schema.json",
	"mcp": {
		"type": "remote", // or "local" — defaults to remote
		"enabled": true
	},
	"subagent": {
		"enabled": true,
		"agents": {
			"svelte-file-editor": {
				"model": "<other-model>", // defaults to the same as main agent
				"temperature": 1, // defaults to unset
				"top_p": 0.7, // defaults to unset
				"maxSteps": 20 // defaults to unlimited
			}
		}
	},
	"skills": {
		// this can be `true`, or an array of skills to enable
		// e.g. ["svelte-core-bestpractices"]
		"enabled": true
	},
	"instructions": {
		"enabled": true
	}
}

Edit this page on GitHub llms.txt

previous next