Oh, boy, I thought the message was sent but it posted just the first paragraphs. I'll rewrite, perhaps this time I'll be shorter.
TLDR: You don't need to code all this stuff. You don't NEED automation. All you really need is a P2P client that manages cards, moving cards from buffer to buffer, and a chat. The players can do the rest.
Now, introducing Dragonstudios' Apprentice for those who don't know it.
Back in the 90's, a bunch of guys named Dragonstudios released Apprentice, a P2P software to play MtG online. The software was very small, used very simple graphics, and had no automation at all. Despite that, it was a hit. Thousands of people played using it, there was the PlaneswalkerLeague centered on IRC channels that promoted tournaments almost everyday. Here in Brazil we had LigaMagic which was our national version of Planeswalker League, so I imagine that many other countries had their own.
What did Apprentice consist on? The window was divided into menubars, toolbars, sidebar, main tabletop and chat bar. On the left side, there was the sidebar which showed your hand on a list, every row containing the card name and casting cost. The chat bar was on the bottom of screen. The toolbar and menubar were atop everything and 70% of the screen was the tabletop, where you could drag and drop cards and right-click them to access quick actions such as tap or bury. The toolbar contained buttons such as "Draw Card", "+1 Life", "-1 Life", "Advance Phase", "Pass Turn", "+1 Counter", "+1/+1", and so on. Now, I'm probably getting redundant, but I'll explain why it worked for many, many years without any automation.
You're gonna attack. You choose and declare attackers, tap them and it goes. Your opponent sees your tapped attackers and declares and assigns blockers. You and your opponent both know who died and who didn't. You know how double strike works, just so you can play with real cards on a tabletop without any computers. The non-blocked creatures will deal say 6 damage to your opponent, and he knows that he needs to lower his life points by six. And if he doesn't, if anybody runs out of the rules, well, same things applies online and offline, specially if a third person, a judge for tournaments, can be watching. Besides all the talking, the chat would also register every action, so there would be no problem determining what happened.
So, that's it. I don't think you need to code all of Magic's functionalities so it runs things for you, you just need a platform with a nice deck editor that allows you to run the game yourself. I tried a lot to reproduce Apprentice in an accessible application, but I seriously lack even the most basic programming skills. Hope this ideas can help you.
PS: On card databases, try googling for magic the gathering full card spoilers, it will take you to text listings of all cards, then you can parse and store it.