MediaPortal 2 is completely open source. Its source can be downloaded using Git. If you don't have any Git client installed yet, read Git Installation first. For additional information about git see ProGit - Online introduction/manual to Git.
For read-only access use the read-only url which is displayed at github here: https://github.com/MediaPortal/MediaPortal-2
You can download the sources using the read-only URL or you can fork an own repository at github to get a writable repository. Read their help to see how it works.
When you downloaded the sources, you'll see that the MediaPortal 2 resources consist of one single directory "MediaPortal" which contains the sources, the build batch files and some other directories containing Tools and other things.
To download files, you can use TortoiseGit, for example. Use the read-only Git URL https://github.com/MediaPortal/MediaPortal-2.git to clone the repository on your local harddisk.
There are many good introductions about Git available in the internet.
I use the following tools for Git:
Note by Albert: I use GitExtensions for normal work. It is very stable and provides a very good user interface.
You can compile the sources to get a runnable version of MediaPortal 2