Skip to content

Commit 915381c

Browse files
committed
feat(backend): add search endpoint for teams by MCP server with pagination
1 parent 7fac949 commit 915381c

File tree

5 files changed

+901
-0
lines changed

5 files changed

+901
-0
lines changed

services/backend/api-spec.json

Lines changed: 361 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34620,6 +34620,367 @@
3462034620
}
3462134621
}
3462234622
},
34623+
"/api/admin/mcp/servers/{serverId}/teams/search": {
34624+
"get": {
34625+
"summary": "Search teams using MCP server (Global Admin)",
34626+
"tags": [
34627+
"Admin - MCP Servers"
34628+
],
34629+
"description": "Search and filter teams that have installed a specific MCP server. Supports filtering by team name and slug (partial, case-insensitive). Results are paginated with limit (1-100, default: 20) and offset (default: 0) parameters.",
34630+
"parameters": [
34631+
{
34632+
"schema": {
34633+
"type": "string"
34634+
},
34635+
"in": "query",
34636+
"name": "name",
34637+
"required": false,
34638+
"description": "Filter by team name or slug (partial match, case-insensitive)"
34639+
},
34640+
{
34641+
"schema": {
34642+
"type": "string",
34643+
"pattern": "^\\d+$"
34644+
},
34645+
"in": "query",
34646+
"name": "limit",
34647+
"required": false,
34648+
"description": "Maximum number of items to return (1-100, default: 20)"
34649+
},
34650+
{
34651+
"schema": {
34652+
"type": "string",
34653+
"pattern": "^\\d+$"
34654+
},
34655+
"in": "query",
34656+
"name": "offset",
34657+
"required": false,
34658+
"description": "Number of items to skip (≥0, default: 0)"
34659+
},
34660+
{
34661+
"schema": {
34662+
"type": "string"
34663+
},
34664+
"in": "path",
34665+
"name": "serverId",
34666+
"required": true,
34667+
"description": "MCP Server ID"
34668+
}
34669+
],
34670+
"security": [
34671+
{
34672+
"cookieAuth": []
34673+
}
34674+
],
34675+
"responses": {
34676+
"200": {
34677+
"description": "Filtered list of teams using this MCP server",
34678+
"content": {
34679+
"application/json": {
34680+
"schema": {
34681+
"type": "object",
34682+
"properties": {
34683+
"success": {
34684+
"type": "boolean",
34685+
"description": "Indicates operation success"
34686+
},
34687+
"data": {
34688+
"type": "object",
34689+
"properties": {
34690+
"server_info": {
34691+
"type": "object",
34692+
"properties": {
34693+
"server_id": {
34694+
"type": "string",
34695+
"description": "MCP server unique identifier"
34696+
},
34697+
"server_name": {
34698+
"type": "string",
34699+
"description": "MCP server name"
34700+
},
34701+
"server_slug": {
34702+
"type": "string",
34703+
"description": "MCP server slug"
34704+
}
34705+
},
34706+
"required": [
34707+
"server_id",
34708+
"server_name",
34709+
"server_slug"
34710+
]
34711+
},
34712+
"teams": {
34713+
"type": "array",
34714+
"items": {
34715+
"type": "object",
34716+
"properties": {
34717+
"team_id": {
34718+
"type": "string",
34719+
"description": "Team unique identifier"
34720+
},
34721+
"team_name": {
34722+
"type": "string",
34723+
"description": "Team name"
34724+
},
34725+
"team_slug": {
34726+
"type": "string",
34727+
"description": "Team URL slug"
34728+
},
34729+
"installations": {
34730+
"type": "array",
34731+
"items": {
34732+
"type": "object",
34733+
"properties": {
34734+
"installation_id": {
34735+
"type": "string",
34736+
"description": "Installation unique identifier"
34737+
},
34738+
"installation_name": {
34739+
"type": "string",
34740+
"description": "Installation name"
34741+
},
34742+
"created_at": {
34743+
"type": "string",
34744+
"description": "ISO8601 timestamp"
34745+
},
34746+
"last_used_at": {
34747+
"type": "string",
34748+
"nullable": true,
34749+
"description": "ISO8601 timestamp or null"
34750+
}
34751+
},
34752+
"required": [
34753+
"installation_id",
34754+
"installation_name",
34755+
"created_at"
34756+
]
34757+
},
34758+
"description": "All installations of this server by the team"
34759+
},
34760+
"installation_count": {
34761+
"type": "integer",
34762+
"description": "Number of installations of this server"
34763+
},
34764+
"status_summary": {
34765+
"type": "object",
34766+
"properties": {
34767+
"total_instances": {
34768+
"type": "integer",
34769+
"description": "Total number of user instances"
34770+
},
34771+
"online": {
34772+
"type": "integer",
34773+
"description": "Number of instances with online status"
34774+
},
34775+
"offline": {
34776+
"type": "integer",
34777+
"description": "Number of instances with offline status"
34778+
},
34779+
"error": {
34780+
"type": "integer",
34781+
"description": "Number of instances with error or permanently_failed status"
34782+
},
34783+
"provisioning": {
34784+
"type": "integer",
34785+
"description": "Number of instances in provisioning states"
34786+
}
34787+
},
34788+
"required": [
34789+
"total_instances",
34790+
"online",
34791+
"offline",
34792+
"error",
34793+
"provisioning"
34794+
]
34795+
}
34796+
},
34797+
"required": [
34798+
"team_id",
34799+
"team_name",
34800+
"team_slug",
34801+
"installations",
34802+
"installation_count",
34803+
"status_summary"
34804+
]
34805+
}
34806+
},
34807+
"pagination": {
34808+
"type": "object",
34809+
"properties": {
34810+
"total": {
34811+
"type": "number",
34812+
"description": "Total number of teams"
34813+
},
34814+
"limit": {
34815+
"type": "number",
34816+
"description": "Number of teams per page"
34817+
},
34818+
"offset": {
34819+
"type": "number",
34820+
"description": "Number of teams skipped"
34821+
},
34822+
"has_more": {
34823+
"type": "boolean",
34824+
"description": "Whether there are more teams beyond this page"
34825+
}
34826+
},
34827+
"required": [
34828+
"total",
34829+
"limit",
34830+
"offset",
34831+
"has_more"
34832+
]
34833+
}
34834+
},
34835+
"required": [
34836+
"server_info",
34837+
"teams",
34838+
"pagination"
34839+
]
34840+
}
34841+
},
34842+
"required": [
34843+
"success",
34844+
"data"
34845+
],
34846+
"description": "Filtered list of teams using this MCP server"
34847+
}
34848+
}
34849+
}
34850+
},
34851+
"400": {
34852+
"description": "Bad Request - Invalid pagination parameters",
34853+
"content": {
34854+
"application/json": {
34855+
"schema": {
34856+
"type": "object",
34857+
"properties": {
34858+
"success": {
34859+
"type": "boolean",
34860+
"default": false,
34861+
"description": "Indicates operation failure"
34862+
},
34863+
"error": {
34864+
"type": "string",
34865+
"description": "Error message"
34866+
}
34867+
},
34868+
"required": [
34869+
"success",
34870+
"error"
34871+
],
34872+
"description": "Bad Request - Invalid pagination parameters"
34873+
}
34874+
}
34875+
}
34876+
},
34877+
"401": {
34878+
"description": "Unauthorized",
34879+
"content": {
34880+
"application/json": {
34881+
"schema": {
34882+
"type": "object",
34883+
"properties": {
34884+
"success": {
34885+
"type": "boolean",
34886+
"default": false,
34887+
"description": "Indicates operation failure"
34888+
},
34889+
"error": {
34890+
"type": "string",
34891+
"description": "Error message"
34892+
}
34893+
},
34894+
"required": [
34895+
"success",
34896+
"error"
34897+
],
34898+
"description": "Unauthorized"
34899+
}
34900+
}
34901+
}
34902+
},
34903+
"403": {
34904+
"description": "Forbidden - Global admin required",
34905+
"content": {
34906+
"application/json": {
34907+
"schema": {
34908+
"type": "object",
34909+
"properties": {
34910+
"success": {
34911+
"type": "boolean",
34912+
"default": false,
34913+
"description": "Indicates operation failure"
34914+
},
34915+
"error": {
34916+
"type": "string",
34917+
"description": "Error message"
34918+
}
34919+
},
34920+
"required": [
34921+
"success",
34922+
"error"
34923+
],
34924+
"description": "Forbidden - Global admin required"
34925+
}
34926+
}
34927+
}
34928+
},
34929+
"404": {
34930+
"description": "MCP server not found",
34931+
"content": {
34932+
"application/json": {
34933+
"schema": {
34934+
"type": "object",
34935+
"properties": {
34936+
"success": {
34937+
"type": "boolean",
34938+
"default": false,
34939+
"description": "Indicates operation failure"
34940+
},
34941+
"error": {
34942+
"type": "string",
34943+
"description": "Error message"
34944+
}
34945+
},
34946+
"required": [
34947+
"success",
34948+
"error"
34949+
],
34950+
"description": "MCP server not found"
34951+
}
34952+
}
34953+
}
34954+
},
34955+
"500": {
34956+
"description": "Internal Server Error",
34957+
"content": {
34958+
"application/json": {
34959+
"schema": {
34960+
"type": "object",
34961+
"properties": {
34962+
"success": {
34963+
"type": "boolean",
34964+
"default": false,
34965+
"description": "Indicates operation failure"
34966+
},
34967+
"error": {
34968+
"type": "string",
34969+
"description": "Error message"
34970+
}
34971+
},
34972+
"required": [
34973+
"success",
34974+
"error"
34975+
],
34976+
"description": "Internal Server Error"
34977+
}
34978+
}
34979+
}
34980+
}
34981+
}
34982+
}
34983+
},
3462334984
"/api/admin/teams": {
3462434985
"get": {
3462534986
"summary": "List all teams (Global Admin) with pagination",

0 commit comments

Comments
 (0)