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***