File tree Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -287,10 +287,21 @@ function handleUnsupportedClientOnly(options: InstallMcpCommandOptions): Install
287
287
args . push ( "--api-url" , options . apiUrl ) ;
288
288
}
289
289
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 ) {
291
294
args . push ( "--dev-only" ) ;
292
295
}
293
296
297
+ if ( options . disableDeployment ) {
298
+ args . push ( "--disable-deployment" ) ;
299
+ }
300
+
301
+ if ( options . readonly ) {
302
+ args . push ( "--readonly" ) ;
303
+ }
304
+
294
305
if ( options . projectRef ) {
295
306
args . push ( "--project-ref" , options . projectRef ) ;
296
307
}
Original file line number Diff line number Diff line change @@ -130,7 +130,15 @@ export async function mcpCommand(options: McpCommandOptions) {
130
130
// Parse envOnly into an array if provided
131
131
let envOnly : string [ ] | undefined ;
132
132
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
+ ) ;
134
142
135
143
// Validate environment names
136
144
const validEnvironments = [ 'dev' , 'staging' , 'prod' , 'preview' ] ;
Original file line number Diff line number Diff line change @@ -189,9 +189,13 @@ export class McpContext {
189
189
}
190
190
191
191
public isEnvironmentAllowed ( environment : string ) : boolean {
192
+ // Normalize the environment name for comparison
193
+ const normalizedEnv = environment . trim ( ) . toLowerCase ( ) ;
194
+
192
195
// If envOnly is specified, use that (devOnly is already converted to envOnly)
193
196
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 ) ;
195
199
}
196
200
197
201
// If no restrictions, all environments are allowed
You can’t perform that action at this time.
0 commit comments