# Grain

- Name: `io.github.pattrnlabs/grain`
- Tier: **Indexed** (Crawled from a public source. No check has passed yet, or a check failed.)
- Latest version: 0.10.18, released 2026-09-30
- Website: https://grain.tools
- Source: https://github.com/pattrnlabs/grain
- Trust page: https://mcpvetted.com/t/github-pattrnlabs-grain

Run SQL queries and inspect database schemas through safe, visible MCP tools.

## What it can reach

- Network: none seen
- Files: none seen
- Accounts and secrets: Secret: GRAIN_CONNECTIONS

## Checks

### qualify: pass
Rules 2026-09-29.1, ran 2026-09-30T03:04:43.741Z.

### static: pass
Rules 2026-09-29.1, ran 2026-09-30T03:04:43.741Z.

### llm_claims: skipped
Rules 2026-09-29.1, ran 2026-09-30T03:04:43.741Z.
- [info] LLM claims check is not configured on this deploy.

## Install

### VS Code
Link: vscode:mcp/install?%7B%22name%22%3A%22grain%22%2C%22type%22%3A%22stdio%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22grain-tools%400.10.18%22%5D%2C%22env%22%3A%7B%22GRAIN_CONNECTIONS%22%3A%22%3CGRAIN_CONNECTIONS%3E%22%2C%22GRAIN_MCP_SAFE_MODE%22%3A%22%3CGRAIN_MCP_SAFE_MODE%3E%22%2C%22GRAIN_MAX_ROWS%22%3A%22%3CGRAIN_MAX_ROWS%3E%22%7D%7D
```sh
code --add-mcp '{"name":"grain","type":"stdio","command":"npx","args":["-y","grain-tools@0.10.18"],"env":{"GRAIN_CONNECTIONS":"<GRAIN_CONNECTIONS>","GRAIN_MCP_SAFE_MODE":"<GRAIN_MCP_SAFE_MODE>","GRAIN_MAX_ROWS":"<GRAIN_MAX_ROWS>"}}'
```
```json
{
  "servers": {
    "grain": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "grain-tools@0.10.18"
      ],
      "env": {
        "GRAIN_CONNECTIONS": "<GRAIN_CONNECTIONS>",
        "GRAIN_MCP_SAFE_MODE": "<GRAIN_MCP_SAFE_MODE>",
        "GRAIN_MAX_ROWS": "<GRAIN_MAX_ROWS>"
      }
    }
  }
}
```
1. Click the link, or run the command.
2. VS Code asks you to confirm the server before it starts.

### Cursor
Link: cursor://anysphere.cursor-deeplink/mcp/install?name=grain&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImdyYWluLXRvb2xzQDAuMTAuMTgiXSwiZW52Ijp7IkdSQUlOX0NPTk5FQ1RJT05TIjoiPEdSQUlOX0NPTk5FQ1RJT05TPiIsIkdSQUlOX01DUF9TQUZFX01PREUiOiI8R1JBSU5fTUNQX1NBRkVfTU9ERT4iLCJHUkFJTl9NQVhfUk9XUyI6IjxHUkFJTl9NQVhfUk9XUz4ifX0%3D
```json
{
  "mcpServers": {
    "grain": {
      "command": "npx",
      "args": [
        "-y",
        "grain-tools@0.10.18"
      ],
      "env": {
        "GRAIN_CONNECTIONS": "<GRAIN_CONNECTIONS>",
        "GRAIN_MCP_SAFE_MODE": "<GRAIN_MCP_SAFE_MODE>",
        "GRAIN_MAX_ROWS": "<GRAIN_MAX_ROWS>"
      }
    }
  }
}
```
1. Click the link to open Cursor.
2. Cursor shows the server and asks you to install it.

### Claude Code
```sh
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 grain-tools@0.10.18
```
1. Run the command in your terminal.
2. Restart or reload Claude Code if it's already open.

### Claude Desktop
```json
{
  "mcpServers": {
    "grain": {
      "command": "npx",
      "args": [
        "-y",
        "grain-tools@0.10.18"
      ],
      "env": {
        "GRAIN_CONNECTIONS": "<GRAIN_CONNECTIONS>",
        "GRAIN_MCP_SAFE_MODE": "<GRAIN_MCP_SAFE_MODE>",
        "GRAIN_MAX_ROWS": "<GRAIN_MAX_ROWS>"
      }
    }
  }
}
```
1. Open Settings, then Developer, then Edit Config.
2. Add the block below to claude_desktop_config.json.
3. Restart Claude Desktop.

### Claude (web) (not supported)
1. Claude on the web only connects to remote servers. Use Claude Desktop or Claude Code for this one.
