The Adeptus Mechanicus is an organization in the Imperium of Man responsible for technology, engineering and most of the Imperium's Industrial production, as well as the operation of the Titan Legions. The Adeptus Mechanicus, whose individual members are known as Techpriests, control thousands of forge worlds (think about any techno/cyberpunk/industrial trash metal band CD illustration obsessed with heavily polluted industrialized landscapes and you will get a bit close to the idea). Forge worlds are covered in massive manufactoria or, as they are known to speakers of Low Gothic, 'work'. The largest forge world of the Adeptus Mechanicus is Mars, homeworld of the Adeptus Mechanicus, on which the most badass weapons ever known to man are made.
They also tend to hog all the really cool shit for themselves --like Titans and other wonderful stuff-- only letting the Imperials have it when really, really necessary (or if they're threatened personally). They have two armies of their own, which are not anything like the Imperial Guard, as they are mostly composed by badass angry cyborgs and boxy technogrunge robots that are more violent than ED209, and giant, tank-crushing, lobotomized minions.
They are also avid music lovers.
This is their theme done by HMKids.
 History of the Adeptus Mechanicus
The Mechanicus was established in the distant past, when a bunch of
machine worshiping technophiles normal people terraformed Mars during mankind's dominating of the Solar System and colonizing of the galaxy. Thus Mars became an extremely technologically advanced society of astronauts, scientists, engineers, manufacturers, and miners wherein they could pursue advances in technology and power the Dark Age of Technology. After a while, during the Age of Strife, their precious atmosphere was punctured, and solar radiation beat down on their filthy heads burned the land, boiled the seas, and took the sky from them, nuking all life. Everybody either did one of three things: die, hide underground, or turn feral. After hundreds of years of living from half-working mechanical bunker to partially-pressurized archaic hab spire; people began to look upon technology as a saviour and way to return to the former heights of glory. Thus, did a new cult spread amongst the people of Mars, wherein they paid reverence to the Machine God. Just as planned.
Who said they are not human or lack the human factor?
And then they joined the EMPRAH because they saw him as an aspect of the Machine God called the 'Omnissiah'. As if the parallels aren't already tremendously clear at this point.
Hilariously, the "Machine God" may actually be the Void Dragon, one of the ancient C'tan Star Gods. The Void Dragon is actually one of the most powerful of the C'tan, and gains control over machines. All those techpriests are going to have serious problems when it wakes up... Oh yeah. It's on Mars because the EMPRAH clubbed it over the head and knocked it out on Mars. It's now guarded by the Mechanicus in their Noctys Labyrinth. This point of view is not canon, so the Machine God may be anything like the collective mass of all machines or the sum of all knowledge, neither would all Mechanicus accept a C'Tan as their lord. But it's a more fun version, isn't it?
 The Machine Spirits
The "Machine Spirit" is the Imperium's version of Artificial Intelligence, mainly because after the reunification of Terra; the Emperor forbade the use of AI in machinery (partly because of the ancient rebellion of the Men of Iron, but mostly to prevent the Void Dragon from skullfucking them, Skynet style).
The Techpriests of Mars got around in true WH40K grimdark fashion: cut out the "Artificial" part and make it organic, and vice versa. Nearly every piece of sophisticated machinery in the Imperium has a "Machine Spirit" which is basically the recycled brain of a human converted to function like a horrific cyborg version of a CPU. This "Machine Spirit" is used because the Iron Men incident made the Imperium fear AI, and instead the organic alternative would serve as a sort of smart processor, the only difference between it and a true AI is that machine spirits have no ability to learn or improve on their own, they must be manually programmed by their operators if they need to learn or do anything that is outside their current programming. Thus, it is now nearly impossible for machines to rebel on their own, quelling the fears of the Imperium.
Thus, it can be easily understood why machines are revered by the Mechanicus and why they are treated like sentient beings. Although, the AdMech is a bit fuzzy just how sentient machines are; are they somehow capable of thought like organics or no more sentient than your bread toaster at home?
 The Commandments of the Mechanicus
The Mechanicus have some ideas that they abide by:
01. Life is directed motion.
02. The spirit is the spark of life.
03. Sentience is the ability to learn the value of knowledge.
04. Intellect is the understanding of knowledge.
05. Sentience is the basest form of Intellect.
06. Understanding is the True Path to Comprehension.
07. Comprehension is the key to all things.
08. The Omnissiah knows all, comprehends all.
09. The alien mechanism is a perversion of the true path.
10. The soul is the conscience of sentience.
11. A soul can be bestowed only by the Omnissiah.
12. The Soulless sentience is the enemy of all.
13. The knowledge of the ancients stands beyond question.
14. The machine spirit guards the knowledge of the ancients.
15. Flesh is fallible, but ritual honors the machine spirit.
16. To break with ritual is to break with faith.
 What the Mechanicus does
They are the most technologically and scientifically gifted individuals the Imperium has to offer.
The main role of the Adeptus Mechanicus is to maintain the advanced equipment of the Imperium; which despite stereotypes, they are actually very good at. Most of their rituals to appease machinery are pretty much the same methods we would use to repair our machinery with a whole bunch of religious iconography mixed in. The terms used by the Mechanicus are actually quite similar to our engineers if you swap some of the words (replace machine spirit with A.I, sacred oils with lubricant etc.) Because of its religious nature some of the components of the rituals are unnecessary but almost all Tech-Priests skip the unnecessary stuff in dire situations while some abandon the unnecessary parts altogether. It's also implied that the so-called holy chants are really them repeating instructions to themselves, which would be useful for remembering what you're doing. The cases where chanting is actually necessary is where they are working with something like a Land Raider or Titan - where both have a temperamental machine spirit - that you don't want to piss off.
They spend a lot of time traveling across the galaxy looking for some old laptops called "Standard Template Constructs" that have all the info necessary for the first human colonist do their job well (mostly a mix of Ikea and "high-tech for dummies" manuals). This is the reason why you will end selling grox hamburgers if you study to be an engineer (unless you have balls or are a spess mehreen artificer who make make something really good) in the Imperium: everything was already done by the ancients in the Dark Age of William Gibson and recorded in these STCs. Thanks to glitches and borderline developers and programmers, all the STCs found by the Mechanicus are more fucked up than
Windows Vista or Windows ME FUCKING WINDOWS 95! So when they find an undamaged one, they get truly orgasmic. They also attempt to loot Necron tombs and will gladly put an entire world at risk for this, and act like it's blasphemy of the most serious kind when people wall it off because of the goddamn killer robot skeletons! The idiots.
Very very very very very rarely the Adeptus will actually invent something. While they do adapt designs occasionally the only things they actually invented from scratch is the Lascannon and all the Titans, except for the Reaver Class and the Apocalypse Class, which were invented during the Age of Strife and the Dark Age of Technology respectively. Which is pretty odd, until you realize that they invented them pre-heresy. Even things like Land Raiders and Land Speeders, which were said to have been given critically important parts by the famous Mr. Land himself, were actually just made from really old bits Land found in the galaxy's third biggest library/archive/warehouse (the one on Terra). Well, they also invented the Infernus pattern Predator. Sure they built it on the Rhino chassis, but they created a pattern without killing everyone involved.
Also important to mention is what they do not do. The Mechanicus by and large are the greediest gits in the galaxy. They hoard technology like it is going out of style, which it would be if they didn't hoard and defend it, but that isn't the point. The point is that they're basically a mega-corporation that will try to own, buy, sell and take by force any existing technology. Getting a part, gun, computer, vehicle, schematic, program, eyepatch, cookie recipe, or even a tiny plastic model that wasn't specifically mass-produced and shipped to the Departmento Munitorum so they can give it to you, is nearly impossible. Anything with any kind of passing significance or interest to the Mechanicus is guarded by 7-foot cyborg death machines. Anything in the private possession of a Mechanicus operative that might be harder to make than a bolt or nut is treated like the holy grail. I dare you to try and take a 8,000 year-old flash drive from a techpriest who just found it. It's worse than taking little plastic models from fat men with beards.
 The Void Dragon
A lot of their tech stuffs come from the Void Dragon that the Emperor bested and imprisoned on Mars ages ago as so humanity could gain mastery over machines. While it might have worked pretty well back when the Imperium wasn't the festering porta-potty of a grimdark shitpit that it is today, it's pretty much a matter of time now. The Necrons already attempted to raid Mars - and succeeded, well, sort of. They got vaporized before they could really even do anything, but the fact that they managed to even land proved a point the High Lords of Terra had been turning a blind eye towards for ages.
If the T-800s get what they want and party on Mars long enough to wake the Void Dragon up, you can bet it's going to be a pretty goddamned bad day for just about any human not wearing loincloths and still bashing rocks together. The few Mechanicus agents who have figured this out have either gone rogue, blammed or gone totally bonkers, ripping all the implants from their flesh. And when you're a member of the Mechanicus, that's about 80% of your body.
Of course, the even worse possibility is that the void dragon enjoys this situation, as every time the tech-priests remove their flesh and place more machine into it, they could be feeding him a fraction of their soul. As there are quite a few tech-priests out there, and humanity being the rabbits they are, this would give him a lifetime of souls to be eating, and a personal army that is very much willing.
By the way, the "Void" Dragon is actually only called "The Dragon" in the official fluff, probably as a reference to Metropolis.
But for God knows what unreasonable reason, /tg/ insists on calling him the "Void Dragon", thus confusing him with an Eldar aircraft, or with an Eldar pirate warband. Unless it's an obscure vidya reference. Whatever, maybe it just sounds cooler. The Eldar refer to it as the "Void Dragon", and the aircraft and pirate warband take their names from it.
UPDATE: The new Codex: Necrons written by our Spiritual Liege reveals the necrons are no longer enslaved by the C'tan, instead they are their sworn enemies for tricking them into giving up flesh, thus they were probably going to Mars to capture the Imperial held C'tan shard of the Void Dragon as they won't see humans reliable, or perhaps they were under control of another shard, and wanted to liberate it, oh whatever, for what we know it may have been Trollzyn trying to loot Mars.
 Why Everything is so Grimdark
"The Mechanicus does NOT have the technology. They haven't been living on some fancy paradise planet since pre-Fall. Mars is an anarchic nightmare shithole the moment you leave the safe zones into the kilometres of labyrinthine corridors beneath it full of rogue machinery, self-aware and malevolent AI from before the Fall, and the daemon programs of the Heresy. EVERYTHING in the databases is fucked. The databases are fragmented over the entire surface to the extent that it would be impossible to see one tenth of the total files in the ludicrously extended life of a Magos even assuming that they are completely safe to visit. And they are not.
The files have been corrupted into madness by the Fall, and the unleashing of the most potent informational warfare systems ever to exist to defeat the Iron Men. Nearly all of Mars was rendered uninhabitable, what they live in now is built on the top of the ruins. They send archeotech expeditions in to find shit, nearly all of them never come back. The sheer number of rogue war machine running around in there is sufficient to rape the mind. Then came the Heresy, which was not earth-exclusive. Mars as the second most critical planet in the Imperium was the site of fighting nearly as ferocious as on Terra, with Mechanicus loyalists and Hereteks fighting tooth, nail, and mechadendrite everywhere. Ancient machines were unleashed, viruses both normal and daemonic unleashed into all the computer systems. Nearly every single stored record on Mars was rendered unusable, and those that survived are half the time self-aware and don't like you, or daemonic and actively try to kill you.
If you come back with a schematic, it is almost certainly gibberish, and if it isn't, it's probably corrupted into uselessness. If it does come back whole it was probably malevolently fucked with so that instead of a Lasgun power cell it's a fucking grenade set to detonate the second you finish building it. Why do you think they want off-world STCs so damned much if they had them all here? The fucking Heresy is why. Off-world they only have to contend with the Fall's war and its effects on the machinery plus twenty thousand years of degradation with no maintenance. But at least off-world it'll probably just not work instead of actively seeking to kill you.
Why do you think they seek to placate the Machine Spirit? It's because it exists. The fragments of trillions of self-aware programs, flourishing during the Dark Age of Technology and shattered by Man in his war with the Iron men, imprisoning the few who had not set themselves irrevocably into the machinery, a prison smashed wide open by the Heresy. Everything that can hold programming in the Imperium has a shard of a program in it. EVERYTHING. And you'd better fucking please it or it will do everything in its power to make your day shit. Sure, if it's a Lasgun it'll just not work or start shooting off rounds by itself, but if you piss off a Land Raider you can say bye-bye to half a continent. They apply these principles to things without spirits by habit, since they're so used to dealing with tanks that if not talked to just right might go rogue and annihilate the Manufactorum before they can be killed.
This is why they do not like ANYONE fucking with technology, because it is so rare to find anything that just works it is critical it not be compromised. That, and they do not have the actual knowledge to fuck with it intelligently, just through experimentation, which inevitably leads to slaughter. Pressing buttons to see what works is fine in a 21st century computer, but it is a very stupid thing to do at the helm of a 410th century starship with the destructive power to end solar systems. The entire knowledge base of humanity was lost. Not forgotten, but outright lost. Everything at all, poof. Nobody knows anything because the Fall fucked everything up and the Heresy double-fucked it. To rebuild the theoretical framework needed to design new technologies that don't kill everyone near them would require starting from the ground up. They don't have the time, they never have, and they never will.
This gets on to the point of war and what it does to technology. Someone will parrot that it makes it go much faster. Yes, it makes practical applications of technology go much faster. It also utterly stops all research on the scientific theories behind those technologies. This means that when war chugs along for a decade or two things get done. It means when it goes on too long you run out of theories to turn into technologies, and then you run out of technologies to apply. You stagnate. When you have been fighting in a war for survival in a drastically overextended empire, this is what happens. You are desperate for any extra materiel that can possibly be produced. Half your entire fucking military might went rogue, smashed the half that stayed, leaving you with the tattered shreds of a war machine to keep hold of an empire that was reaching straining point with an army far larger. There is no time for the sort of applied research programs that took Man twenty five thousand years to develop, in a time of unprecedented growth and prosperity.
This is also why the Adeptus Mechanicus insists on cargo cultism. It's because when you are dealing with things you barely understand because everything you knew about them was destroyed it is the safest and most reliable option. The rituals do not exists for mysticism, they exist because they are the most practical means of building, repairing and maintaining the equipment they have with the knowledge surviving. You don't understand why pressing that button makes it go, because the manual tried to take over your brain and the copies are all unreadable and the research base that would let you reverse-engineer it does not exist and cannot be built.
Why are the Tau doing so well with their technology? Because they had peace. Eight thousand years unmolested by any enemy and they were helped the entire time by the most advanced biological race in the galaxy. Give the Imperium eight thousand years of peace and I can guarantee you it will be harder than it was during the Great Crusade.
Since some still don't get the idea, try this:
Build a library, fill it with all human knowledge. You take it elsewhere when you need a book from it, but the book is only a simplified copy. You don't understand the real book, and you don't need to. Nobody takes the real books anywhere because why would you, when there's a whole library there?
Now that library goes rogue and the maintenance machinery starts killing everyone any-fucking-where near it. Where the fuck did they all come from, you swear to god there weren't this many, and there weren't because they're using the library's information to fight their war. The government fights a battle that destroys the planet against these robots and tears apart the library to stop them using it, only to be destroyed in the process. The library is leveled, cast into flames, every book burned and every computer virus-laden.
Then comes a man who worked there. He talks to the few surviving library workers, assembles their information, and starts rebuilding a city around the library and expanding it as the librarians find little scraps of paper and fragmented bits of files that stuck together just right read something. They rebuild a library from scrap on the ashes of the old. It isn't a shadow on the glory of the old, but it is all they have.
Then the city turns on itself, kills its master, and the librarians turn to rage. Half of them kill the other half and destroy the remnants of the library because where they're going they won't need science. Everything burns, and the city is left to a scattered few survivors, walls open to the world, with the hungry predators circling.
The Adeptus Mechanicus is the sole surviving librarian, desperately scrabbling through the ashes of paper and splinters of hard drives for anything to help him and the city he needs to survive just a second longer.
The Imperium isn't grim because things suck by choice and could be fine if a sensible person came along. That sensible person wouldn't survive fifty seconds of the reality. The Imperium is grim because every single shit decision, every single sacrifice, every single death, every single man woman and child suffering a shit life in the worst conditions imaginable, is the absolute best that can be done. It is a study of the worst happening to everyone and what part of your humanity must be sacrificed today just to stand a chance of survival, and all it asks is whether or not it would have perhaps been better to die." -- Baron von Evilsatan
We're not sure if that's tech-heresy or an actual activation ritual. Ask your local Magos for clarification.
showin' a little augmented leg
 See Also
Mechanicum Tactics. Yes, they have rules now.