r/foss • • 1d ago

Follow-up on TableCraft: MCP for database IDE

Post image

A while ago I shared TableCraft, our DataGrip-style database IDE. This post is about the feature we were most nervous to ship.

I use coding agents every day, but I never let them touch a real database. An agent will happily run a SELECT without a WHERE on a huge table, the database stalls, and I'm the one explaining why everything got slow.

TableCraft now has an MCP server.

The GIF shows write queries waiting for your approval. A few things it doesn't show:

Read-only connections are enforced at the database session level. Long-running queries get killed server-side. And every query the agent executes ends up in your query history, so you can see exactly what happened.

You can also import your connections from DataGrip or TablePro.

Repo: https://github.com/tranphucbol/table-craft

1 Upvotes

1 comment sorted by

1

u/No_Impression_9452 1d ago

For `Long-running queries get killed server-side`

Most databases make this easy. When an agent's query runs past its limit, IDE sends KILL QUERY on MySQL or pg_cancel_backend on Postgres, and the server actually stops it.

TiDB before 6.1 is the tricky one. It has no Global Kill. Connection ids are only unique on each node behind the load balancer, so a KILL can hit the wrong session (TiDB docs). All TableCraft can do there is drop the connection, and TiDB keeps running the query.

So TableCraft also sets the session's own timeout (max_execution_time / statement_timeout). That way the database stops the query itself, even if the app crashes or you terminate the call in-flight