From f6a264d55e6dd2171a3211af7091a16496d5f34d Mon Sep 17 00:00:00 2001 From: John Leider Date: Wed, 12 Aug 2026 23:44:50 -0500 Subject: [PATCH 1/3] feat(create): write hosted MCP client config --features=mcp now writes project Cursor, Claude, and Grok MCP configs for the hosted vuetify-mcp server instead of only adding the package. --- packages/shared/src/features/mcp.ts | 35 +++++++++++++++++- packages/shared/src/i18n/locales/en.json | 2 +- packages/shared/src/utils/projectDocs.ts | 46 ++++++++++++++++-------- 3 files changed, 67 insertions(+), 16 deletions(-) diff --git a/packages/shared/src/features/mcp.ts b/packages/shared/src/features/mcp.ts index b62ad85..a495778 100644 --- a/packages/shared/src/features/mcp.ts +++ b/packages/shared/src/features/mcp.ts @@ -1,10 +1,43 @@ import type { Feature } from './types' +import { mkdir, writeFile } from 'node:fs/promises' +import { join } from 'pathe' +import { DEFAULT_VUETIFY_MCP_SERVER_ID, DEFAULT_VUETIFY_REMOTE_URL } from '../mcp-core' import rootPkg from './dependencies/package.json' with { type: 'json' } export const mcp: Feature = { name: 'mcp', - apply: async ({ pkg }) => { + apply: async ({ cwd, pkg }) => { pkg.devDependencies = pkg.devDependencies || {} pkg.devDependencies['@vuetify/mcp'] = rootPkg.dependencies['@vuetify/mcp'] + + await writeMcpClientConfigs(cwd) }, } + +async function writeMcpClientConfigs (cwd: string) { + const json = getMcpClientJson() + const toml = getGrokMcpToml() + + await mkdir(join(cwd, '.cursor'), { recursive: true }) + await writeFile(join(cwd, '.cursor/mcp.json'), json) + + await writeFile(join(cwd, '.mcp.json'), json) + + await mkdir(join(cwd, '.grok'), { recursive: true }) + await writeFile(join(cwd, '.grok/config.toml'), toml) +} + +function getMcpClientJson () { + return `${JSON.stringify({ + mcpServers: { + [DEFAULT_VUETIFY_MCP_SERVER_ID]: { + type: 'http', + url: DEFAULT_VUETIFY_REMOTE_URL, + }, + }, + }, null, 2)}\n` +} + +function getGrokMcpToml () { + return `[mcp_servers.${DEFAULT_VUETIFY_MCP_SERVER_ID}]\nurl = "${DEFAULT_VUETIFY_REMOTE_URL}"\n` +} diff --git a/packages/shared/src/i18n/locales/en.json b/packages/shared/src/i18n/locales/en.json index 816fc10..034ab04 100644 --- a/packages/shared/src/i18n/locales/en.json +++ b/packages/shared/src/i18n/locales/en.json @@ -434,7 +434,7 @@ }, "mcp": { "label": "MCP", - "hint": "with @vuetify/mcp" + "hint": "hosted MCP + client config" } }, "client_hints": { diff --git a/packages/shared/src/utils/projectDocs.ts b/packages/shared/src/utils/projectDocs.ts index 96bb67f..ca65e54 100644 --- a/packages/shared/src/utils/projectDocs.ts +++ b/packages/shared/src/utils/projectDocs.ts @@ -1,4 +1,5 @@ import type { PackageJson } from 'pkg-types' +import { DEFAULT_VUETIFY_MCP_SERVER_ID, DEFAULT_VUETIFY_REMOTE_URL } from '../mcp-core' export interface ProjectDocsOptions { name: string @@ -118,6 +119,29 @@ function dlxCommand (pm: string, pkg: string) { return `npx -y ${pkg}` } +function mcpReadmeSection (pm: string) { + return ` +## ๐Ÿค– Vuetify MCP Server + +This project is wired to the hosted Vuetify MCP server (\`${DEFAULT_VUETIFY_REMOTE_URL}\`). Client config is already in the repo: + +- Cursor: \`.cursor/mcp.json\` +- Claude Code: \`.mcp.json\` โ€” approve/enable the project server when prompted +- Grok: \`.grok/config.toml\` (also reads \`.mcp.json\` / \`.cursor/mcp.json\` as compat) + +You do not need to run \`claude mcp add\` or \`grok mcp add\` if your client loads those files. + +If a client ignores project files, you can add the server yourself: + +\`\`\`bash +claude mcp add --transport http --scope project ${DEFAULT_VUETIFY_MCP_SERVER_ID} ${DEFAULT_VUETIFY_REMOTE_URL} +grok mcp add --transport http --scope project ${DEFAULT_VUETIFY_MCP_SERVER_ID} ${DEFAULT_VUETIFY_REMOTE_URL} +\`\`\` + +For other IDEs (VS Code, Windsurf, Trae, Claude Desktop), run \`${dlxCommand(pm, '@vuetify/mcp-cli')}\` or \`vuetify mcp install\`. +` +} + export function getProjectGitignore (options: ProjectDocsOptions) { if (options.platform === 'nuxt') { return `# Nuxt dev/build outputs @@ -194,6 +218,13 @@ export function getProjectAgentsMd (options: ProjectDocsOptions) { - Framework: ${frameworkLabel(options.platform)} - UI Library: ${uiLabel(options.type)} - Enabled Features: ${enabledFeatures} +${options.features.includes('mcp') + ? ` +## MCP +- Client config is already written (\`.cursor/mcp.json\`, \`.mcp.json\`, \`.grok/config.toml\`). +- Claude Code: approve the project server if prompted. +` + : ''} ` } @@ -264,20 +295,7 @@ ${build} ## ๐Ÿงช Available Scripts ${formatScripts(options.scripts, pm)} -${options.features.includes('mcp') - ? ` -## ๐Ÿค– Vuetify MCP Server - -This project is configured with the Vuetify Model Context Protocol (MCP) server. -To install and configure the MCP server for your favorite IDE (Cursor, Trae, Windsurf, VS Code, Claude Desktop, etc.) run: - -\`\`\`bash -${dlxCommand(pm, '@vuetify/mcp-cli')} -\`\`\` - -This will open an interactive setup wizard to help you connect your AI assistant to the Vuetify ecosystem. -` - : ''} +${options.features.includes('mcp') ? mcpReadmeSection(pm) : ''} ## ๐Ÿ’ช Support Vuetify Development This project uses ${uiLabel(options.type)} - an MIT licensed Open Source project. We are glad to welcome contributors and any support for ongoing development: From c25b603bd71c2d7dc689fc0b65f5a5c5432a6ae8 Mon Sep 17 00:00:00 2001 From: John Leider Date: Thu, 13 Aug 2026 07:53:47 -0500 Subject: [PATCH 2/3] feat(create): write Codex and Kimi Code MCP configs --features=mcp also writes project-scoped .codex/config.toml and .kimi-code/mcp.json for the hosted vuetify-mcp server. --- packages/shared/src/features/mcp.ts | 6 ++++++ packages/shared/src/utils/projectDocs.ts | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/shared/src/features/mcp.ts b/packages/shared/src/features/mcp.ts index a495778..28b6d10 100644 --- a/packages/shared/src/features/mcp.ts +++ b/packages/shared/src/features/mcp.ts @@ -25,6 +25,12 @@ async function writeMcpClientConfigs (cwd: string) { await mkdir(join(cwd, '.grok'), { recursive: true }) await writeFile(join(cwd, '.grok/config.toml'), toml) + + await mkdir(join(cwd, '.codex'), { recursive: true }) + await writeFile(join(cwd, '.codex/config.toml'), toml) + + await mkdir(join(cwd, '.kimi-code'), { recursive: true }) + await writeFile(join(cwd, '.kimi-code/mcp.json'), json) } function getMcpClientJson () { diff --git a/packages/shared/src/utils/projectDocs.ts b/packages/shared/src/utils/projectDocs.ts index ca65e54..d2daff1 100644 --- a/packages/shared/src/utils/projectDocs.ts +++ b/packages/shared/src/utils/projectDocs.ts @@ -128,6 +128,8 @@ This project is wired to the hosted Vuetify MCP server (\`${DEFAULT_VUETIFY_REMO - Cursor: \`.cursor/mcp.json\` - Claude Code: \`.mcp.json\` โ€” approve/enable the project server when prompted - Grok: \`.grok/config.toml\` (also reads \`.mcp.json\` / \`.cursor/mcp.json\` as compat) +- Codex: \`.codex/config.toml\` โ€” project must be trusted for Codex to load project config +- Kimi Code: \`.kimi-code/mcp.json\` โ€” approve workspace trust when prompted You do not need to run \`claude mcp add\` or \`grok mcp add\` if your client loads those files. @@ -136,8 +138,11 @@ If a client ignores project files, you can add the server yourself: \`\`\`bash claude mcp add --transport http --scope project ${DEFAULT_VUETIFY_MCP_SERVER_ID} ${DEFAULT_VUETIFY_REMOTE_URL} grok mcp add --transport http --scope project ${DEFAULT_VUETIFY_MCP_SERVER_ID} ${DEFAULT_VUETIFY_REMOTE_URL} +codex mcp add ${DEFAULT_VUETIFY_MCP_SERVER_ID} --url ${DEFAULT_VUETIFY_REMOTE_URL} \`\`\` +For Kimi Code, use the TUI \`/mcp-config\` command if project files are ignored. + For other IDEs (VS Code, Windsurf, Trae, Claude Desktop), run \`${dlxCommand(pm, '@vuetify/mcp-cli')}\` or \`vuetify mcp install\`. ` } @@ -221,7 +226,7 @@ export function getProjectAgentsMd (options: ProjectDocsOptions) { ${options.features.includes('mcp') ? ` ## MCP -- Client config is already written (\`.cursor/mcp.json\`, \`.mcp.json\`, \`.grok/config.toml\`). +- Client config is already written (\`.cursor/mcp.json\`, \`.mcp.json\`, \`.grok/config.toml\`, \`.codex/config.toml\`, \`.kimi-code/mcp.json\`). - Claude Code: approve the project server if prompted. ` : ''} From 77b466c657550983e4d103a7ff12a9d3e8ca50b5 Mon Sep 17 00:00:00 2001 From: John Leider Date: Thu, 13 Aug 2026 07:55:28 -0500 Subject: [PATCH 3/3] fix(create): write Kimi MCP config as url-only Kimi Code documents `{ url }` only; `type: "http"` belongs on Cursor/Claude. --- packages/shared/src/features/mcp.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/shared/src/features/mcp.ts b/packages/shared/src/features/mcp.ts index 28b6d10..240333d 100644 --- a/packages/shared/src/features/mcp.ts +++ b/packages/shared/src/features/mcp.ts @@ -16,6 +16,7 @@ export const mcp: Feature = { async function writeMcpClientConfigs (cwd: string) { const json = getMcpClientJson() + const kimi = getKimiMcpJson() const toml = getGrokMcpToml() await mkdir(join(cwd, '.cursor'), { recursive: true }) @@ -30,7 +31,7 @@ async function writeMcpClientConfigs (cwd: string) { await writeFile(join(cwd, '.codex/config.toml'), toml) await mkdir(join(cwd, '.kimi-code'), { recursive: true }) - await writeFile(join(cwd, '.kimi-code/mcp.json'), json) + await writeFile(join(cwd, '.kimi-code/mcp.json'), kimi) } function getMcpClientJson () { @@ -44,6 +45,16 @@ function getMcpClientJson () { }, null, 2)}\n` } +function getKimiMcpJson () { + return `${JSON.stringify({ + mcpServers: { + [DEFAULT_VUETIFY_MCP_SERVER_ID]: { + url: DEFAULT_VUETIFY_REMOTE_URL, + }, + }, + }, null, 2)}\n` +} + function getGrokMcpToml () { return `[mcp_servers.${DEFAULT_VUETIFY_MCP_SERVER_ID}]\nurl = "${DEFAULT_VUETIFY_REMOTE_URL}"\n` }