Django Orm Lens logo

Django Orm Lens

by FROWNINGdev

Read-only MCP tools for inspecting Django models, relationships, migrations, indexes, and signals through static analysis.

Install Django Orm Lens

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "frowningdev-django-orm-lens": {
      "command": "uvx",
      "args": [
        "orm-lens",
        "orm-lens-mcp"
      ],
      "env": {
        "ORM_LENS_ROOT": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Claude Code command
claude mcp add --env ORM_LENS_ROOT=YOUR_VALUE_HERE --transport stdio frowningdev-django-orm-lens -- uvx orm-lens orm-lens-mcp

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

We couldn’t confirm it starts correctly

The install command installed and started the server, which then stopped for configuration (such as an API key) that our sandbox does not have — expected for servers that connect to your account.

uvx orm-lens orm-lens-mcp

Process exited before answering initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

FROWNINGdev/django-orm-lens exposes nine read-only MCP tools for analyzing Django projects without connecting to a database or starting Django. It parses project source to report apps, models, fields, relationships, deletion behavior, migration dependencies, index suggestions, cascade effects, ER diagrams, and signal graphs. Set ORM_LENS_ROOT to the project's absolute path and install the MCP extra with pip. Reach for it when an AI agent needs reliable Django schema answers while the environment lacks a working virtualenv, settings module, database, or credentials.

Use cases

  • Inspect Django models and relationships from an AI coding client
  • Preview deletion cascades before changing related models
  • Trace migration dependencies and potential ordering problems
  • Find candidate indexes from Django model definitions
  • Map Django signals and their handlers

Key features

  • Nine read-only MCP tools
  • Static Django source and migration analysis
  • Foreign-key, many-to-many, and one-to-one relationship inspection
  • Cascade, ER diagram, migration, index, and signal analysis
  • No database, Django boot, or credentials required

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

35/35 checks healthy over the last 114d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 10d ago via OSV.dev · orm-lens (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars115Stargazers on the source repository.
Last commit2d agoMost recent push to the default branch.
Install checkRunsOur sandbox started it; it then asked for an API key or config.
Directory activity3 viewsConfig copies, upvotes, and views on AllMCPs.

How Django Orm Lens works

What FROWNINGdev/django-orm-lens does

FROWNINGdev/django-orm-lens makes Django's model structure available to AI agents through the Model Context Protocol. Its analysis is static: it reads project source rather than importing Django, connecting to a database, running a server, or requiring application credentials.

The MCP distribution is intended for schema-oriented questions. Agents can inspect installed applications and models, understand fields and relationships, preview cascade effects, examine migration dependencies, identify possible missing indexes, and map signal handlers. The package is the MCP surface of the broader ORM Lens project, which also has editor and command-line distributions.

How it works

Install the package with its MCP extra, point ORM_LENS_ROOT at the target project's absolute directory, and register the MCP process in the chosen client. The parser works from the repository's Django code and migrations, so it can operate even when the project's virtual environment is unavailable or Django cannot boot.

Results are read-only. The server does not modify models, migrations, databases, or project files. Static parsing also means the returned structure reflects what the analyzer can determine from source code rather than runtime database state.

Setup and configuration

Install the MCP variant with:

Terminal
pip install "django-orm-lens[mcp]"

Configure the MCP client to launch the installed server and set:

text
ORM_LENS_ROOT=/absolute/path/to/project

The repository also identifies the package as orm-lens; the django-orm-lens package name remains supported for installation. The MCP server can be used alongside the project's VS Code, VSCodium, or Cursor extension, but the extension and MCP package are separate interfaces.

Tools and capabilities

The nine read-only tools provide the following views:

  • listapps — enumerate Django applications.
  • listmodels — list models available in the project.
  • describemodel — inspect a model's structure.
  • findrelations — find foreign-key, many-to-many, and one-to-one relationships, including on_delete and related_name details.
  • cascadepreview — examine potential deletion cascades.
  • erdiagram — produce an entity-relationship view of the model graph.
  • describemigrationdependency — inspect dependencies between migrations.
  • suggestindexes — surface possible missing indexes.
  • signalgraph — show relationships between signals and their handlers.

These tools suit agents answering questions about schema structure, relationship impact, migration ordering, indexing, and signal behavior without requiring runtime application access.

Limitations and notes

The server is intentionally read-only and static. It does not use a database, boot Django, run runserver, or require credentials. Consequently, it is best suited to source-derived schema analysis rather than queries about live data, database statistics, or runtime behavior. The MCP listing describes the Django toolset; the wider ORM Lens project also supports static analysis for SQLAlchemy and Alembic through its other interfaces.

The project is MIT-licensed and belongs to the Developer Tools category. Its related editor extension is available for VS Code, VSCodium, and Cursor, with an Open VSX distribution.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Django Orm Lens

FROWNINGdev/django-orm-lens is an MCP server that connects AI agents to Django project source through static analysis. Its main tools list apps and models, describe models, inspect relationships, preview cascades, render ER diagrams, trace migration dependencies, suggest indexes, and map signal handlers without a database or credentials.

Install it with `pip install "django-orm-lens[mcp]"`. Register the MCP process in your client and set `ORM_LENS_ROOT` to the target Django project's absolute path.

Yes, it performs static parsing without booting Django or requiring a working virtual environment. It reads the project's source and migrations, so it does not need a database, settings boot, or credentials.

No, its MCP tools are read-only. They inspect Django source and migrations and do not modify models, migrations, databases, or other project files.

Yes, it is listed for use with Cursor, and the related ORM Lens extension is also available for Cursor. Install the MCP package separately and configure the client with `ORM_LENS_ROOT`.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewDjango Orm Lens AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/frowningdev-django-orm-lens?style=directory)](https://allmcps.com/mcp/frowningdev-django-orm-lens)
HTML Embed
<a href="https://allmcps.com/mcp/frowningdev-django-orm-lens"><img src="https://allmcps.com/api/badge/frowningdev-django-orm-lens?style=directory" alt="Django Orm Lens on AllMCPs" /></a>