Bobby Shmurda says the cops who busted him on a felony gun charge targeted him and his friends because they're black.
Bobby claims in new court docs cops have had it out for him because of his anti-police raps ... adding the very same officers who arrested him in 2014 harassed him and his friends before.
Shmurda says the 3 NYPD cops who claim they found him gun in hand in a NYC apartment have a history of lying. Shmurda says, in an unrelated case, one of the cops in question swore she saw a drug exchange but later fessed up and said it wasn't true.
Shmurda wants access to police disciplinary records, which he says is especially important because the police are also the only witnesses to his alleged crime.
Apparently the judge didn't see eye-to-eye with Shmurda and has denied the rapper's request.
We reached out to Bobby's attorney, Alex Spiro, who had no comment.