Kanel v4: Generate Markdown from Postgres
Give your LLM all the details about your database without MCP's
I just published Kanel v4. Kanel was born as a tool for generating Typescript types from a live PostgreSQL database. V4 changes the architecture around so you can have multiple distinct generators.
It comes with a new built-in generator for Markdown. This can be used to document your data model for your fellow team members, but the primary use case that I picture is LLM consumption. I’ve used an MCP server for my developer database which does work, but it feels slightly clumsy to me, and including a markdown with with an @-tag when pointing something out feels very natural.
I’ve created an example for the dvd-rental database. You can see the result here.
Even if you are using an ORM that mirrors the database schema in some way, those files often miss some of the finer nuances that are possible with Postgres. With Kanel, you can construct documentation that goes into just about as much detail as you could want. The engine has access to everything that extract-pg-schema exposes, which allows you to document indices, procedures, ranges, domains and most other Postgres-specific features.
Setting it up requires a bit of configuration work, as I don’t think I would be able to write a general-purpose template that would suit all teams. It works with Handlebars templates which will be used to generate the final result.

