diff --git a/apps/cursor/src/components/plugins/detail/mcp-section.tsx b/apps/cursor/src/components/plugins/detail/mcp-section.tsx index f33a39e2..5a403ccc 100644 --- a/apps/cursor/src/components/plugins/detail/mcp-section.tsx +++ b/apps/cursor/src/components/plugins/detail/mcp-section.tsx @@ -12,6 +12,7 @@ import { buildMCPInstallDeepLink } from "./deeplinks"; function resolveMcpConfig( content: string | null, meta: Record, + fallbackName: string, ): { name: string; config: Record } | null { // Try content first, then metadata.config let parsed: Record | null = null; @@ -43,8 +44,13 @@ function resolveMcpConfig( } } - // Content is already a raw config (no mcpServers wrapper) - return { name: (meta?.name as string) ?? "server", config: parsed }; + // Content is already a raw config (no mcpServers wrapper). Ingestion strips + // the wrapper, so fall back to the component name before the generic default + // -- otherwise every such server installs as literally "server". + return { + name: (meta?.name as string) ?? fallbackName ?? "server", + config: parsed, + }; } export function McpSection({ @@ -70,10 +76,15 @@ export function McpSection({ let installLink = mcpLink ?? null; let configPreview: string | null = null; try { - const resolved = resolveMcpConfig(mcp.content, meta); + const resolved = resolveMcpConfig(mcp.content, meta, mcp.name); if (resolved) { - const serialized = JSON.stringify(resolved.config, null, 2); - configPreview = serialized; + // Show the wrapped form: this is what a user pastes into + // ~/.cursor/mcp.json. The bare inner object is not valid there. + configPreview = JSON.stringify( + { mcpServers: { [resolved.name]: resolved.config } }, + null, + 2, + ); if (!installLink) { installLink = buildMCPInstallDeepLink( resolved.name, @@ -133,8 +144,11 @@ export function McpSection({ mcp_link={installLink} onInstall={onInstall} /> - ) : installable && mcp.content ? ( - + ) : installable && (configPreview ?? mcp.content) ? ( + ) : null} @@ -142,8 +156,9 @@ export function McpSection({ {isExpanded && configPreview && (

- This config will be passed to Cursor on install. Inspect - `command`, `args`, and `env` before continuing. + This config will be passed to Cursor on install, and is + what you paste into `~/.cursor/mcp.json` to add the server by + hand. Inspect `command`, `args`, and `env` before continuing.

diff --git a/apps/cursor/src/lib/github-plugin/parse.ts b/apps/cursor/src/lib/github-plugin/parse.ts index 6fb62149..3cc8e97b 100644 --- a/apps/cursor/src/lib/github-plugin/parse.ts +++ b/apps/cursor/src/lib/github-plugin/parse.ts @@ -437,6 +437,7 @@ export async function parseGitHubPlugin( description: `MCP server: ${name}`, content: JSON.stringify(cfg, null, 2), metadata: { + name, command: cfg.command, args: cfg.args, env: cfg.env,