Skip to content

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.

Capabilitydatabase.er_diagram
AreaDatabases
Accesschanges files
Reachesdatabase, network
Rightsssh, write, database-permission, trusted-project
Dry runnone

Arguments

ArgumentTypeDescription
connectionrequiredstringConnection name from list_connections.
tablesarray of stringTables to start from (default: all tables).
depthintegerAlso include tables up to this many foreign keys away (default 0).minimum 0
formatstringmermaid (default), plantuml, dot, svg, png, graphml (yEd), drawio (draw.io), layout or json.
without_viewsbooleanLeave views out (default false: views and what they use are included).
scalenumberpng: scale factor 1–4 (default 2).
pathstringpng: workspace-relative file to write (required for png).
positionsobjectlayout, svg, png, graphml, drawio: table → [x, y] to move boxes to, as dragging does in the window.
viewportarray of numberlayout: 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.

Terminal window
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
}
}
}