Your Mirth Connect Channels Should Be in Git. Here's How to Make That Happen.
I've been doing healthcare integration work for over a decade now. In that time I've seen exactly one constant across every shop I've worked at: nobody has version control on their Mirth channels when I walk in the door.
Think about that. You've got channels processing thousands of HL7 messages a day, moving patient data between your EHR, your lab, your pharmacy, your billing system. If somebody makes a bad change on a Friday afternoon, your options are "remember what it looked like before" or "restore from a backup that may or may not exist." That's not a plan. That's hope.
Why this keeps happening
It's not because integration engineers are lazy. It's because Mirth doesn't make it easy. Channels live inside the application. The configuration is XML blobs stored in a database. There's no "save to file system" button that slots into a normal Git workflow.
So teams do what teams do when something is hard. They skip it. Maybe someone keeps a folder of exported channel XMLs on a shared drive somewhere. Maybe there's a naming convention like ADT_Inbound_v3_FINAL_actual_final.xml. We've all been there.
The approach that actually works
At a previous role I inherited over a hundred channels on a legacy Mirth instance with zero version control. Here's what I put in place:
1. Automated channel exports on a schedule. A script hits the Mirth REST API, exports every channel as XML and commits to a Git repo. This runs on a cron. No human has to remember to do it.
2. One channel per file, named by channel ID and name. The file name includes both so you can find things by either. The XML is formatted consistently so diffs are actually readable.
3. Pull requests for production changes. Before a channel change goes to prod, the export captures it and a PR gets opened. Another engineer reviews the diff. This is table stakes in software development but it feels revolutionary in the Mirth world for some reason.
4. Environment-specific branches. Dev, test and prod each have their own branch. Promoting a change means merging forward. You can diff between environments to see exactly what's different.
The hard part nobody talks about
Getting the tooling set up is the easy part. The hard part is getting your team to actually use it.
If your team has been doing Mirth work without version control for years, you're asking them to change their workflow. You're adding steps. Some people will see this as overhead. You need to show them the first time it saves someone's neck after a bad deployment. That converts people fast.
The other thing is that Mirth channel XML is verbose. A simple channel can be hundreds of lines of XML. The diffs can be noisy. Invest time in making your exports consistent (alphabetized properties, stable formatting) so that the diffs show real changes, not just reordering noise.
What this looks like in practice
A developer makes a change to a channel in the test environment. The export cron picks it up within the hour. A PR gets auto-created against the test branch. The developer adds context in the PR description about what they changed and why. Another engineer reviews it. When it's approved and merged, the same change gets applied to prod through the same process.
Is it more work than just clicking deploy in the Mirth admin console? Yes. Is it worth it the first time you need to roll back a change or figure out who changed what and when? Absolutely.
Tools that help
If you're using AI assistants like Claude or Cursor for development, the MCP Healthcare server and Mirth Connect MCP tools can parse channel XMLs, diff between environments and generate Rhino-compatible JavaScript. It doesn't replace the version control workflow but it makes the review process a lot faster when you can ask an AI to explain what a 500-line channel XML actually does.
Just start
If you take one thing from this: just start. Export your channels today. Put them in a repo. Even if you don't have the full PR workflow yet, having a history of your channel configurations will save you. I guarantee you'll need it sooner than you think.
Top comments (0)