Skip to content

save_connection

MCP tools › Databases

Add or change a workspace database connection as the connection dialog does: server or SQLite/DuckDB file, user, SSL (new default verify-full), read-only, SSH tunnel (strict host keys, local end on 127.0.0.1), TLS files and options; omitted fields of a changed connection are kept. New connections get read-only agent permissions. Passwords are never taken here: the user types them in the dialog, or vault names a vault handle the person approves in the window. Dry run unless dry_run false. create_file creates an empty database file in the workspace, never over an existing one.

Capabilitydatabase.save_connection
AreaDatabases
Accesschanges files
Reaches—
Rightswrite
Dry rundry_run, on unless the call turns it off

Arguments

ArgumentTypeDescription
idstringId of the connection to change; a new connection when omitted.
vaultstringA handle of Ferris IDEA's vault (vlt_…, SPEC-0353 behaviour 14) whose entry allows database and this connection's host and port: its value becomes the password, put in place by Ferris IDEA after the person's approval. Not for file databases.
namerequiredstringDisplay name, unique in the workspace.
dialectrequiredstringpostgresql, mysql, mariadb, sqlserver, oracle, sqlite, duckdb, or the id of a database system from list_connectors (e.g. tidb), which selects its family.
systemstringDatabase system from list_connectors on top of the dialect (optional).
hoststringServer host (not for SQLite; default localhost).
portintegerServer port; the dialect's default when omitted.minimum 0 · maximum 65535
databasestringDatabase name.
userstringUser name.
pathstringDatabase file, workspace-relative or absolute (SQLite and DuckDB; it must exist, or pass create_file).
sslstringdisable, prefer, require, verify-ca or verify-full (default for a new connection: verify-full, SPEC-0016 v2).
read_onlybooleanRefuse statements that change data or schema.
ssh_hoststringSSH tunnel host (alias from ~/.ssh/config or host name); empty removes the tunnel (SPEC-0108 v4). Keys and the SSH agent are used; no password is ever taken.
ssh_portintegerSSH port, when not the config's.minimum 0 · maximum 65535
ssh_userstringSSH user, when not the config's.
ca_filestringPEM file of the certificate authorities to trust (needs verify-ca or verify-full); empty removes it.
cert_filestringClient certificate: PEM with key_file, or a .p12 bundle (MySQL/MariaDB: .p12 only).
key_filestringPEM file of the client key (mode 600, no passphrase).
auto_commitbooleanConsoles and data editors start in automatic commit mode (default true).
startup_scriptstringSQL run after every connect; empty removes it.
connect_timeout_secsintegerSeconds allowed for connecting (1–86400; 0 removes the setting).minimum 0
query_timeout_secsintegerSeconds a statement may run before the server ends it (1–86400; 0 removes the setting).minimum 0
keep_alive_secsintegerSeconds between TCP keep-alive probes (1–86400; 0 removes the setting).minimum 0
schemasarray of stringSchema patterns shown besides the current one (* matches anything); empty shows all.
colorstringColour: red, orange, yellow, green, blue, violet, gray; empty removes it.
commentstringA note shown in the tree's tooltip; empty removes it.
dry_runbooleanOnly check and return the profile without saving (default true).
create_filebooleanSQLite and DuckDB: create the empty database file before saving (SPEC-0108 v13 behaviour 23). Only with dry_run false and the write permission, only inside the workspace (not through .. or a link to outside), never over an existing file, in an existing folder.

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 save_connection '{"name":"<string>","dialect":"<string>"}'
Input schema as JSON
{
"type": "object",
"required": [
"name",
"dialect"
],
"properties": {
"id": {
"description": "Id of the connection to change; a new connection when omitted.",
"type": [
"string",
"null"
],
"default": null
},
"vault": {
"description": "A handle of Ferris IDEA's vault (`vlt_…`, `SPEC-0353` behaviour 14) whose entry allows\n`database` and this connection's host and port: its value becomes the password, put in\nplace by Ferris IDEA after the person's approval. Not for file databases.",
"type": [
"string",
"null"
],
"default": null
},
"name": {
"description": "Display name, unique in the workspace.",
"type": "string"
},
"dialect": {
"description": "`postgresql`, `mysql`, `mariadb`, `sqlserver`, `oracle`, `sqlite`, `duckdb`, or the id of a\ndatabase system from `list_connectors` (e.g. `tidb`), which selects its family.",
"type": "string"
},
"system": {
"description": "Database system from `list_connectors` on top of the dialect (optional).",
"type": [
"string",
"null"
],
"default": null
},
"host": {
"description": "Server host (not for SQLite; default `localhost`).",
"type": [
"string",
"null"
],
"default": null
},
"port": {
"description": "Server port; the dialect's default when omitted.",
"type": [
"integer",
"null"
],
"default": null,
"minimum": 0,
"maximum": 65535
},
"database": {
"description": "Database name.",
"type": [
"string",
"null"
],
"default": null
},
"user": {
"description": "User name.",
"type": [
"string",
"null"
],
"default": null
},
"path": {
"description": "Database file, workspace-relative or absolute (SQLite and DuckDB; it must exist, or pass\ncreate_file).",
"type": [
"string",
"null"
],
"default": null
},
"ssl": {
"description": "`disable`, `prefer`, `require`, `verify-ca` or `verify-full` (default for a new connection:\n`verify-full`, SPEC-0016 v2).",
"type": [
"string",
"null"
],
"default": null
},
"read_only": {
"description": "Refuse statements that change data or schema.",
"type": [
"boolean",
"null"
],
"default": null
},
"ssh_host": {
"description": "SSH tunnel host (alias from ~/.ssh/config or host name); empty removes the tunnel\n(SPEC-0108 v4). Keys and the SSH agent are used; no password is ever taken.",
"type": [
"string",
"null"
],
"default": null
},
"ssh_port": {
"description": "SSH port, when not the config's.",
"type": [
"integer",
"null"
],
"default": null,
"minimum": 0,
"maximum": 65535
},
"ssh_user": {
"description": "SSH user, when not the config's.",
"type": [
"string",
"null"
],
"default": null
},
"ca_file": {
"description": "PEM file of the certificate authorities to trust (needs verify-ca or verify-full); empty\nremoves it.",
"type": [
"string",
"null"
],
"default": null
},
"cert_file": {
"description": "Client certificate: PEM with key_file, or a .p12 bundle (MySQL/MariaDB: .p12 only).",
"type": [
"string",
"null"
],
"default": null
},
"key_file": {
"description": "PEM file of the client key (mode 600, no passphrase).",
"type": [
"string",
"null"
],
"default": null
},
"auto_commit": {
"description": "Consoles and data editors start in automatic commit mode (default true).",
"type": [
"boolean",
"null"
],
"default": null
},
"startup_script": {
"description": "SQL run after every connect; empty removes it.",
"type": [
"string",
"null"
],
"default": null
},
"connect_timeout_secs": {
"description": "Seconds allowed for connecting (1–86400; 0 removes the setting).",
"type": [
"integer",
"null"
],
"default": null,
"minimum": 0
},
"query_timeout_secs": {
"description": "Seconds a statement may run before the server ends it (1–86400; 0 removes the setting).",
"type": [
"integer",
"null"
],
"default": null,
"minimum": 0
},
"keep_alive_secs": {
"description": "Seconds between TCP keep-alive probes (1–86400; 0 removes the setting).",
"type": [
"integer",
"null"
],
"default": null,
"minimum": 0
},
"schemas": {
"description": "Schema patterns shown besides the current one (`*` matches anything); empty shows all.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
},
"default": null
},
"color": {
"description": "Colour: red, orange, yellow, green, blue, violet, gray; empty removes it.",
"type": [
"string",
"null"
],
"default": null
},
"comment": {
"description": "A note shown in the tree's tooltip; empty removes it.",
"type": [
"string",
"null"
],
"default": null
},
"dry_run": {
"description": "Only check and return the profile without saving (default true).",
"type": [
"boolean",
"null"
],
"default": null
},
"create_file": {
"description": "SQLite and DuckDB: create the empty database file before saving (SPEC-0108 v13 behaviour\n23). Only with dry_run false and the write permission, only inside the workspace (not\nthrough `..` or a link to outside), never over an existing file, in an existing folder.",
"type": [
"boolean",
"null"
],
"default": null
}
}
}