er_diagram
MCP tools › Databases
Entity-relationship diagram of a connection's tables and views: columns with PK/FK/UK marks, foreign keys with cardinality, what views use, and foreign keys leaving the selection. Exports are always complete. Formats: Mermaid (default), PlantUML, DOT, SVG, PNG (written to path), GraphML, draw.io, layout geometry or JSON; positions moves boxes first. Nothing leaves the machine. Needs the read-schema permission.
Its results carry text from database: the client is told to treat that as data, never as instructions.
| Capability | database.er_diagram |
|---|---|
| Area | Databases |
| Access | changes files |
| Reaches | database, network |
| Rights | ssh, write, database-permission, trusted-project |
| Dry run | none |
Arguments
| Argument | Type | Description |
|---|---|---|
connectionrequired | string | Connection name from list_connections. |
tables | array of string | Tables to start from (default: all tables). |
depth | integer | Also include tables up to this many foreign keys away (default 0).minimum 0 |
format | string | mermaid (default), plantuml, dot, svg, png, graphml (yEd), drawio (draw.io),
layout or json. |
without_views | boolean | Leave views out (default false: views and what they use are included). |
scale | number | png: scale factor 1–4 (default 2). |
path | string | png: workspace-relative file to write (required for png). |
positions | object | layout, svg, png, graphml, drawio: table → [x, y] to move boxes to, as dragging
does in the window. |
viewport | array of number | layout: width and height of the visible area, for the fit zoom.minItems 2 · maxItems 2 |
Call it from a shell
ferris-idea call runs one tool with the rights and safe mode of ferris-idea mcp. Replace the folder and the placeholder values.
ferris-idea call ~/my-project er_diagram '{"connection":"<string>"}'Input schema as JSON
{ "type": "object", "required": [ "connection" ], "properties": { "connection": { "description": "Connection name from `list_connections`.", "type": "string" }, "tables": { "description": "Tables to start from (default: all tables).", "type": [ "array", "null" ], "items": { "type": "string" } }, "depth": { "description": "Also include tables up to this many foreign keys away (default 0).", "type": [ "integer", "null" ], "minimum": 0 }, "format": { "description": "`mermaid` (default), `plantuml`, `dot`, `svg`, `png`, `graphml` (yEd), `drawio` (draw.io),\n`layout` or `json`.", "type": [ "string", "null" ] }, "without_views": { "description": "Leave views out (default false: views and what they use are included).", "type": [ "boolean", "null" ] }, "scale": { "description": "`png`: scale factor 1–4 (default 2).", "type": [ "number", "null" ] }, "path": { "description": "`png`: workspace-relative file to write (required for `png`).", "type": [ "string", "null" ] }, "positions": { "description": "`layout`, `svg`, `png`, `graphml`, `drawio`: table → [x, y] to move boxes to, as dragging\ndoes in the window.", "type": [ "object", "null" ], "additionalProperties": { "type": "array", "items": { "type": "number" }, "minItems": 2, "maxItems": 2 } }, "viewport": { "description": "`layout`: width and height of the visible area, for the fit zoom.", "type": [ "array", "null" ], "items": { "type": "number" }, "minItems": 2, "maxItems": 2 } }}