Skip to content

Commit 2ae7a4b

Browse files
committed
fix: add support for remote http with npx
1 parent b8b0b7f commit 2ae7a4b

File tree

6 files changed

+43
-12
lines changed

6 files changed

+43
-12
lines changed

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,18 @@ By connecting your development environment to the Vuetify MCP server, you gain A
2626

2727
## Quick Start
2828

29-
Run Vuetify MCP with a single command:
29+
### Hosted HTTP Server (Easiest)
30+
31+
Use the hosted MCP server directly:
32+
33+
```bash
34+
# Claude Desktop
35+
claude mcp add --transport http vuetify-mcp https://mcp.vuetifyjs.com/mcp
36+
```
37+
38+
### Local Installation
39+
40+
Run Vuetify MCP locally:
3041

3142
```bash
3243
# Start the Vuetify MCP server
@@ -44,7 +55,10 @@ You can configure the Vuetify MCP server in your IDE or client by running the in
4455
The interactive CLI provides the simplest way to configure your environment:
4556

4657
```bash
47-
# Run the configuration helper
58+
# Configure for hosted remote server
59+
npx -y @vuetify/mcp config --remote
60+
61+
# Or configure for local installation
4862
npx -y @vuetify/mcp config
4963
```
5064

@@ -53,6 +67,7 @@ The CLI will:
5367
1. Detect supported IDEs on your system (VS Code, Claude, Cursor, Trae, Windsurf)
5468
2. Prompt you if multiple IDEs are found
5569
3. Apply the necessary settings automatically to your selected environment
70+
4. Use the hosted server (with `--remote`) or local installation
5671

5772
### Manual Configuration
5873

bin/cli.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ function buildServerArgs (args) {
3535
if (args.stateless) {
3636
serverArgs.push('--stateless')
3737
}
38+
if (args.remote) {
39+
serverArgs.push('--remote')
40+
}
3841
return serverArgs
3942
}
4043

@@ -73,6 +76,10 @@ const defaultArgs = {
7376
type: 'boolean',
7477
description: 'Run HTTP transport in stateless mode',
7578
},
79+
'remote': {
80+
type: 'boolean',
81+
description: 'Use hosted MCP server at https://mcp.vuetifyjs.com',
82+
},
7683
}
7784

7885
const config = defineCommand({

src/cli/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { installGlobally } from './install-globally.js'
77
import type { DetectedIDE } from './ide/types.js'
88
import { npx } from './settings-builder.js'
99

10+
const useRemote = process.argv.includes('--remote')
11+
1012
const ides = await detectIDEs()
1113

1214
if (ides.length === 0) {
@@ -29,11 +31,11 @@ if (ides.length === 1) {
2931
}
3032

3133
if (idesToInstall === null) {
32-
config()
34+
config(undefined, useRemote)
3335
process.exit(0)
3436
}
3537

36-
config(idesToInstall as DetectedIDE)
38+
config(idesToInstall as DetectedIDE, useRemote)
3739

3840
if ((!npx || !npx?.pure) && (idesToInstall as DetectedIDE).ide === 'claude') {
3941
log.warn(`Claude probably will fail with resolving your \`npx\`. ${link('See more', 'https://github.com/modelcontextprotocol/servers/issues/64#issuecomment-2878569805')}`)

src/cli/install-globally.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { parse } from 'jsonc-parser'
22
import { writeFile, readFile } from 'node:fs/promises'
33
import { existsSync } from 'node:fs'
44
import { resolve } from 'pathe'
5-
import { serverConfig, getSettingsPath } from './settings-builder.js'
5+
import { getServerConfig, getSettingsPath } from './settings-builder.js'
66
import type { DetectedIDE } from './ide/types.js'
77
import { deepset } from './utils/deepset.js'
88

@@ -12,6 +12,7 @@ async function setIdeSettings (ideInstance: DetectedIDE) {
1212
}
1313
const configFilePath = resolve(ideInstance.settingsDir, ideInstance.settingsFile)
1414
const settingsPath = getSettingsPath(ideInstance.ide)
15+
const serverConfig = getServerConfig()
1516
if (existsSync(configFilePath)) {
1617
const fileContent = await readFile(configFilePath, { encoding: 'utf8' })
1718
const existingConfig = parse(fileContent)

src/cli/intro.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const intro = (): void => {
2525
console.warn(startMessage)
2626
}
2727

28-
export const config = (ide: DetectedIDE = defaultIde): void => {
29-
const message = `\n${configMessage(ide)}\n\n${getSettingsBuilder(ide.ide)}`
28+
export const config = (ide: DetectedIDE = defaultIde, remote?: boolean): void => {
29+
const message = `\n${configMessage(ide)}\n\n${getSettingsBuilder(ide.ide, undefined, remote)}`
3030
console.warn(message)
3131
}

src/cli/settings-builder.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,23 @@ export const getSettingsPath = (ide: IDEId): string => {
6262
}
6363
}
6464

65-
export const serverConfig = npx?.wsl ? wslConfig : defaultConfig
65+
export const remoteConfig = {
66+
url: 'https://mcp.vuetifyjs.com/mcp',
67+
}
6668

67-
export function getServerConfig (transport?: 'stdio' | 'http') {
69+
export function getServerConfig (transport?: 'stdio' | 'http', remote?: boolean) {
70+
// Remote always takes precedence
71+
if (remote) {
72+
return remoteConfig
73+
}
6874
if (transport === 'http') {
6975
return npx?.wsl ? wslHttpConfig : httpConfig
7076
}
71-
return serverConfig
77+
return npx?.wsl ? wslConfig : defaultConfig
7278
}
7379

74-
export const getSettingsBuilder = (ide: IDEId, transport?: 'stdio' | 'http'): string => {
75-
const config = getServerConfig(transport)
80+
export const getSettingsBuilder = (ide: IDEId, transport?: 'stdio' | 'http', remote?: boolean): string => {
81+
const config = getServerConfig(transport, remote)
7682
switch (ide) {
7783
case 'code':
7884
case 'code-insiders': {

0 commit comments

Comments
 (0)