← Back to directory
O

ORM Lens

Community
Statically inspect Django and SQLAlchemy projects, visualize relations, and review query and migration risks.
Category
Dev Tools #207 of 751
Stars
★ 114 Popular
Transport
stdio (local process)
Runtime
Python 3.10+
Credentials
No credential needed
License
MIT
Last commit
Tools
14
55FMRS · C

The supplied source describes ORM Lens's static analysis features, read-only MCP tools, stdio manifest configuration, and workspace selection. The official field is false because the source does not indicate that the server is maintained by the upstream owners of Django, SQLAlchemy, or the MCP protocol.

Strongest · Setup experience 12/20 Weakest · Reliability 8/20

Reliability
8/20
Security and permissions
12/20
Maintenance
11/20
Documentation
12/20
Setup experience
12/20
Why each score
Reliability 8/20
The README describes the MCP tools, workspace-resolution order, structured errors, and static analysis without app startup or database access, making the happy path plausible. However, only the README and manifest are available here: there is no server source, verified handshake or tool behavior, or verifiable server test and CI evidence. The declared tools therefore cannot be confirmed against actual behavior, limiting the score.
Security and permissions 12/20
The documentation says the tools are read-only and static, do not use database credentials, and offer an optional allowed-roots restriction; these claims suggest limited permissions and side effects. Workspace selection can still come from a call argument, environment variable, or current directory, and the materials provide no source evidence for how path boundaries are enforced or how data flows and network behavior work. No red-line evidence is present, but the claims alone do not justify a high score.
Maintenance 11/20
The materials state an MIT license and non-archived status, and provide a version, PyPI installation path, update route, and GitHub Issues channel. These indicate an identifiable maintenance path. The 114 stars and 26 open issues do not establish maintenance quality, and there is no evidence here of commit activity, issue response, dependency updates, or a security-response policy, so points are deducted.
Documentation 12/20
The README provides installation commands, a tool list, client configuration examples, workspace-selection options, platform requirements, and some error guidance, enough to understand the intended use and get started. Per-tool parameter and limitation details, troubleshooting, data-handling specifics, and source-verified capability evidence are lacking; tool counts also differ across README sections, so the score is limited.
Setup experience 12/20
The materials give a pip command with the MCP extra, a direct startup command, Cursor and generic client configuration examples, and the Python version requirement. They do not verify a clean-environment connection handshake, setup for other mainstream clients is mostly summarized, and there is no verifiable server CI or key-path test evidence. Under the static calibration, the score stays at or below 15.

Static review · not runReviewed 2026-12-04

Read the FMRS scoring method →

Fit and risk

What it can accessReads local files

Best for

  • Developers reviewing ORM models without starting the app or connecting to a database.
  • AI coding-agent workflows that need MCP access to schema information in a codebase.

Not for

  • Runtime query performance profiling or monitoring real traffic.
  • Use cases that require connecting to a database, reading live data, or running the app to verify behavior.

Required permissions

  • The tools are read-only and need access to project files in the selected workspace for static analysis.
  • Set the workspace with ORM_LENS_ROOT or workspace_root; ORM_LENS_ALLOWED_ROOTS can restrict allowed paths.

Risks and side effects

  • Static analysis depends on how well the parser recognizes project code and migrations; it does not replace runtime verification.
  • The README marks SQLAlchemy, Alembic, and other non-Django format support as preview.
  • Configure the workspace path to point only to the project you intend to analyze.

Setup

Before you start

Runtime:Python 3.10+

Other optional settings (2)
ORM_LENS_ROOT optional Optional: set this to the absolute path of the project to analyze. You can instead pass `workspace_root` in a tool call or use the current working directory.
ORM_LENS_ALLOWED_ROOTS optional Optional: set an allowlist of permitted root paths, separated by `:` (or `;` on Windows).

Install Python 3.10 or later, then run pip install "orm-lens[mcp]". Set the config command to orm-lens-mcp and point ORM_LENS_ROOT to the project's absolute path; alternatively, pass workspace_root on each tool call. Example client config: {"mcpServers":{"orm-lens":{"command":"orm-lens-mcp","env":{"ORM_LENS_ROOT":"/abs/path/to/your/project"}}}}.

MCP config · JSON
{"mcpServers":{"orm-lens":{"command":"orm-lens-mcp","env":{"ORM_LENS_ROOT":"/abs/path/to/your/project"}}}}

Works in clients that read an "mcpServers" key. For clients such as VS Code that use a different key, the configurator below converts it.

.vscode/mcp.json
{
  "servers": {
    "orm-lens": {
      "command": "orm-lens-mcp",
      "env": {
        "ORM_LENS_ROOT": "/abs/path/to/your/project"
      }
    }
  }
}

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

~/.codex/config.toml
[mcp_servers.orm-lens]
command = "orm-lens-mcp"

[mcp_servers.orm-lens.env]
ORM_LENS_ROOT = "/abs/path/to/your/project"

Append to ~/.codex/config.toml (OpenAI Codex CLI uses TOML).

Terminal
claude mcp add orm-lens -e ORM_LENS_ROOT=/abs/path/to/your/project -- orm-lens-mcp

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

Confirm `list_apps` and `nplusone_scan` appear in the client’s tool list. Call `list_apps` and check that it returns workspace app information.

Troubleshooting

  1. Check that Python 3.10 or later and orm-lens[mcp] are installed.
  2. Check that the client can find the orm-lens-mcp command.
  3. Check that ORM_LENS_ROOT or workspace_root points to a project directory containing Django, SQLAlchemy, or supported schema files.
  4. If the server returns a WORKSPACE_NOT_DJANGO error, verify the workspace path and the presence of supported project files.

Things to try

Once connected, you can ask your AI assistant things like:

  • List the apps and models in this project.
  • Show the model relationships and generate an ER diagram.
  • Check this project for N+1 issues and migration risks.
  • Analyze the impact of removing a field.

Tools 14

list_apps read-only
Lists Django apps in the workspace with model counts.
list_models read-only
Lists models, optionally filtered by app.
describe_model read-only
Returns field, relation, and Meta details for a model.
find_relations read-only
Finds inbound and outbound relations for a model.
cascade_preview read-only
Previews the cascade impact of a delete, grouped by on_delete behavior.
er_diagram read-only
Generates an ER diagram in Mermaid, DBML, D2, or PlantUML format.
describe_migration_dependency read-only
Describes an app's migration dependency graph, including roots, leaves, and cross-app dependencies.
suggest_indexes read-only
Suggests Meta.indexes based on observed QuerySet usage.
Show 6 more tools
signal_graph read-only
Analyzes the graph of Django signal senders, signals, and handlers.
migration_risk read-only
Checks Django, Alembic, and SQL migrations for risky patterns.
blast_radius read-only
Analyzes destructive migration risks, affected code, and cascade impact.
drift read-only
Statically compares fields implied by migrations with fields declared in models.py.
impact read-only
Finds references to a field or model name, grouped by Django layer.
nplusone_scan read-only
Scans the workspace for static N+1 query issues.

Use cases

Explore Django or SQLAlchemy models and their relations.
Generate ER diagrams and inspect migration dependencies.
Find static N+1 issues, migration risks, schema drift, and the impact of field references.

Overview

ORM Lens is a static ORM analysis tool for developers and AI coding agents, with an MCP server. It analyzes models, relations, migrations, and Alembic revisions; generates ER diagrams; and checks for N+1 issues, migration risks, schema drift, and field impact. The README says analysis does not require starting the application or connecting to a database. The MCP server provides read-only tools over stdio. SQLAlchemy support is marked preview.

Similar servers

Source revision 64211b376d3d Data synced 2026-12-05 Read the FMRS scoring method Markdown

Maintainer badge: embed FMRS score

Paste this Markdown into your repository README to display a live score badge:

README.md
[![FollowMCP](https://followmcp.com/badges/frowningdev-cli.svg)](https://followmcp.com/en/servers/frowningdev-cli)