fix(mcp): sort submissions newest-first; force active status on admin-created servers

This commit is contained in:
Ishaan Jaffer 2026-03-10 11:20:47 -07:00
parent a1e62e8c56
commit 8963a54f1a
2 changed files with 5 additions and 1 deletions

View file

@ -513,7 +513,7 @@ async def get_mcp_submissions(
"""
rows = await prisma_client.db.litellm_mcpservertable.find_many(
where={"submitted_at": {"not": None}},
order={"submitted_at": "asc"},
order={"submitted_at": "desc"},
)
items = [LiteLLM_MCPServerTable(**r.model_dump()) for r in rows]

View file

@ -1026,6 +1026,10 @@ if MCP_AVAILABLE:
# TODO: audit log for create
# Admin-created servers are always active regardless of any lifecycle fields
# in the payload — prevents an admin from accidentally creating a pending server.
payload.approval_status = MCPApprovalStatus.active
# Attempt to create the mcp server
try:
new_mcp_server = await create_mcp_server(