Documentation
Overview
Grain is a fast, local-first SQL workspace for VS Code and MCP-enabled AI agents. Run a statement yourself or let an agent run it — either way the results land in a tab beside the file you are working in.
A local daemon owns every database connection. Your editor talks to it, and so does your agent, over the Model Context Protocol. There is no hosted Grain service and no bundled AI model: no query, schema, or credential of yours passes through a server of ours, because there is no server of ours in the path.
When to use Grain
Reach for this when your AI coding assistant (like Claude Desktop, Cursor, or Copilot) needs to run or inspect SQL against a real database without you leaving your editor, or when you want to see the exact statement the agent ran rather than trust its summary.
Where to go next
- Installation — install the extension, or just the MCP server.
- Connect your agent — per-client configuration for Claude Desktop, Claude Code, Cursor, Copilot, Windsurf, and Codex.
- Connectors — the nine databases Grain speaks to and what each one needs.
- Safe mode — what an agent is allowed to run, and where that limit is enforced rather than advised.