Documentation
Overview
Grain is a set of analytics tools for agents and humans. You can query your databases from VS Code, from the terminal, or through an AI agent that supports the Model Context Protocol (MCP), and every query goes through one local Grain service on your own machine.
The Grain service holds your database connections and credentials. Your editor, the grain command and your agents all talk to that service, so a query an agent runs shows up in the same results panel as your own queries. Grain has no hosted server and no bundled AI model, so your queries, schemas and passwords stay on your machine.
What you can do with Grain
- Let an agent set Grain up for you, connect your AI agents, and show you demo data. See Let your agent set up Grain.
- Add a database without typing the password into a chat. See Connections and passwords.
- Run the same actions from the terminal with the
graincommand. See The grain command. - Work in the VS Code results panel. See VS Code.
- Try the browser workspace, which is in beta. See The browser workspace.
Where to go next
- Installation explains how to install the Grain CLI, then the VS Code extension if you want it.
- Connect your agent explains
grain connectand the manual setup for each agent. - Connectors lists the nine databases Grain supports and what each one needs.
- Safe mode explains what an agent is allowed to run, and where Grain enforces that limit.
- Privacy and telemetry explains what anonymous usage data Grain sends and how to turn it off.