@velt-js/mcp-installer 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -159,6 +159,16 @@ export function ensureUseClient(filePath, content) {
159
159
  };
160
160
  }
161
161
 
162
+ // Never add "use client" to files that export metadata or generateMetadata
163
+ // (these are Next.js server-only exports that conflict with "use client")
164
+ if (/export\s+(const\s+metadata|async\s+function\s+generateMetadata|function\s+generateMetadata)/.test(content)) {
165
+ return {
166
+ modified: false,
167
+ content,
168
+ reason: 'File exports metadata/generateMetadata (server-only) — cannot add "use client"',
169
+ };
170
+ }
171
+
162
172
  // Check if needs directive
163
173
  const check = needsUseClientDirective(content);
164
174