Hi @rdruska,
You are right. The behaviour is a bit subtle and not well-documented yet. Having checked internally, here is what I have found. As of today, the DBSQL MCP server will, by default, pick a "random running" SQL warehouse from the set of warehouses that your token has access to.
However, there is a workaround for this... if you pass it via the MCP request’s _meta field, not via URL parameters or prompt text as you are currently doing.
If you’re calling the endpoint directly, you can pin the warehouse like this in the JSON‑RPC request body... If you do so, the DBSQL MCP server will use exactly the warehouse whose warehouse_id you provide.
{
"jsonrpc": "2.0",
"id": "1",
"method": "tools/call",
"params": {
"name": "execute_sql",
"arguments": {
"query": "SELECT 1"
},
"_meta": {
"warehouse_id": "<your-sql-warehouse-id>"
}
}
}
Does this help?
Just so that you are aware, adding ?warehouse_id=... to the URL is not supported. The server ignores that. Also, many MCP clients (e.g. some IDE integrations) don’t yet expose a way to set _meta, so from those tools you currently can’t override the warehouse. You’ll see the default random running warehouse behaviour. Appreicate it is not ideal but this is how it woks as of today.
If you share which MCP client you’re using (Cursor, Claude Code, VS Code extension, etc.), we can look at whether there’s a practical workaround (for example, calling MCP directly via HTTP or using a small proxy that injects _meta.warehouse_id for you).
If this answer resolves your question, could you mark it as “Accept as Solution”? That helps other users quickly find the correct fix.
Regards,
Ashwin | Delivery Solution Architect @ Databricks
Helping you build and scale the Data Intelligence Platform.
***Opinions are my own***