mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-05 02:41:56 +00:00
address greptile review feedback (greploop iteration 1)
This commit is contained in:
parent
32595eb9ec
commit
3aedc99698
3 changed files with 5 additions and 7 deletions
|
|
@ -105,7 +105,7 @@ def encrypt_credentials(
|
|||
|
||||
async def get_all_mcp_servers(
|
||||
prisma_client: PrismaClient,
|
||||
approval_status: Optional[str] = "active",
|
||||
approval_status: Optional[str] = None,
|
||||
) -> List[LiteLLM_MCPServerTable]:
|
||||
"""
|
||||
Returns mcp servers from the db, optionally filtered by approval_status.
|
||||
|
|
|
|||
|
|
@ -815,7 +815,6 @@ if MCP_AVAILABLE:
|
|||
server_id,
|
||||
touched_by=user_api_key_dict.user_id or LITELLM_PROXY_ADMIN_NAME,
|
||||
)
|
||||
await global_mcp_server_manager.add_server(approved)
|
||||
await global_mcp_server_manager.reload_servers_from_database()
|
||||
|
||||
return _redact_mcp_credentials(approved)
|
||||
|
|
@ -824,6 +823,7 @@ if MCP_AVAILABLE:
|
|||
"/server/{server_id}/reject",
|
||||
description="Reject a pending MCP server submission (admin only). Mirrors PUT /guardrails/{id}/reject.",
|
||||
dependencies=[Depends(user_api_key_auth)],
|
||||
response_model=LiteLLM_MCPServerTable,
|
||||
)
|
||||
@management_endpoint_wrapper
|
||||
async def reject_mcp_server_submission(
|
||||
|
|
@ -850,12 +850,10 @@ if MCP_AVAILABLE:
|
|||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
detail={"error": f"MCP server '{server_id}' not found."},
|
||||
)
|
||||
if existing.approval_status != MCPApprovalStatus.pending_review:
|
||||
if existing.approval_status == MCPApprovalStatus.rejected:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_400_BAD_REQUEST,
|
||||
detail={
|
||||
"error": f"MCP server is not pending review (approval_status={existing.approval_status})."
|
||||
},
|
||||
detail={"error": "MCP server is already rejected."},
|
||||
)
|
||||
|
||||
rejected = await reject_mcp_server(
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import React, { useEffect, useState, useMemo, useCallback } from "react";
|
|||
import { useMCPServers } from "../../app/(dashboard)/hooks/mcpServers/useMCPServers";
|
||||
import { useMCPServerHealth } from "../../app/(dashboard)/hooks/mcpServers/useMCPServerHealth";
|
||||
import NotificationsManager from "../molecules/notifications_manager";
|
||||
import { deleteMCPServer, registerMCPServer } from "../networking";
|
||||
import { deleteMCPServer } from "../networking";
|
||||
import { MCPSubmissionsTab } from "./MCPSubmissionsTab";
|
||||
import { DataTable } from "../view_logs/table";
|
||||
import CreateMCPServer from "./create_mcp_server";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue