Django ORM LensBLOCK
Django ER diagrams, N+1 detection, schema drift & migration-risk linting — in VS Code, a CLI and an MCP server. Static analysis: no database, no django.setup(). Free & MIT.
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
English · Русский · Español · 中文
ER diagrams, N+1 detection and migration-risk checks for Django — without booting it.
Your entire model graph — live in your editor sidebar, gating your CI, and answering your AI agent over MCP. All from static parsing: no database, no runserver, no working venv.
Replaces: graph_models + django-schema-graph + hand-drawn ER diagrams + grep archaeology.
[](https://pypi.org/project/django-orm-lens/) [](https://pypi.org/project/django-orm-lens/) [](https://pypi.org/project/django-orm-lens/) [](https://github.com/FROWNINGdev/django-orm-lens/actions/workflows/ci.yml) [](https://pepy.tech/project/django-orm-lens) [](LICENSE)
[
13 read · 0 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
blast_radius | read | return handler( |
cascade_preview | read | return handler( |
describe_migration_dependency | read | return handler( |
describe_model | read | return handler({ |
drift | read | return handler({ |
er_diagram | read | return handler( |
find_relations | read | return handler({ |
impact | read | return handler({ |
list_apps | read | return handler({ |
list_models | read | args: dict[str, Any] = { |
nplusone_scan | read | return handler({ |
signal_graph | read | return handler({ |
suggest_indexes | read | return handler( |
Trust audit
BLOCKgrade D · trust 69/100 Do not install this without reading the findings. The audit found something that could harm you or your machine.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | FAIL |
| L2 | Instruction surface (what it tells the agent) | FAIL |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- declared (2 observation(s))
- Shell
- none-observed
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (14)
b64decode( ... subprocess.
- **UTF-8 BOM (`U+FEFF`) at the start of a models.py file no longer eats the whole class.** Windows editors — Notepad, older Sublime, VS Code with certain encoding settings — save files with a byte-or
if content.startswith(""):.pre-commit-hooks.yaml
.vscodeignore
export-payload.test.js
const { datetimeRules } = require('../../out/rules/datetime');const { ALL_FIXERS, findFixersForCode } = require('../../out/rules/fixers');const { formsRules } = require('../../out/rules/forms');const { modelRules } = require('../../out/rules/models');const { querysetRules } = require('../../out/rules/queryset');return base64.b64decode(payload["content"])
BOM = ""
@xyflow/react, elkjs, html-to-image, react, react-dom, @types/node, @types/react, @types/react-dom
Gates applied: critical_finding, no_behavioural_pass.
7b762f7139c7full audit observations/trust-audit/mcp-server/frowningdev__django-orm-lens.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | 7b762f7139c7 | BLOCK | D | 69 | first audit |
Questions
What is the Django ORM Lens MCP server?
Django ER diagrams, N+1 detection, schema drift & migration-risk linting — in VS Code, a CLI and an MCP server. Static analysis: no database, no django.setup(). Free & MIT.
What tools does Django ORM Lens expose?
13 in total: 13 read-only, 0 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is Django ORM Lens safe to connect to an agent?
No — not without reading the findings first. The audit graded it D (69/100) and found 2 critical or high issues in the source. Each one is listed on this page with the file and line it is on.
What credentials does Django ORM Lens need?
No credential environment variables were found in its source, so it appears to need none.
How does Django ORM Lens run?
It speaks stdio, so it runs as a local process your client starts. It is published on npm as django-orm-lens at 0.19.3.
How current is this page?
The grade is for one exact copy of the source (7b762f7139c7), read on 2026-10-08. The repository is watched and re-audited when it changes.