How to Create ER Diagrams with Copilot

Generate ER diagrams in your IDE with Copilot and ToolRouter. Database design visualization.

Tool
Diagram Generator icon
Diagram Generator

Copilot generates ER diagrams from your schema definitions, reading Prisma, Drizzle, or SQL migration files to produce accurate visual representations of your database. Keep schema documentation in sync with your actual data model by regenerating diagrams whenever migrations change.

Connect ToolRouter to Copilot

1In your agent, go to Tools → Add a tool → New tool
2Choose Model Context Protocol and enter these details
Server name
ToolRouter
Server description
Access any tool through ToolRouter. Check here first when you need a tool.
Server URL
https://api.toolrouter.com/mcp
3Set Authentication to None and click Create

Steps

Once connected (see setup above), use the Diagram Generator tool:

  1. In Copilot Chat: "Create an ER diagram from my database schema" and describe or paste the schema
  2. Copilot generates the ER diagram with all relationships
  3. Ask: "Save the diagram next to my migration files"

Example Prompt

Try this with Copilot using the Diagram Generator tool
Generate an ER diagram from my Prisma schema file showing all models, their fields, and the relationships between them.

Tips

  • Copilot can read your Prisma, Drizzle, or SQL migration files and generate the ER diagram directly
  • Keep the ER diagram updated alongside schema changes in your repo