Clerics can take necromantic spells, but not the really high level stuff like Finger of Death and Horrid Wilting.
Can Mystic Theurge take high level wizard spells? Clerics are decent at fighting, right?
They get good necromancy options at every spell level except first really.
Level 2 - Boneshaker. Not great damage but always hits. I find myself using boneshaker a lot more than I think I will. Sometimes you just need to hit something.
Level 3 - Animate dead. Broken OP for blocking powerful enemies from getting to you in the unmodded game, shit in the modded game. In the modded game you get Deadly Juggernaut though, which is necromancy and absolutely brilliant for a melee character:
You also get contagion, sands of time and bestow curse, which are reasonable debuffs.
At level 4 there's death ward and Aura of doom:
At 5th level there's Bonshatter, a beefed up version of boneshaker that also makes them fatigued on a failed save.
At 6th level there's harm, a reasonable touch spell that does 10pts of damage per caster level. There's also Undeath to death
At 7th level (character level 13) that's when you start getting the really cool shit and feeling like a truly badass necromancer. Here you get create undead, umbral strike, destruction and poison breath. I like Destruction.
8th level gives you death clutch.
9th level gives you energy drain and Scourge of the horsemen.
Outside of the necromancy school, things like divine favour (and later divine power) give you a short lasting bonus to hit, and frightful aspect makes you a powerful giant with reach.
The thing about necromancy casting is most everything has a save, and it's almost always a fortitude save. Enemies get some crazy high fortitude saves so you need to boost up your DCs to the max possible for it to become consistently useful. That's kind of true for any sort of DC casting though. So I recommend having a 19 starting casting stat (WIS for cleric) and putting all points into it. If you can't get that to work in you build, a 17 starting casting stat is OK. You also need to take spell focus and greater spell focus and, especially for necromancy, find an item to boost your DCs.
For necromancy this item is the cloak of sold souls:
https://pathfinderkingmaker.fandom.com/wiki/Cloak_of_Sold_Souls
It makes you more fragile, but by the time you get it your casting will be starting to get really good (I'm normally level 13) so you may find yourself transitioning out of the melee role and only doing this rarely. And +2 to DCs and caster level is insane and a big help when hitting those sky high fort saves. Even so some enemies will have too much CON to reliably beat their save, so having hellfire ray on hand can be good for them (no save).
As far as being a good fighter goes, no they aren't
good. But they are solid, a long way from
bad and they are full progression casters who get their entire spell list automatically every level. They get 15 BAB (same as EK without needing to multiclass) as well as some very handy spells to buff them in melee (righteous might, divine power, forceful strike, frightful aspect, archon's aura and the aforementioned deadly juggernaut). I guess it depends what you're comparing them to. Channel smite lets them apply their channel damage to their next hit as a swift action, handy for a negative channeling necromancer. Guided hand lets them use their WIS modifier in place of their STR modifier on attack rolls when using their deity's favored weapon (Damage is still STR based). For Urgathoa (Necromancy goddess) this is a Scythe which is a decent weapon. Crits don't happen a lot but are amazing when they do with a *4 multiplier. This is why they are good, because you can max your WIS and still be able to hit stuff, just taking a 14 or 16 in STR to do some damage and be able to hit with touch spells (touch AC is usually much lower).
They can cast in medium armour (or heavy armour if you take a proficiency) or cast with a shield on if you go with a deity that uses a one handed weapon. They don't get amour or weapon training, they don't get class features like the Sword Saint that enhance their fighting. They don't get any bonus feats, so you've really got to only take the best stuff. They get by in melee and are brilliant casters as opposed to the Sword Saint which is brilliant in melee and gets by as a caster. I don't think it's possible to get full progression DC casting and be as good as a martial in melee. I don't think it should be possible either.
Here's an example build of a necromancy cleric:
Deity: Urgathoa. Undead subdomain and conversion inquisition (Standard cleric). Human. This would only be possible using Call of the Wild:
STR: 16
DEX: 7
CON: 14
INT: 7
WIS: 19 (All increases here)
CHA: 14
1. Channel smite + guided hand
3. Toughness
5. Power attack
7. Furious focus
9. Outflank
11.Spell focus - Necromancy
13. Greater spell focus - Necromancy
15. Spell penetration
17. Greater spell penetration
19. Improved critical
I've bolded the feats that I think are essential to take so you can customize this to your liking. I almost bolded toughness. I always take it. It's not essential but it helps a lot, especially at lower levels. There are no metamagics here so you'd need rods. This build could not use rays. If you had at least a 12 DEX and precise shot in the build, and got Death from afar (gloves) you can use rays. You could get that DEX by accepting only 17 WIS. Spell penetration could be replaced with a greater piercing metamagic rod. Furious focus (which removes the penalty of power attack on your first hit) wouldn't work if you use a shield. Has to be either a two hander on one handed with empty offhand.
Personally I take 12 CON on my clerics for more points elsewhere but I'm not going to recommend others do, seeing as many seem to struggle running a 12 base CON character in melee. You may actually want to go higher on CON and only take a 14 STR. This is because the Cloak of Sold Souls gives you -4 to CON. Or you could try not wearing it. I think it's better to wear it, the better casting is worth it. By this level your melee damage will be kinda shitty compared to the martials in your party but your casting is getting awesome.
This is an example build only. If you end up playing a cleric don't copy it. Make it your own. You'll like it more.