BerriAI/litellm · error · HTTPException

Error registering mcp server: {e}

Error message

Error registering mcp server: {e}

What it means

Catch-all wrapper around the create_mcp_server persistence step in the registration workflow. After payload validation and approval_status stamping succeed, any unexpected exception from the DB write is logged and re-raised as this 500, so the original cause must be read from server logs.

Source

Thrown at litellm/proxy/management_endpoints/mcp_management_endpoints.py:1288

        prisma_client: Final = get_prisma_client_or_throw("Database not connected. Connect a database to your proxy")

        validate_and_normalize_mcp_server_payload(payload)
        stamp_omitted_oauth2_flow(payload)
        _validate_mcp_required_fields(payload)

        payload.approval_status = MCPApprovalStatus.pending_review
        payload.submitted_by = user_api_key_dict.user_id
        payload.submitted_at = datetime.now(timezone.utc)

        try:
            new_mcp_server: Final = await create_mcp_server(
                prisma_client,
                payload,
                touched_by=user_api_key_dict.user_id or user_api_key_dict.team_id,
            )
        except Exception as e:
            verbose_proxy_logger.exception("Error registering mcp server: %s", e)
            raise HTTPException(
                status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
                detail={"error": f"Error registering mcp server: {e}"},
            )
        # Do NOT add to runtime registry — pending servers are not active
        return _redact_mcp_credentials(new_mcp_server)

    @router.get(
        "/server/submissions",
        description="Returns all MCP servers submitted by non-admin users (admin review queue). Mirrors GET /guardrails/submissions.",
        dependencies=[Depends(user_api_key_auth)],
        response_model=MCPSubmissionsSummary,
    )
    @management_endpoint_wrapper
    async def get_mcp_server_submissions(
        user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
    ):
        """
        Admin-only endpoint to view all user-submitted MCP servers pending review.

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Read the underlying error in the message and fix the indicated configuration problem.
  2. Check proxy logs for the full stack trace, then retry registration.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/mcp_management_endpoints.py:1288 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/1c6329bea141f515. Report an issue: GitHub.