Grain SQL
io.github.pattrnlabs/grain
Run SQL queries and inspect database schemas through safe, visible MCP tools.
- Repository
- github.com/pattrnlabs/grain
- Website
- grain.tools/
- Version
- 0.10.53
- Author
- pattrnlabs (namespace verified by the registry)
- Source
- Official MCP registry (updated Nov 20, 2026)
How to install it
Variables to fill in: GRAIN_CONNECTIONS, GRAIN_MCP_SAFE_MODE, GRAIN_MAX_ROWS.
On your machine
Claude Code
The server runs on your machine (npm package). In a terminal:
claude mcp add grain -e GRAIN_CONNECTIONS=YOUR_GRAIN_CONNECTIONS -e GRAIN_MCP_SAFE_MODE=YOUR_GRAIN_MCP_SAFE_MODE -e GRAIN_MAX_ROWS=YOUR_GRAIN_MAX_ROWS -- npx -y [email protected]Claude Desktop claude_desktop_config.json
Settings, Developer, Edit config, then add:
{
"mcpServers": {
"grain": {
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"GRAIN_CONNECTIONS": "YOUR_GRAIN_CONNECTIONS",
"GRAIN_MCP_SAFE_MODE": "YOUR_GRAIN_MCP_SAFE_MODE",
"GRAIN_MAX_ROWS": "YOUR_GRAIN_MAX_ROWS"
}
}
}
}Cursor ~/.cursor/mcp.json
In ~/.cursor/mcp.json:
{
"mcpServers": {
"grain": {
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"GRAIN_CONNECTIONS": "YOUR_GRAIN_CONNECTIONS",
"GRAIN_MCP_SAFE_MODE": "YOUR_GRAIN_MCP_SAFE_MODE",
"GRAIN_MAX_ROWS": "YOUR_GRAIN_MAX_ROWS"
}
}
}
}VS Code .vscode/mcp.json
In .vscode/mcp.json:
{
"servers": {
"grain": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"GRAIN_CONNECTIONS": "YOUR_GRAIN_CONNECTIONS",
"GRAIN_MCP_SAFE_MODE": "YOUR_GRAIN_MCP_SAFE_MODE",
"GRAIN_MAX_ROWS": "YOUR_GRAIN_MAX_ROWS"
}
}
}
}ChatGPT
ChatGPT only connects to remote servers (an https address). This package runs locally: use one of the apps above.
These configurations are built from the information published by the author. Check the repository before installing a local server.
Our test
This server runs on your machine: we cannot test it remotely.
Reviews
No review yet.
Sign in to leave a review. Your email is all you need.
Comments
No comment yet. A question, a tip? Start the discussion.
Sign in to comment.
Badge for your README
Show that your project is listed (and tested, if it responds): paste this code in your README. The badge follows the latest test and links back to this entry.
Markdown (GitHub)
[](https://lagora.dev/en/entry/io.github.pattrnlabs/grain)HTML
<a href="https://lagora.dev/en/entry/io.github.pattrnlabs/grain"><img src="https://lagora.dev/badge/io.github.pattrnlabs/grain.svg?lang=en" alt="io.github.pattrnlabs/grain on L’Agora" height="20"></a>For the entry’s author only: sign in to continue.