Skip to content

Commit 05f75b6

Browse files
Sync mcp docs (#1734)
sync mcp docs Co-authored-by: svelte-docs-bot[bot] <196124396+svelte-docs-bot[bot]@users.noreply.github.com>
1 parent d7dc8e4 commit 05f75b6

File tree

5 files changed

+58
-2
lines changed

5 files changed

+58
-2
lines changed

apps/svelte.dev/content/docs/mcp/20-setup/20-local-setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The `[scope]` must be `user`, `project` or `local`.
5858

5959
## OpenCode
6060

61-
Run the command:
61+
You can automatically configure the MCP server using the [OpenCode plugin](opencode-plugin) (recommended). If you prefer to configure the MCP server manually, run:
6262

6363
```bash
6464
opencode mcp add

apps/svelte.dev/content/docs/mcp/20-setup/30-remote-setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ The `[scope]` must be `user` or `project`.
4949

5050
## OpenCode
5151

52-
Run the command:
52+
You can automatically configure the MCP server using the [OpenCode plugin](opencode-plugin) (recommended). If you prefer to configure the MCP server manually, run:
5353

5454
```bash
5555
opencode mcp add
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
NOTE: do not edit this file, it is generated in apps/svelte.dev/scripts/sync-docs/index.ts
3+
title: OpenCode Plugin
4+
---
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
NOTE: do not edit this file, it is generated in apps/svelte.dev/scripts/sync-docs/index.ts
3+
title: Overview
4+
---
5+
6+
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`.
7+
8+
## Installation
9+
10+
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.
11+
12+
```json
13+
{
14+
"$schema": "https://opencode.ai/config.json",
15+
"plugin": ["@sveltejs/opencode"]
16+
}
17+
```
18+
19+
That's it! You now have the Svelte MCP server and the [file editor subagent](opencode-subagent) configured for you.
20+
21+
## Configuration
22+
23+
The default configuration for the Svelte OpenCode plugin looks like this...
24+
25+
```json
26+
{
27+
"$schema": "https://raw.githubusercontent.com/sveltejs/mcp/refs/heads/main/packages/opencode/schema.json",
28+
"mcp": {
29+
"type": "remote",
30+
"enabled": true
31+
},
32+
"subagent": {
33+
"enabled": true
34+
}
35+
}
36+
```
37+
38+
...but if you prefer, you can enable only the subagent, only the MCP, or configure the kind of MCP server you want to use (`local` or `remote`).
39+
40+
You can place this file in `~/.config/opencode/svelte.json` or, if you have an `OPENCODE_CONFIG_DIR` environment variable specified, at `$OPENCODE_CONFIG_DIR/svelte.json`.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
NOTE: do not edit this file, it is generated in apps/svelte.dev/scripts/sync-docs/index.ts
3+
title: Subagent
4+
---
5+
6+
The Svelte plugin includes a specialized subagent called `svelte-file-editor` designed for creating, editing, and reviewing Svelte files.
7+
8+
## Benefits
9+
10+
The subagent has access to its own context window, allowing it to fetch the documentation, iterate with the `svelte-autofixer` tool and write to the file system without wasting context in the main agent.
11+
12+
The delegation should happen automatically when appropriate, but you can also explicitly request the subagent be used for Svelte-related tasks.

0 commit comments

Comments
 (0)