npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@easysolutions906/mirth-mcp

v1.1.5

Published

MCP server for Mirth Connect — parse channels, generate Rhino-compatible code, analyze HL7 transformations, debug errors

Downloads

89

Readme

Mirth Connect MCP Server

The first Model Context Protocol (MCP) server for Mirth Connect (NextGen Connect). Lets AI assistants (Claude, Cursor, etc.) parse Mirth channels, generate Rhino-compatible JavaScript, analyze HL7 transformations, and debug common errors.

Tools

| Tool | Description | |------|-------------| | mirth_parse_channel | Parse a Mirth channel XML export into structured JSON | | mirth_analyze_channel | Lint a channel for hardcoded IPs, SQL injection, missing error handling, Rhino compat issues | | mirth_explain_channel | Generate a plain-English description of what a channel does | | mirth_generate_transformer | Generate a Mirth transformer step (Rhino-compatible JavaScript) | | mirth_generate_filter | Generate a filter step (message type, field value, test patient exclusion) | | mirth_generate_channel | Generate a complete importable Mirth channel XML | | mirth_map_fields | Generate HL7 field mapping code (PID-5-1 -> patient_last_name) | | mirth_generate_code_template | Generate a code template using the IIFE pattern | | mirth_debug_error | Explain a Mirth error message and suggest fixes | | mirth_validate_js | Validate JavaScript for Rhino compatibility |

Rhino Rules Enforced

All generated code follows Mirth Connect's Rhino (ES6-mode) constraints:

  • var at root level for public API bindings (required for global scope across code templates)
  • const and arrow functions inside IIFEs and function bodies
  • No let at root level, no template literals, no destructuring, no import/export, no async/await
  • No for each...in (deprecated Rhino syntax) — uses forEach on arrays
  • Every code template uses the IIFE pattern: declare public vars, wrap implementation in (() => { ... })()

Install

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "mirth-connect": {
      "command": "node",
      "args": ["/path/to/mirth-mcp/src/index.js"]
    }
  }
}

Cursor

Add to .cursor/mcp.json in your project:

{
  "mcpServers": {
    "mirth-connect": {
      "command": "node",
      "args": ["/path/to/mirth-mcp/src/index.js"]
    }
  }
}

Claude Code

claude mcp add mirth-connect node /path/to/mirth-mcp/src/index.js

HTTP Mode (Railway / Docker)

Set the PORT environment variable to run in HTTP mode with both REST API and MCP endpoints:

PORT=3000 node src/index.js

REST endpoints are available at http://localhost:3000/ and the MCP streamable HTTP endpoint at http://localhost:3000/mcp.

API Endpoints (HTTP Mode)

| Method | Path | Description | |--------|------|-------------| | GET | / | API info and tool list | | GET | /health | Health check | | POST | /parse | Parse channel XML | | POST | /analyze | Analyze channel for issues | | POST | /explain | Explain channel in English | | POST | /generate/transformer | Generate transformer code | | POST | /generate/filter | Generate filter code | | POST | /generate/channel | Generate channel XML | | POST | /generate/code-template | Generate code template | | POST | /map-fields | Generate field mapping code | | POST | /validate | Validate JS for Rhino | | POST | /debug | Debug error message | | POST | /mcp | MCP streamable HTTP |

Plans

| Plan | Calls/Day | Rate Limit | Price | |------|-----------|------------|-------| | Free | 20 | 5/min | $0 | | Starter | 500 | 20/min | $19.99/mo | | Pro | 5,000 | 60/min | $49.99/mo |

Examples

Parse a channel

curl -X POST http://localhost:3000/parse \
  -H "Content-Type: application/json" \
  -d '{"xml": "<channel version=\"4.5.0\"><name>Test</name>...</channel>"}'

Generate a transformer

curl -X POST http://localhost:3000/generate/transformer \
  -H "Content-Type: application/json" \
  -d '{
    "description": "Extract patient demographics from PID",
    "messageType": "HL7",
    "variables": [
      {"name": "patientLastName", "path": "msg['\''PID'\'']['\''PID.5'\'']['\''PID.5.1'\''].toString()"},
      {"name": "patientFirstName", "path": "msg['\''PID'\'']['\''PID.5'\'']['\''PID.5.2'\''].toString()"},
      {"name": "mrn", "path": "msg['\''PID'\'']['\''PID.3'\'']['\''PID.3.1'\''].toString()"}
    ]
  }'

Validate Rhino compatibility

curl -X POST http://localhost:3000/validate \
  -H "Content-Type: application/json" \
  -d '{"code": "const x = `hello ${name}`; const {a, b} = obj;"}'

Debug an error

curl -X POST http://localhost:3000/debug \
  -H "Content-Type: application/json" \
  -d '{"error": "ReferenceError: \"formatDate\" is not defined"}'

Development

npm install
npm run dev

License

ISC