scan, list, describe, hover and er read Entity Framework Core models as well as Django, SQLAlchemy, Prisma, Drizzle and Rails ones, and so do the MCP tools list_apps, list_models, describe_model, find_relations and er_diagram. They read the *ModelSnapshot.cs that dotnet ef migrations add keeps next to the migrations: it describes every entity with its properties, keys, indexes, table and relationships. It is read as text, with no .NET SDK, no build and no database.
uvx orm-lens scan -f table # every table in the model snapshot
uvx orm-lens er -f dbml # ER diagram: mermaid, dbml, d2, plantuml or dot
uvx orm-lens describe Post # one entity: columns, keys and what each does on delete
The other commands don’t read EF Core yet, and neither does the VS Code extension. The Django analyses never see an EF Core entity, and a Python relation never points at one.
Every file whose name ends in ModelSnapshot.cs, except in bin, obj, node_modules, packages, artifacts, dist, build, test directories (test, tests and projects ending in .Tests) and hidden directories. Symlinks that lead outside the workspace are skipped. The default exclude of migrations directories, which keeps Django migrations out of the model scan, does not apply: the snapshot always sits in Migrations/.
In a workspace with no Django or SQLAlchemy project, the MCP server looks for a snapshot at most five directories down, which covers src/App.Data/Migrations/. If yours is deeper, point workspace_root at a directory closer to it. The CLI has no such limit.
Tables are what the database has. An entity is listed under its class name (Blog, or the full name when two namespaces share one), with the table from ToTable (content.Posts when it names a schema) or the view from ToView. Table-per-hierarchy: an entity with HasBaseType and no table of its own adds its columns to its base type’s table, where they are nullable, since the other types’ rows leave them empty; keys that point at it point at that table. An entity with a table of its own (table-per-type) stays a table. Owned types (OwnsOne, OwnsMany) are not read yet.
Columns are the properties, named by HasColumnName when there is one, with the type from HasColumnType (or the CLR type). A property is NOT NULL when its type is a value type without ?, or when it is IsRequired(); strings and other reference types are nullable otherwise. args reads NOT NULL, UNIQUE and DEFAULT ... from HasDefaultValue or HasDefaultValueSql. The key comes from HasKey; a column is unique when HasAlternateKey or a unique index without a filter covers it alone.
Foreign keys come from HasOne(...).WithMany() or .WithOne() with HasForeignKey. The key is shown on its column as a ForeignKey, or as a OneToOneField for WithOne or a unique key column; references is HasPrincipalKey, or the target’s key. Composite keys and keys that share a column are kept, as for Drizzle.
Delete policy is OnDelete: Cascade, SetNull and Restrict as named, NoAction as NO_ACTION. The Client* behaviours, and an optional relationship without OnDelete (EF’s ClientSetNull), leave the database to take no action, so they show NO_ACTION: EF itself may still change tracked entities when one is deleted.
A snapshot belongs to the project that holds its Migrations folder: src/App.Data/Migrations/ is App_Data, and src/Catalog.API/Infrastructure/Migrations/ is Catalog_API. When that name isn’t unique, or another app already has it, the snapshot is named after its path instead. A solution with a snapshot per database provider (as Bitwarden has) lists each one. Relations always stay inside their own snapshot.
orm-lens scan --format json marks these models with "orm": "efcore" and adds tableName. Django models serialize exactly as before.
The snapshots of Jellyfin, Kavita, BTCPay Server, eShop (4 contexts), Bitwarden (PostgreSQL and MySQL), SimplCommerce and ABP’s EventHub were read and compared with a separate count over the same text. All 491 tables and 621 foreign keys were found, with every column, the table-per-hierarchy entities folded into their base tables, and the delete policy of every key, and the DBML diagram has one reference per foreign key. On the 29 Django and SQLAlchemy projects used for parser changes the output is the same as before.