File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ export default async function getServer(server: FastifyInstance) {
100100 let hasAccess = false ;
101101
102102 if ( userRole === 'global_admin' ) {
103- // Global admin can access all servers
103+ // Global admin can access all servers (including disabled)
104104 hasAccess = true ;
105105 } else if ( server . visibility === 'global' ) {
106106 // All authenticated users can access global servers
@@ -110,6 +110,11 @@ export default async function getServer(server: FastifyInstance) {
110110 hasAccess = teamIds . includes ( server . owner_team_id ) ;
111111 }
112112
113+ // Regular users (non-admin) cannot access disabled servers
114+ if ( hasAccess && userRole !== 'global_admin' && server . status === 'disabled' ) {
115+ hasAccess = false ;
116+ }
117+
113118 if ( ! hasAccess ) {
114119 request . log . info ( {
115120 operation : 'get_mcp_server' ,
Original file line number Diff line number Diff line change @@ -276,8 +276,14 @@ export class McpCatalogService {
276276 )
277277 )
278278 ) ;
279+
280+ // Regular users only see active servers (not disabled/deprecated/maintenance)
281+ // unless they explicitly filter by a specific status
282+ if ( ! filters ?. status ) {
283+ whereConditions . push ( eq ( this . mcpServers . status , 'active' ) ) ;
284+ }
279285 }
280-
286+
281287 // Apply additional filters
282288 if ( filters ) {
283289 if ( filters . category_id ) {
You can’t perform that action at this time.
0 commit comments