AI-Native Engineering Companion. Built for builders. Designed for regulated environments.
Project description
MDx Code
AI-Native Engineering Companion
Built for builders. Designed for regulated environments.
The Story
I've been thinking about AI-powered development tools for over a year. Then I read an article that broke down Claude Code from first principles and realized something: the core architecture is embarrassingly simple.
while task_not_complete:
response = ask_llm(conversation)
if response.wants_tool:
result = execute_tool(response.tool)
conversation.append(result)
if response.done:
break
That's it. AI thinks → acts → observes → repeats.
Everything else is just tooling and governance wrapped around this loop.
So I built my own. Not because Claude Code isn't good... it's excellent. But because I needed something that:
- Works in regulated environments → Financial services, healthcare, government
- Owns the orchestration layer → Swap models without rewriting everything
- Respects governance rules → Audit trails, permission controls, compliance profiles
- Learns over time → The security agent gets smarter with use
MDx Code is that tool.
Quick Start
Option 1: Install directly from GitHub (recommended)
pip install git+https://github.com/dhotherm/mdx-code.git
Option 2: Clone and install locally
git clone https://github.com/dhotherm/mdx-code.git
cd mdx-code
pip install -e .
Then authenticate and run:
# Authenticate with Claude
mdxcode auth claude
# Initialize in your project
cd your-project
mdxcode init
# Run it
mdxcode main "Fix the bug in auth.py"
What It Does
Give it a task. Watch it work.
mdxcode "Add input validation to the user registration endpoint"
MDx Code will:
- Read your MDXCODE.md for project context
- Find the relevant files
- Understand the existing patterns
- Make changes incrementally
- Run tests to verify
- Log everything for audit
Scan for vulnerabilities:
mdxcode security scan
Auto-fix issues:
mdxcode security fix --auto-fix
MDXCODE.md
Every project gets a context file. This is how MDx Code understands your project before touching anything.
# MDXCODE.md
## Project
- **Name:** Claims Processing API
- **Domain:** Health
- **Team:** Health Platform
## Conventions
- All endpoints require JWT auth
- Use Pydantic for request/response models
- Event sourcing for state changes
## Compliance
- PHI fields use SL-encrypt utility
- Never log PHI in plain text
## Guardrails
- ❌ Never commit directly to main
- ❌ Never modify production configs
- ⚠️ Schema changes require approval
Different domains, different rules. The context file captures all of that.
Regulatory Profiles
MDx Code ships with profiles for regulated industries:
| Profile | Description |
|---|---|
standard |
Default. Sensible permissions for most projects. |
financial_services |
Stricter controls for OSFI/SOX compliance. |
healthcare |
HIPAA-aware. Extra protection for PHI. |
government |
Maximum restrictions. Minimal auto-approval. |
mdxcode "Update the API" --profile financial_services
Multi-Model Support
Own the orchestration. Swap the models.
mdxcode "Fix the bug" --model claude # Default
mdxcode "Fix the bug" --model gpt # OpenAI
mdxcode "Fix the bug" --model bedrock # AWS Bedrock
Today it's Claude. Tomorrow it could be anything. Your choice.
Security Agent
Not just a linter. An AI that understands context.
# Scan for vulnerabilities
mdxcode security scan
# Scan specific path
mdxcode security scan --path src/
# Auto-fix what can be fixed
mdxcode security fix --auto-fix
# Teach it new patterns
mdxcode security learn
The knowledge base grows as you use it. Every fix teaches it something new.
Audit Trail
Every action. Every decision. Logged.
~/.mdxcode/audit/2026-01-09_abc123.jsonl
{
"timestamp": "2026-01-09T14:32:15Z",
"event": "tool_use",
"tool": "write_file",
"input": {"path": "src/api.py", "content": "..."},
"approved_by": "user",
"session_id": "abc123"
}
Essential for compliance. Essential for trust.
Project Structure
mdx-code/
├── mdxcode.py # CLI entry point
├── core/
│ ├── agent_loop.py # The heart of it
│ ├── context_loader.py
│ └── session.py
├── tools/
│ └── registry.py # read, write, edit, bash, grep, glob
├── models/
│ ├── router.py # Multi-model support
│ └── auth.py # Credential management
├── governance/
│ ├── permissions.py # What's allowed
│ ├── audit.py # Logging everything
│ └── security_agent.py
├── knowledge/
│ └── vulnerabilities/
└── examples/
└── demo_project/
Philosophy
Own the orchestration layer.
Models will come and go. Vendors will compete on capability and cost. But the orchestration... the context engineering, the governance, the institutional knowledge... that's yours.
Built for regulated environments.
This isn't a toy. It's designed for environments where compliance matters, where audit trails are required, where "move fast and break things" gets you fired.
Learn over time.
The security agent grows smarter. The patterns library expands. Every project teaches it something new.
Contributing
Found a bug? Want to add a feature? PRs welcome.
The code is intentionally readable. If you can't understand it in an afternoon, I've failed.
License
MIT. Use it. Modify it. Build on it.
Author
Built by MD.
Not because I had to. Because I couldn't stop thinking about it.
"The future of software development is agents that can actually do things. Now we know how they work."
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mdx_code-0.1.0.tar.gz.
File metadata
- Download URL: mdx_code-0.1.0.tar.gz
- Upload date:
- Size: 28.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6941c077a4c7ebd41774d0a1737035ec6fe2bd5364f059860d359e338d098571
|
|
| MD5 |
4d34278e33845949dba08fd9c80f1621
|
|
| BLAKE2b-256 |
7d5861e75ddfd6d12cdf9dddec4434606de1e0fef59e619254eeb9770060c43c
|
File details
Details for the file mdx_code-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mdx_code-0.1.0-py3-none-any.whl
- Upload date:
- Size: 33.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41828386d9fd3c1f44ff32b500043b802b00d6550c594f7f5aeed2c286858559
|
|
| MD5 |
ed67904a400d78ea03bc9aa9a67cecbb
|
|
| BLAKE2b-256 |
cff28fcbaffe2e4843b994676d64def2c28aa8df252ebe3019e18a1cd4a1a7e1
|