Run SQL queries and inspect database schemas through safe, visible MCP tools.
Connect Runs on your machine
claude mcp add grain -e GRAIN_CONNECTIONS=<GRAIN_CONNECTIONS> -e GRAIN_MCP_SAFE_MODE=<GRAIN_MCP_SAFE_MODE> -e GRAIN_MAX_ROWS=<GRAIN_MAX_ROWS> -- npx -y [email protected]
{
"mcpServers": {
"grain": {
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"GRAIN_CONNECTIONS": "<GRAIN_CONNECTIONS>",
"GRAIN_MCP_SAFE_MODE": "<GRAIN_MCP_SAFE_MODE>",
"GRAIN_MAX_ROWS": "<GRAIN_MAX_ROWS>"
}
}
}
}
{
"mcpServers": {
"grain": {
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"GRAIN_CONNECTIONS": "<GRAIN_CONNECTIONS>",
"GRAIN_MCP_SAFE_MODE": "<GRAIN_MCP_SAFE_MODE>",
"GRAIN_MAX_ROWS": "<GRAIN_MAX_ROWS>"
}
}
}
}
{
"servers": {
"grain": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"GRAIN_CONNECTIONS": "<GRAIN_CONNECTIONS>",
"GRAIN_MCP_SAFE_MODE": "<GRAIN_MCP_SAFE_MODE>",
"GRAIN_MAX_ROWS": "<GRAIN_MAX_ROWS>"
}
}
}
}
Replace the values in angle brackets with your own. Keys stay on your machine; we never see them.
Tools
This server runs locally, so its tools are listed by your MCP client once it starts.
Environment variables
| Name | Description |
|---|---|
GRAIN_CONNECTIONSOptional, secret | JSON array of Grain connection profiles for headless use. |
GRAIN_MCP_SAFE_MODEOptional | Set to false to allow mutating SQL. Defaults to true. |
GRAIN_MAX_ROWSOptional | Maximum rows returned by query tools. Defaults to 10000. |
Details
| Package | [email protected] (NPM, stdio) |
| First published | 4 Nov 2026 |
| Last updated | 4 Nov 2026 |
| Registry name | io.github.pattrnlabs/grain |
More databases servers See all
Listing data from the official MCP registry. Status and tools from NestDaddy's daily check. Browse all MCP servers.
