Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c152f3f

Browse filesBrowse files
committed
fix: address CodeRabbit review feedback
- Fix manual config for unsupported clients to include all new flags - Improve environment parsing to handle edge cases (empty strings, duplicates) - Normalize environment names (lowercase, trim) for consistent matching - Ensure envOnly takes precedence over devOnly in all places
1 parent f3d9d3f commit c152f3f
Copy full SHA for c152f3f

File tree

Expand file treeCollapse file tree

3 files changed

+26
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+26
-3
lines changed
Open diff view settings
Collapse file

‎packages/cli-v3/src/commands/install-mcp.ts‎

Copy file name to clipboardExpand all lines: packages/cli-v3/src/commands/install-mcp.ts
+12-1Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,21 @@ function handleUnsupportedClientOnly(options: InstallMcpCommandOptions): Install
287287
args.push("--api-url", options.apiUrl);
288288
}
289289

290-
if (options.devOnly) {
290+
// Handle environment restrictions - envOnly takes precedence
291+
if (options.envOnly) {
292+
args.push("--env-only", options.envOnly);
293+
} else if (options.devOnly) {
291294
args.push("--dev-only");
292295
}
293296

297+
if (options.disableDeployment) {
298+
args.push("--disable-deployment");
299+
}
300+
301+
if (options.readonly) {
302+
args.push("--readonly");
303+
}
304+
294305
if (options.projectRef) {
295306
args.push("--project-ref", options.projectRef);
296307
}
Collapse file

‎packages/cli-v3/src/commands/mcp.ts‎

Copy file name to clipboardExpand all lines: packages/cli-v3/src/commands/mcp.ts
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,15 @@ export async function mcpCommand(options: McpCommandOptions) {
130130
// Parse envOnly into an array if provided
131131
let envOnly: string[] | undefined;
132132
if (options.envOnly) {
133-
envOnly = options.envOnly.split(',').map(env => env.trim());
133+
// Parse, normalize, and deduplicate environments
134+
envOnly = Array.from(
135+
new Set(
136+
options.envOnly
137+
.split(',')
138+
.map(env => env.trim().toLowerCase())
139+
.filter(Boolean) // Remove empty strings
140+
)
141+
);
134142

135143
// Validate environment names
136144
const validEnvironments = ['dev', 'staging', 'prod', 'preview'];
Collapse file

‎packages/cli-v3/src/mcp/context.ts‎

Copy file name to clipboardExpand all lines: packages/cli-v3/src/mcp/context.ts
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,13 @@ export class McpContext {
189189
}
190190

191191
public isEnvironmentAllowed(environment: string): boolean {
192+
// Normalize the environment name for comparison
193+
const normalizedEnv = environment.trim().toLowerCase();
194+
192195
// If envOnly is specified, use that (devOnly is already converted to envOnly)
193196
if (this.options.envOnly && this.options.envOnly.length > 0) {
194-
return this.options.envOnly.includes(environment);
197+
// Note: envOnly is already normalized to lowercase in mcp.ts
198+
return this.options.envOnly.includes(normalizedEnv);
195199
}
196200

197201
// If no restrictions, all environments are allowed

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.