Skip to content
Download

Connect your agent ​

QueryLane includes an MCP server. An AI agent that supports MCP, such as Claude Code or Cursor, can use it to read and build jobs, run queries and runs, and inspect results in your QueryLane profile. The agent uses its own model and account. The built-in assistant is not needed for this.

Connect a supported client ​

QueryLane can set up these clients for you: Claude Code, Claude Desktop, Codex, Cursor, VS Code, Z Code, OpenCode, Hermes Agent and OpenClaw.

  1. Install the client on your computer.
  2. In QueryLane, open Settings > CLI and MCP.
  3. Find the client under QueryLane MCP and click Connect. Clients that QueryLane does not find on your computer are listed under Other supported clients. After you install one, click Refresh.
  4. Restart the client or start a new session in it. QueryLane reminds you of this after it saves the configuration.
  5. Check in the client that the QueryLane tools are available. Their names start with querylane_.

Connect installs the QueryLane CLI at ~/.local/bin/querylane (%USERPROFILE%\.local\bin\querylane.cmd on Windows) if it is missing, and adds a querylane server entry to the configuration of the client. It keeps the other entries in that file. For VS Code, the entry goes to the default VS Code profile.

The status next to each client shows Connected, Not connected, Update required or CLI required. For a client with Update required, click Update connection. If QueryLane warns that the CLI points to an older app location, click Update CLI.

QueryLane has no button to disconnect a client. To disconnect, remove the querylane entry from the client configuration.

Configure another client ​

For a client that is not in the list but runs local stdio MCP servers:

  1. Open Settings > CLI and MCP.
  2. If the QueryLane CLI is not installed, click Install CLI.
  3. Under Other MCP client, click Show settings.
  4. Copy the Command and Arguments, or the Configuration example, into the MCP settings of your client.
  5. Restart the client or start a new session.

The example has this shape:

json
{
  "mcpServers": {
    "querylane": {
      "command": "/Users/you/.local/bin/querylane",
      "args": ["mcp", "serve", "--profile", "main"]
    }
  }
}

On Windows, the client starts the app itself: Command is QueryLane.exe in %LOCALAPPDATA%\QueryLane, and Arguments begin with --cli, as in --cli mcp serve --profile main.

The client starts the server with the stdio transport. --profile selects the QueryLane profile the agent works in. Some clients use another top-level key instead of mcpServers, such as servers, mcp_servers, mcp or context_servers.

What the agent can do ​

The agent gets every tool of the QueryLane MCP server. With them it can:

  • read jobs, connections, database schemas, runs, results and plugins;
  • create jobs and connections, propose a change to a job with a diff, apply it and revert it;
  • test steps, start and cancel runs, and check results;
  • run SQL or MongoDB queries through a saved connection;
  • list, read, write and delete files on S3 and SFTP connections, and query them with SQL;
  • export data to CSV, JSON, JSONL or XLSX, and render charts;
  • build, change, refresh and save dashboards as HTML or PNG;
  • call tools of installed plugins;
  • open a job, run, step, connection, dashboard or settings section in the QueryLane window.

The MCP tools reference lists every tool with what it reads, changes or runs.

When the agent makes a report or something to watch, it builds a dashboard without asking. After a run that draws charts it offers one once, and a declined offer is not repeated until the job changes.

In Claude Desktop a reply that creates or changes a dashboard shows a card with an Open in QueryLane button. The button opens the dashboard in the app; Claude may ask you to allow the call first. Other clients get a link to the dashboard in the reply.

What agents may change ​

QueryLane limits agents in several ways. The limits apply over MCP, on the command line and in the built-in assistant, and they do not affect your own work in the QueryLane window.

  • Access per connection. Each connection has an agent level: No access, Read only or Read and write. With Read only, QueryLane refuses statements that change data or schema and runs queries in a read-only database session on PostgreSQL and compatible servers, MySQL and compatible servers, ClickHouse and SQLite. SQL Server has no read-only session, so QueryLane runs such queries in a transaction and always rolls it back; effects outside transactions, such as mail sent from the server, are not undone. For the databases of the JDBC plugin, see Agents with read-only access. MongoDB code runs in a separate process that can only read: find, aggregate, countDocuments, distinct and other reads work with ordinary JavaScript around them, while writes, $out, $merge, server-side JavaScript and other databases are refused. Query time limit in the Agents block of a connection caps how long a query of such agents may run. Set the levels in Settings > CLI and MCP > Agent access to connections or in the Agents block of a connection, see Agent access. Agents cannot change the level, Approve changes or the environment of a connection themselves.
  • Functions that read files. SQL functions that read files or reach other servers from inside a query, such as pg_read_file and dblink on PostgreSQL, LOAD_FILE on MySQL, OPENROWSET on SQL Server, or file(), url() and remote() on ClickHouse, count as writes. A read-only database session does not stop them, and on a database installed on your computer they would read your files, so an agent with Read only cannot use them.
  • Storages. S3 and SFTP connections have the same levels. With Read only, agents list folders, read files and query them. Writing and deleting files needs Read and write and follows Approve changes. Agents stay within the bucket, folder or start folder of the connection, and share links are made only in the app.
  • Code. Turn off Agents may run code in Settings > CLI and MCP to stop agents from running JavaScript, HTTP and plugin steps, plugin tools and MongoDB queries and steps on connections with Read and write, which also run as JavaScript. Such code runs on your computer and gets the values of job variables, secret ones included.
  • Secrets. Agents never receive passwords, API keys or tokens. Connections, settings and job variables reach them with masks instead of values. An agent that points a saved connection at another host does not take its saved password along: the saved secrets are dropped unless the agent gives its own, and a test of a saved connection goes only where the connection already points. On a Mac, only QueryLane signed by its developer can open the vault that holds them. On Windows, the vault key is encrypted for your Windows account, so other accounts and computers cannot read it. The Windows build is not code-signed yet, so the signature check works only on macOS for now.
  • Your keys and certificates. Agents cannot give a connection your SSH agent, private keys, known_hosts files or client certificates. A connection that already uses them keeps pointing where you set it: an agent cannot move it to another host.
  • Local files. Agents save files only into their own folder and never overwrite one. Other local files need your approval, see Local files.
  • Schedules. Agents cannot turn a schedule on. When an agent changes the steps, variables, schedule, output or notifications of a scheduled job, the schedule pauses. The same happens when an agent changes where a connection of a scheduled job goes: its host, port, database, file, endpoint, bucket or login. Turn the schedule on again in QueryLane once you have checked the change, see Schedules.

The levels guard against agent mistakes. The real boundary is the rights of the database login, so for a database the agent must not change, connect with a login that can only read. Test connection shows whether a login can write.

Approvals ​

On a connection with Read and write, Approve changes in the Agents block chooses whether agent changes go through at once (Allow always, the default) or wait for you (Ask). With Ask, a query that changes data, a run whose steps change data on that connection, or a file an agent writes to or deletes from a storage, opens a QueryLane window with the agent, the connection and the exact statement or file. Allow lets the change through, Allow always lets it through and stops asking for this connection, Deny refuses it. Reads never ask and run as with Read only.

The agent waits up to 50 seconds. Without an answer it gets AGENT_APPROVAL_TIMEOUT and can repeat the same call, which picks up your answer: the request stays in QueryLane for 10 minutes. When QueryLane is not running, the change fails at once with AGENT_APPROVAL_APP_CLOSED. QueryLane signs your answer with a key derived from the vault key, so an agent that can write files cannot approve its own change. MongoDB code first runs isolated as with Read only, and QueryLane asks only when it tries to write; running it in full also needs Agents may run code. The built-in assistant asks in its own chat instead.

Approvals catch agent mistakes. They do not stop an agent that changes QueryLane settings or connects to the database on its own, so the login rights stay the real boundary.

For everything else QueryLane does not ask, and the approval buttons of the built-in assistant do not apply to MCP. Each tool tells the client whether it only reads, changes something or reaches outside the profile, through the standard MCP hints readOnlyHint, destructiveHint and openWorldHint. Your client uses them and its own permission settings to decide when to ask you.

Set these permissions before you give the agent a task:

  • allow the read tools if you want the agent to explore on its own;
  • keep confirmation for the tools that change or execute something, such as querylane_db_query_execute, querylane_change_apply or querylane_run_start.

The agent receives real data from queries and results. Data for AI applies only to the built-in assistant, see Data privacy.

Local files ​

Agents work with files on your computer under stricter rules than you do in the app:

  • Saving files. Exports, job packages, chart images and dashboard files that an agent saves go only into the agent files folder of QueryLane. A file is never replaced: when the name is taken, the agent has to choose a new one. A path anywhere else is refused, so for a file that must go elsewhere, ask the agent to tell you and save it from QueryLane yourself
  • Reading files. Without asking, agents read only files in the agent files folder, for example a job package to import. A SQLite file or a Local files dataset that an agent sets on a connection must be there too, because every later query reads it without asking again
  • CSV and JSON steps. When an agent starts a run whose CSV or JSON steps read a file outside the folder, the run waits until you approve the paths in a QueryLane window, An agent wants to read local files. The path must be known before the run starts, as text or a variable, not another step's result. The built-in assistant asks in its chat instead. The rest of the QueryLane data folder stays closed to agents
  • Uploads. Uploading a file from your computer to a storage always asks first, also on a connection that does not ask before changes. You see the local path before the file leaves your computer
  • Network paths. Paths that name another computer, such as \\server\share or /net/..., are refused

The agent files folder is inside the QueryLane data folder:

text
~/Library/Application Support/app.querylane.desktop/agent-files/

On Windows it is %APPDATA%\app.querylane.desktop\agent-files\, on Linux ~/.local/share/app.querylane.desktop/agent-files/.

Action journal ​

Every call of an agent through MCP, the command line or the built-in assistant goes to agent-actions.jsonl in the logs folder: time, client, tool, connection, query text with passwords masked, outcome and duration, without result data. Open it in Settings > CLI and MCP > Action journal. Click a row to see its query, the MCP client that made the call, such as claude-code, and for a failure its details. The journal helps to see what happened; an agent that can write files can also edit it.