mirror of
https://github.com/sveltejs/ai-tools.git
synced 2026-07-05 03:54:41 +08:00
46 lines
1.4 KiB
Markdown
46 lines
1.4 KiB
Markdown
---
|
|
title: Overview
|
|
---
|
|
|
|
OpenCode has a [plugin system](https://opencode.ai/docs/plugins/) 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 in OpenCode you can edit your [OpenCode config]() (either the global or the local one), adding `@sveltejs/opencode` to the list of plugins.
|
|
|
|
```json
|
|
{
|
|
"$schema": "https://opencode.ai/config.json",
|
|
"plugin": ["@sveltejs/opencode"]
|
|
}
|
|
```
|
|
|
|
That's it! You now have the Svelte MCP server, [skills](skills), and the [file editor subagent](opencode-subagent) configured for you.
|
|
|
|
## Configuration
|
|
|
|
The default configuration for the Svelte OpenCode plugin looks like this...
|
|
|
|
```json
|
|
{
|
|
"$schema": "https://raw.githubusercontent.com/sveltejs/mcp/refs/heads/main/packages/opencode/schema.json",
|
|
"mcp": {
|
|
"type": "remote",
|
|
"enabled": true
|
|
},
|
|
"subagent": {
|
|
"enabled": true
|
|
},
|
|
"skills": {
|
|
"enabled": true
|
|
},
|
|
"instructions": {
|
|
"enabled": true
|
|
}
|
|
}
|
|
```
|
|
|
|
...but if you prefer, you can enable only the subagent, only the MCP, only the skills, or configure the kind of MCP server you want to use (`local` or `remote`).
|
|
|
|
You can place this file in `./.opencode/svelte.json` (in your project), in `~/.config/opencode/svelte.json` or, if you have an `OPENCODE_CONFIG_DIR` environment variable specified, at `$OPENCODE_CONFIG_DIR/svelte.json`.
|