Skip to main content

Local setup

The local (or stdio) version of the MCP server is available via the @sveltejs/mcp npm package. You can either install it globally and then reference it in your configuration or run it with npx:

npx -y @sveltejs/mcp

Here's how to set it up in some common MCP clients:

Claude Code

To include the local MCP version in Claude Code, simply run the following command:

claude mcp add -t stdio -s [scope] svelte -- npx -y @sveltejs/mcp

The [scope] must be user, project or local.

Claude Desktop

In the Settings > Developer section, click on Edit Config. It will open the folder with a claude_desktop_config.json file in it. Edit the file to include the following configuration:

{
	"mcpServers": {
		"svelte": {
			"command": "npx",
			"args": ["-y", "@sveltejs/mcp"]
		}
	}
}

Codex CLI

You can automatically configure the MCP server using the Codex plugin (recommended). If you prefer to configure the MCP server manually, add the following to your config.toml (which defaults to ~/.codex/config.toml, but refer to the configuration documentation for more advanced setups):

[mcp_servers.svelte]
command = "npx"
args = ["-y", "@sveltejs/mcp"]

Copilot CLI

You can automatically configure the MCP server using the Copilot plugin (recommended). If you prefer to configure the MCP server manually, use the Copilot CLI to interactively add the MCP server:

/mcp add

Alternatively, create or edit ~/.copilot/mcp-config.json and add the following configuration:

{
	"mcpServers": {
		"svelte": {
			"command": "npx",
			"args": ["-y", "@sveltejs/mcp"]
		}
	}
}

Antigravity CLI

To use the local MCP version in Antigravity CLI, create or edit ~/.gemini/config/mcp_config.json and add the following configuration:

{
	"mcpServers": {
		"svelte": {
			"command": "npx",
			"args": ["-y", "@sveltejs/mcp"]
		}
	}
}

OpenCode

You can automatically configure the MCP server using the OpenCode plugin (recommended). If you prefer to configure the MCP server manually, run:

opencode mcp add

and follow the instructions, selecting 'Local' under the 'Select MCP server type' prompt:

opencode mcp add

  Add MCP server

  Enter MCP server name
  svelte

  Select MCP server type
  Local

  Enter command to run
  npx -y @sveltejs/mcp

VS Code

  • Open the command palette
  • Select "MCP: Add Server..."
  • Select "Command (stdio)"
  • Insert npx -y @sveltejs/mcp in the input and press Enter
  • When prompted for a name, insert svelte
  • Select if you want to add it as a Global or Workspace MCP server

Cursor

You can automatically configure the MCP server using the Cursor plugin (recommended). If you prefer to configure the MCP server manually you can:

  • Open the command palette
  • Select "View: Open MCP Settings"
  • Click on "Add custom MCP"

It will open a file with your MCP servers where you can add the following configuration:

{
	"mcpServers": {
		"svelte": {
			"command": "npx",
			"args": ["-y", "@sveltejs/mcp"]
		}
	}
}

Zed

Install the Svelte MCP Server extension.

Configure Manually
  • Open the command palette
  • Search and select "agent:open settings"
  • In settings panel look for Model Context Protocol (MCP) Servers
  • Click on "Add Server"
  • Select: "Add Custom Server"

It will open a popup with MCP server config where you can add the following configuration:

{
	"svelte": {
		"command": "npx",
		"args": ["-y", "@sveltejs/mcp"]
	}
}

Other clients

If we didn't include the MCP client you are using, refer to their documentation for stdio servers and use npx as the command and -y @sveltejs/mcp as the arguments.

Edit this page on GitHub llms.txt

previous next