Hey team, I've been hitting a 55 second timeout limit when using the motherduck MCP while on claude.ai. Is that a timeout imposed by the claude agent harness, or is that your servers? Is there a way you could make that timeout configurable by the LLM at call time? Or make it longer by default? Or do you have other suggestions on what I could do? I am doing a CREATE TABLE my_derived AS <complex select over ~billion rows> .
The 55s timeout is indeed on the MotherDuck side. However, it is set so that you don't encounter the 60s timeout on the claude.ai side. The claude side is a silent timeout whereas the MotherDuck is explicit. There are a number of suggestions to doing your CTAS with over a billion rows. These are claude's suggestions: What actually works for a CREATE TABLE AS <complex select over ~1B rows> A few options, in roughly increasing order of robustness: 1. Fire-and-forget with polling. Issue the CREATE TABLE and don't wait synchronously. MotherDuck supports inspecting active server connections via md_active_server_connections() and interrupting them with md_interrupt_server_connection(client_connection_id). The pattern: have the LLM issue the CREATE TABLE wrapped so it runs server-side, then check progress with separate short queries on subsequent turns. This keeps each individual MCP call under the 55s wall. MotherDuckMotherDuck 2. Decompose the query. Build the derived table in chunks. CREATE TABLE my_derived AS SELECT ... WHERE date_bucket = '2024-01' then INSERT INTO my_derived SELECT ... WHERE date_bucket = '2024-02', etc. Each insert finishes inside 55s and the result is the same table. 3. Use a materialized intermediate. If the bottleneck is a heavy aggregation, pre-aggregate to a smaller staging table first, then the final CREATE TABLE is cheap. Two short hops instead of one long one. 4. Move off web claude.ai for the heavy job. Run the same CREATE TABLE from Claude Code (their machine) using either DuckDB CLI with md: or the local MotherDuck MCP server. Claude Code's MCP timeout is also ~60s by default, but the customer can drop the MCP entirely there and just have Claude Code shell out to duckdb md: -c "CREATE TABLE ..." โ that runs as a regular subprocess with no MCP timeout in the path at all. The model only sees "command exited 0 after 14m32s," which is exactly the "model orchestrates, doesn't carry the payload" pattern from the previous thread.
oh nice, the solution 1 is probably what I want. Sorry to make you do my "ask the LLM"ing for me! I'm not sure if the docs at https://motherduck.com/docs/sql-reference/mcp/query-rw/ are a direct 1:1 correspondence with what the MCP server actually returns to the LLM as a tool description, but if it is, then the "limits" section mentions this timeout, but it does not suggest this workaround. Could you adjust your MCP tool definition so that it actually suggests this workaround? Agents LOVE getting direct suggestions in tool descriptions.
Also, are you sure that option 1 works? I am suggesting this to claude and it is not working. I'm not THAT familiar with MCP but it looks to me like asyncronous tasks require explicit implementation by the mpc server.
Hey Nick C., you are correct and option 1 does not work. We do not (yet) support async/long-running remote tasks without an active client. If you need to avoid the 55s timeout limit of our remote MCP, my suggestion today is to spin up a local DuckDB MCP server using: https://github.com/motherduckdb/mcp-server-motherduck . Though it requires local CC and I guess this does not work for you?
Yes, per this thread, it turns out doing anything via a local duckdb process won't work (because the md extension will make network requests to a motherduck domain, not on anthropic's allowlist). It currently seems to me that to get around this network firewall, I HAVE to use the MCP in the claude.ai cloud env.
.png)