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.
| Capability | database.save_connection |
|---|---|
| Area | Databases |
| Access | changes files |
| Reaches | — |
| Rights | write |
| Dry run | dry_run, on unless the call turns it off |
Arguments
| Argument | Type | Description |
|---|---|---|
id | string | Id of the connection to change; a new connection when omitted. |
vault | string | A 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. |
namerequired | string | Display name, unique in the workspace. |
dialectrequired | string | postgresql, mysql, mariadb, sqlserver, oracle, sqlite, duckdb, or the id of a
database system from list_connectors (e.g. tidb), which selects its family. |
system | string | Database system from list_connectors on top of the dialect (optional). |
host | string | Server host (not for SQLite; default localhost). |
port | integer | Server port; the dialect's default when omitted.minimum 0 · maximum 65535 |
database | string | Database name. |
user | string | User name. |
path | string | Database file, workspace-relative or absolute (SQLite and DuckDB; it must exist, or pass create_file). |
ssl | string | disable, prefer, require, verify-ca or verify-full (default for a new connection:
verify-full, SPEC-0016 v2). |
read_only | boolean | Refuse statements that change data or schema. |
ssh_host | string | SSH 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_port | integer | SSH port, when not the config's.minimum 0 · maximum 65535 |
ssh_user | string | SSH user, when not the config's. |
ca_file | string | PEM file of the certificate authorities to trust (needs verify-ca or verify-full); empty removes it. |
cert_file | string | Client certificate: PEM with key_file, or a .p12 bundle (MySQL/MariaDB: .p12 only). |
key_file | string | PEM file of the client key (mode 600, no passphrase). |
auto_commit | boolean | Consoles and data editors start in automatic commit mode (default true). |
startup_script | string | SQL run after every connect; empty removes it. |
connect_timeout_secs | integer | Seconds allowed for connecting (1–86400; 0 removes the setting).minimum 0 |
query_timeout_secs | integer | Seconds a statement may run before the server ends it (1–86400; 0 removes the setting).minimum 0 |
keep_alive_secs | integer | Seconds between TCP keep-alive probes (1–86400; 0 removes the setting).minimum 0 |
schemas | array of string | Schema patterns shown besides the current one (* matches anything); empty shows all. |
color | string | Colour: red, orange, yellow, green, blue, violet, gray; empty removes it. |
comment | string | A note shown in the tree's tooltip; empty removes it. |
dry_run | boolean | Only check and return the profile without saving (default true). |
create_file | boolean | SQLite 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.
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 } }}