ต้นแบบ · รุ่นทดลอง: มีทุก server ในทะเบียนทางการ อัปเดตทุก 30 นาที รีวิวและบัญชีผู้ใช้จะมาในขั้นถัดไป
PopNx MCPที่รวม MCP สำหรับคนใช้ AI · อธิบายเป็นภาษาคน

Grain SQL

โดย pattrnlabsรุ่น 0.10.49i★ –iรันบนเครื่อง
ชื่อใน registryio.github.pattrnlabs/grain

ติดตั้ง

ภาพรวม

คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)

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

สามเสาของ PopNx MCP

สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน

ใช้ทำอะไรได้

ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry

  • การเชื่อมต่อ: รันบนเครื่อง
  • ช่องทาง (transport): stdio
  • หมวด: ฐานข้อมูลและชุดข้อมูล
  • ต้องใส่ค่าเหล่านี้: GRAIN_CONNECTIONS

ติดตั้ง

เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง

ก่อนติดตั้ง

ค่าที่ติดป้ายความลับคือกุญแจของบัญชีคุณ อย่าส่งให้ใคร และอย่าวางในแชต

ต้องเตรียมก่อน

  • npmติดตั้ง Node.js (มีคำสั่ง npx) ในเครื่อง

คุณใช้แอปไหน

เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”

เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json

{
  "mcpServers": {
    "grain": {
      "command": "npx",
      "args": [
        "-y",
        "grain-tools"
      ],
      "env": {
        "GRAIN_CONNECTIONS": "ใส่ค่าของคุณ",
        "GRAIN_MCP_SAFE_MODE": "ใส่ค่าของคุณ",
        "GRAIN_MAX_ROWS": "ใส่ค่าของคุณ"
      }
    }
  }
}

พิมพ์คำสั่งนี้ใน Terminal

claude mcp add grain --env GRAIN_CONNECTIONS='ใส่ค่าของคุณ' --env GRAIN_MCP_SAFE_MODE='ใส่ค่าของคุณ' --env GRAIN_MAX_ROWS='ใส่ค่าของคุณ' -- npx -y grain-tools

เติมค่าที่เว้นว่างไว้ก่อนรัน

เปิดใน Cursor

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json

{
  "mcpServers": {
    "grain": {
      "command": "npx",
      "args": [
        "-y",
        "grain-tools"
      ],
      "env": {
        "GRAIN_CONNECTIONS": "ใส่ค่าของคุณ",
        "GRAIN_MCP_SAFE_MODE": "ใส่ค่าของคุณ",
        "GRAIN_MAX_ROWS": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

เปิดใน VS Code

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .vscode/mcp.json ของโปรเจกต์

{
  "servers": {
    "grain": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "grain-tools"
      ],
      "env": {
        "GRAIN_CONNECTIONS": "ใส่ค่าของคุณ",
        "GRAIN_MCP_SAFE_MODE": "ใส่ค่าของคุณ",
        "GRAIN_MAX_ROWS": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น

ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี

ค่าที่ต้องใส่เอง

  • GRAIN_CONNECTIONS ความลับ env
    JSON array of Grain connection profiles for headless use.
  • GRAIN_MCP_SAFE_MODE env
    Set to false to allow mutating SQL. Defaults to true.
  • GRAIN_MAX_ROWS env
    Maximum rows returned by query tools. Defaults to 10000.

ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README

ทำอะไรได้บ้าง

รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง

ผลตรวจเบื้องต้นi

เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 6 พ.ย. 2569

  • ✓ ผ่าน

    ตัวตนผู้ทำตรงกับ repo

    ชื่อใน registry ยืนยันด้วยบัญชี GitHub pattrnlabs ซึ่งเป็นเจ้าของ repo

  • … ยังไม่ตรวจ

    ยังมีคนดูแล

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • … ยังไม่ตรวจ

    มีสัญญาอนุญาต (license)

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • – ไม่เกี่ยว

    endpoint ตอบ

    ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต

  • – ไม่เกี่ยว

    ล็อกอินแบบ OAuth

    ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน

  • … ยังไม่ตรวจ

    คำอธิบายเครื่องมือไม่มีคำสั่งแอบแฝง

    รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต

เทียบกับตัวอื่นในหมวด ฐานข้อมูลและชุดข้อมูลi

  • ดาวมากกว่า 0% ของอีก 953 ตัวในหมวดนี้
  • ส่งรุ่นใหม่เข้า registry ล่าสุดกว่า 96% ของอีก 953 ตัวในหมวดนี้
  • ผลตรวจเบื้องต้นดีกว่าหรือเท่ากับ 100% ของอีก 953 ตัวในหมวดนี้

เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo

คำถามที่พบบ่อย

Grain SQL ปลอดภัยไหม?

จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น

ต้องใช้กุญแจหรือรหัสอะไรบ้าง?

ต้องใส่ค่าเหล่านี้: GRAIN_CONNECTIONS

ตัวนี้รันบนเครื่องหรือบนคลาวด์?

รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)

ยังมีคนดูแลอยู่ไหม?

repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.10.49) เข้า registry เมื่อวานซืน

ใช้กับโปรแกรมไหนได้บ้าง?

โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Node.js ในเครื่องด้วย

มีตัวไหนใช้แทนได้บ้าง?

ในหมวดเดียวกันมี Supabase, MongoDB MCP Server, Elasticsearch MCP Server

ตัวที่ใช้แทนได้

server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว

อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi

Supabase

โดย supabase

server ทางการของ Supabase ให้ AI สร้างตาราง ถามข้อมูล และดูการตั้งค่าโปรเจกต์ในฐานข้อมูล Supabase ของคุณ

บนเครื่องหรือคลาวด์★ 2,993Apache-2.0อัปเดต เมื่อวาน
ติดตั้ง

MongoDB MCP Server

โดย mongodb-js

MongoDB Model Context Protocol Server

รันบนเครื่อง★ 1,157Apache-2.0อัปเดต เมื่อวานซืน
ติดตั้ง

Elasticsearch MCP Server

โดย cr7258

MCP server for interacting with Elasticsearch

รันบนเครื่อง★ 315Apache-2.0อัปเดต 14 เดือนที่ผ่านมา
ติดตั้ง

README จากผู้ทำ

เปิดอ่าน README

ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ

Grain

A fast SQL workspace for VS Code, and for the AI agents you work with.

Docs · Changelog · Report a bug · Ask a question

Run SQL from any .sql file with Ctrl+Enter and get the results in a sortable grid inside VS Code. Passwords stay in your OS keychain, and Grain has no hosted service.

Quick start

  1. Install Grain from the VS Code Marketplace or Open VSX (for Cursor, Windsurf, and VSCodium).
  2. Open a folder in VS Code. Grain adds its demo files there.
  3. Open the Grain panel and click Try the Demo.
  4. Put your cursor in any query in the file that opens and press Ctrl+Enter (Cmd+Enter on macOS).

The demo reads two CSV files through Grain's built-in DuckDB connection, so there's nothing to set up. To query your own database, run Grain: Manage Connections, add a profile, and test it before you save.

If Grain is useful to you, a star on this repo helps other developers find it.

Use Grain from an AI agent

Grain can serve your database connections to Claude Code, Cursor, and GitHub Copilot over MCP. Agents get read-only access by default, and every query an agent runs shows up in your Grain results panel, so you can see exactly what it did.

MCP is off until you turn on grain.mcpEnabled in settings. Setup steps for each client are in the MCP docs, and example prompts are in examples/agents/.

Features

FeatureWhat it does
Run from the editorCtrl+Enter runs the file; Run Query Under Cursor runs one statement; Run Query in New Tab keeps the previous result
Non-blocking queriesQueries run in a background process, so a slow query doesn't freeze VS Code
Connection managerCreate, test, and switch database profiles without editing JSON
Result gridSort, filter, and resize columns, see each column's SQL type, copy a selection as TSV
Full exportThe grid shows the first 500 rows; export re-runs the query and writes every row to CSV, TSV, or JSON
Agent access over MCPClaude Code, Cursor, and Copilot can query your connections; their results land in your panel
Remote setupsWorks over WSL, dev containers, GitHub Codespaces, and Remote - SSH

Supported databases

Relational databases

PostgreSQL

MySQL

SQL Server

SQLite

Data warehouses

Snowflake

BigQuery

Query engines & lakehouses

Trino / Presto

DuckDB

Search

Elasticsearch

Through Trino or Presto you can query your cluster's Iceberg, Delta Lake, and Hive tables. DuckDB queries local CSV and Parquet files directly.

PostgreSQL and Trino / Presto are bundled with the extension. The others load their driver on first use, and if a driver is missing, Grain tells you what to install.

Need another database? Request a connector. Requests with the most 👍 get built first.

Examples

Runnable queries for Postgres, MySQL, Elasticsearch, and DuckDB, plus agent prompts. Open any .sql file with Grain installed and press Ctrl+Enter.

Privacy

  • Your SQL, results, and passwords stay on your machine. Passwords are stored in VS Code Secret Storage, backed by your OS keychain, and never in a settings file.
  • Agents are read-only by default. With grain.mcpSafeMode on (the default), agents can only run SELECT, SHOW, DESCRIBE, EXPLAIN, WITH, and metadata queries. Agents can't read stored passwords or change saved connections.
  • Telemetry is anonymous. Grain sends usage data that never includes SQL, results, credentials, hostnames, or schema names. Turn it off with grain.telemetry.enabled.

FAQ

Is Grain open source?\ No. Grain is closed-source. This repo holds the issue tracker, docs, and examples.

Which databases does it support?\ The nine listed above. To ask for another one, request a connector.

Do my queries or passwords leave my machine?\ No. There's no Grain server. Queries go straight from VS Code to your database, and passwords stay in your OS keychain. See Privacy for what the anonymous telemetry does and doesn't include.

How do I connect Claude Code or Cursor?\ Turn on grain.mcpEnabled, then follow the steps for your client in the MCP docs.

Why does my database show a driver error?\ Some connectors load their driver on first use. The error message names what to install. If it's still failing after that, file a bug report with the Output panel logs (View → Output → Grain).

Getting help

We don't have a fixed roadmap yet. What we build next depends a lot on what people ask for here, especially connector requests. See CONTRIBUTING.md for how to file a good issue.

Star History

License

Grain is closed-source. See LICENSE.

ถาม PopNx