"Rick and Morty" star Spencer Grammer is headed for divorce court ... her husband filed this week in L.A. Superior Court.
Spencer, who also happens to be Kelsey's daughter, was married to James Hesketh for 6 years. James filed Wednesday ... citing irreconcilable differences. The couple has a 6-year-old son, and James says he wants joint physical and legal custody.
Looks like they're trying to avoid a messy court battle -- according to the divorce docs, obtained by TMZ, they are currently in mediation and hope to resolve all property and custody issues there.