diff --git a/apps/api/src/app/endpoints/accesses/access.controller.ts b/apps/api/src/app/endpoints/accesses/access.controller.ts index 517e19fb02..4d3c574762 100644 --- a/apps/api/src/app/endpoints/accesses/access.controller.ts +++ b/apps/api/src/app/endpoints/accesses/access.controller.ts @@ -192,6 +192,16 @@ export class AccessController { ); } + if ( + originalAccess.type === 'MCP' && + !this.configurationService.get('ENABLE_FEATURE_MCP') + ) { + throw new HttpException( + getReasonPhrase(StatusCodes.BAD_REQUEST), + StatusCodes.BAD_REQUEST + ); + } + if ( !isValidGranteeOfAccess({ granteeUserId: data.granteeUserId, diff --git a/apps/api/src/app/endpoints/accesses/accesses.controller.ts b/apps/api/src/app/endpoints/accesses/accesses.controller.ts index 5b43dde7d0..78db7a135b 100644 --- a/apps/api/src/app/endpoints/accesses/accesses.controller.ts +++ b/apps/api/src/app/endpoints/accesses/accesses.controller.ts @@ -182,6 +182,16 @@ export class AccessesController { ); } + if ( + originalAccess.type === 'MCP' && + !this.configurationService.get('ENABLE_FEATURE_MCP') + ) { + throw new HttpException( + getReasonPhrase(StatusCodes.BAD_REQUEST), + StatusCodes.BAD_REQUEST + ); + } + if ( !isValidGranteeOfAccess({ granteeUserId: data.granteeUserId,