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

QueryPilot

โดย nickklos10รุ่น 0.1.1i★ –iรันบนเครื่อง
ชื่อใน registryio.github.nickklos10/querypilot

ติดตั้ง

ภาพรวม

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

Safe SQL gateway for AI agents: SELECT-only validation, access policies, masking, audit trail, evals

สามเสาของ PopNx MCP

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

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

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

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

ติดตั้ง

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

ก่อนติดตั้ง

  • ผลตรวจเบื้องต้น: ผ่าน 1 จาก 1 ข้อ
  • รันในเครื่องคุณด้วยสิทธิ์ของผู้ใช้คุณ (ไฟล์ อินเทอร์เน็ต แอปต่าง ๆ)
  • ค่าที่คุณต้องใส่เอง: QUERYPILOT_DATABASE_URL, QUERYPILOT_DIALECT, QUERYPILOT_MAX_ROWS, QUERYPILOT_TIMEOUT_SECONDS, QUERYPILOT_ACCESS_POLICY_JSON, QUERYPILOT_MCP_TRANSPORT

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

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

  • PyPIติดตั้ง uv ของ Python (มีคำสั่ง uvx) ในเครื่อง

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

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

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

{
  "mcpServers": {
    "querypilot": {
      "command": "uvx",
      "args": [
        "querypilot",
        "mcp"
      ],
      "env": {
        "QUERYPILOT_DATABASE_URL": "ใส่ค่าของคุณ",
        "QUERYPILOT_DIALECT": "ใส่ค่าของคุณ",
        "QUERYPILOT_MAX_ROWS": "ใส่ค่าของคุณ",
        "QUERYPILOT_TIMEOUT_SECONDS": "ใส่ค่าของคุณ",
        "QUERYPILOT_ACCESS_POLICY_JSON": "ใส่ค่าของคุณ",
        "QUERYPILOT_MCP_TRANSPORT": "ใส่ค่าของคุณ"
      }
    }
  }
}

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

claude mcp add querypilot --env QUERYPILOT_DATABASE_URL='ใส่ค่าของคุณ' --env QUERYPILOT_DIALECT='ใส่ค่าของคุณ' --env QUERYPILOT_MAX_ROWS='ใส่ค่าของคุณ' --env QUERYPILOT_TIMEOUT_SECONDS='ใส่ค่าของคุณ' --env QUERYPILOT_ACCESS_POLICY_JSON='ใส่ค่าของคุณ' --env QUERYPILOT_MCP_TRANSPORT='ใส่ค่าของคุณ' -- uvx querypilot mcp

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

เปิดใน Cursor

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

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

{
  "mcpServers": {
    "querypilot": {
      "command": "uvx",
      "args": [
        "querypilot",
        "mcp"
      ],
      "env": {
        "QUERYPILOT_DATABASE_URL": "ใส่ค่าของคุณ",
        "QUERYPILOT_DIALECT": "ใส่ค่าของคุณ",
        "QUERYPILOT_MAX_ROWS": "ใส่ค่าของคุณ",
        "QUERYPILOT_TIMEOUT_SECONDS": "ใส่ค่าของคุณ",
        "QUERYPILOT_ACCESS_POLICY_JSON": "ใส่ค่าของคุณ",
        "QUERYPILOT_MCP_TRANSPORT": "ใส่ค่าของคุณ"
      }
    }
  }
}

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

เปิดใน VS Code

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

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

{
  "servers": {
    "querypilot": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "querypilot",
        "mcp"
      ],
      "env": {
        "QUERYPILOT_DATABASE_URL": "ใส่ค่าของคุณ",
        "QUERYPILOT_DIALECT": "ใส่ค่าของคุณ",
        "QUERYPILOT_MAX_ROWS": "ใส่ค่าของคุณ",
        "QUERYPILOT_TIMEOUT_SECONDS": "ใส่ค่าของคุณ",
        "QUERYPILOT_ACCESS_POLICY_JSON": "ใส่ค่าของคุณ",
        "QUERYPILOT_MCP_TRANSPORT": "ใส่ค่าของคุณ"
      }
    }
  }
}

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

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

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

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

  • QUERYPILOT_DATABASE_URL ความลับ จำเป็น env
    SQLAlchemy-style database connection URL, e.g. sqlite:///demo.db or postgresql://user:pass@host:5432/db. Equivalent to --database-url.
  • QUERYPILOT_DIALECT env
    SQL dialect for the connector. Equivalent to --dialect.
  • QUERYPILOT_MAX_ROWS env
    Maximum rows returned per query. Equivalent to --max-rows.
  • QUERYPILOT_TIMEOUT_SECONDS env
    Query execution timeout in seconds. Equivalent to --timeout-seconds.
  • QUERYPILOT_ACCESS_POLICY_JSON env
    JSON-encoded AccessPolicy (blocked_columns, allowed_columns, row_filters, masking_rules) enforced before execution. Equivalent to --access-policy-json.
  • QUERYPILOT_MCP_TRANSPORT env
    MCP transport used by `querypilot mcp`. Equivalent to --transport. Most MCP clients should leave this at stdio; streamable-http is for clients that speak Streamable HTTP directly.

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

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

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

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

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

  • ✓ ผ่าน

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

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

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

    ยังมีคนดูแล

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

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

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

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

  • – ไม่เกี่ยว

    endpoint ตอบ

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

  • – ไม่เกี่ยว

    ล็อกอินแบบ OAuth

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

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

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

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

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

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

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

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

QueryPilot ปลอดภัยไหม?

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

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

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

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

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

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

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

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

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

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

ในหมวดเดียวกันมี 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 รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ

QueryPilot

Safe, measurable SQL for AI agents.

QueryPilot sits between an LLM agent and your database. It gives the agent read-only, policy-checked SQL tools for any SQLAlchemy database. It grounds the model in your real schema, feeds errors back so the model can fix its SQL, and ships an eval harness that proves the SQL is correct and stays correct.

Quickstart

pip install querypilot

querypilot demo

querypilot demo writes a small SaaS database (querypilot-demo.db), runs a validated query against it and shows a blocked DELETE. Then try:

querypilot schema --db sqlite:///querypilot-demo.db              # list tables

querypilot schema --db sqlite:///querypilot-demo.db invoices # columns, keys, sample values querypilot sql --db sqlite:///querypilot-demo.db "SELECT customer_nme FROM customers"

Error: SQL validation failed: Unknown column: customer_nme

hint: Column 'customer_nme' does not exist; did you mean customers.customer_name, ...?

querypilot ask --db sqlite:///querypilot-demo.db "Which customers have the highest ARR?"

ask uses OpenAI or Anthropic when OPENAI_API_KEY or ANTHROPIC_API_KEY is set (--generator openai-compatible covers Ollama, vLLM and LM Studio). Without a key it falls back to an offline demo generator.

For your own database, querypilot init --db postgresql://analyst@db.internal/prod writes a querypilot.yaml that holds the connection, business hints, column descriptions and access policy. Every command, the MCP server and QueryPilot.from_config() read it, so you can drop --db from then on.

In Python:

from querypilot import QueryPilot

qp = QueryPilot.connect("postgresql://analyst@db.internal/prod") # dialect inferred from the URL

result = qp.execute_sql("SELECT plan, COUNT(*) FROM subscriptions GROUP BY plan") print(result.sql) # rewritten with a LIMIT, validated against the live schema print(result.rows)

Connect any database

QueryPilot.connect(url) infers the SQL dialect from the URL and introspects tables, views, primary and foreign keys, and comments. It also accepts a SQLAlchemy Engine.

DatabaseURLInstall
SQLitesqlite:///app.dbincluded
PostgreSQLpostgresql://user:pass@host/dbincluded
DuckDBduckdb:///analytics.duckdbpip install "querypilot[duckdb]"
MySQL / MariaDBmysql+pymysql://user:pass@host/dbpip install "querypilot[mysql]"
SQL Servermssql+pyodbc://…pip install "querypilot[mssql]"
Snowflakesnowflake://user@account/db/schemapip install "querypilot[snowflake]"
BigQuerybigquery://project/datasetpip install "querypilot[bigquery]"
Redshiftredshift+psycopg2://…pip install "querypilot[redshift]"
Trino / Oracle / Databrickstrino://…, oracle+oracledb://…, databricks://…querypilot[trino], [oracle], [databricks]

Every query is validated with sqlglot for the target dialect. Validation means one statement, SELECT only, and known tables and columns. It also blocks dangerous functions for each engine, such as pg_read_file, DuckDB's read_csv, MySQL's LOAD_FILE and SQL Server's xp_cmdshell. Execution then adds the engine's own guard: a read-only transaction on Postgres, MySQL and Oracle, a read-only connection on DuckDB, and a statement timeout where the engine supports one. Every query runs in a transaction that is always rolled back. For warehouses that have no read-only session mode, connect with a read-only role.

Give your agent the tools

Every integration exposes the same small toolset. Results are compact JSON, and errors come back as {"ok": false, "error": ..., "hints": [...]} rather than as exceptions, so the agent can correct itself.

ToolWhat it does
list_tablesTables and views the policy allows, with comments
describe_tableColumns, types, keys, comments and sample values for the named tables
search_schemaFinds tables and columns relevant to a question
validate_sqlChecks SQL and returns the rewritten form, errors and "did you mean" hints
run_sqlValidates and runs SQL, returning rows with a truncated flag at max_rows
ask_databaseNatural language → validated SQL → rows (only when an LLM generator is configured)

MCP (Claude Code, Claude Desktop, Cursor, VS Code, Windsurf):

querypilot mcp-config claude-code --db postgresql://analyst@db/prod

claude mcp add querypilot --env QUERYPILOT_DATABASE_URL=... -- /path/to/uvx --from 'querypilot[mcp]' querypilot mcp

querypilot mcp-config cursor --db sqlite:///app.db # prints the mcpServers JSON block

The generated config uses the absolute path to uvx, which avoids the common spawn uvx ENOENT failure. Pass --runner python to launch the current environment instead. Every tool carries the MCP readOnlyHint annotation. querypilot mcp --transport streamable-http --port 8000 serves the same tools over HTTP.

OpenAI / Anthropic tool calling:

tools = qp.as_openai_tools()            # Chat Completions; qp.toolkit().openai_responses_tools() for Responses

tools = qp.as_anthropic_tools() result = qp.handle_tool_call(tool_call.name, tool_call.arguments) # dict or JSON string in, dict out

Agent frameworks:

from querypilot.integrations import (

as_langchain_tools, # LangChain / LangGraph StructuredTools as_llamaindex_tools, # LlamaIndex FunctionTools as_openai_agents_tools, # OpenAI Agents SDK FunctionTools as_claude_agent_mcp_server, # Claude Agent SDK in-process MCP server claude_agent_allowed_tools, as_functions, # plain typed functions: Pydantic AI, smolagents, CrewAI, ADK )

tools = as_langchain_tools(qp, naming="langchain") # sql_db_list_tables, sql_db_schema, sql_db_query, ...

naming="langchain" reuses the tool names from the community SQLDatabaseToolkit (no longer maintained), so existing prompts keep working. Install the matching extra: querypilot[langchain], [llamaindex], [openai-agents], [claude-agent] or [mcp]. See examples/07_frameworks.py.

Protect any Postgres client: querypilot proxy (prototype)

The proxy needs no SDK. It is a Postgres wire-protocol server that applies the same validator and access policy to every statement, whatever the client. That covers psql, psycopg, SQLAlchemy and LangChain, an existing MCP database server, Cursor or Claude Code, and BI tools. Point the client's connection string at the proxy instead of the database:

pip install "querypilot[proxy]"

querypilot proxy --upstream postgresql://readonly@db/prod --listen 127.0.0.1:6543 --policy querypilot.yaml

psql "postgresql://agent@127.0.0.1:6543/prod" -c "SELECT email FROM customers" npx -y @modelcontextprotocol/server-postgres postgresql://agent@127.0.0.1:6543/prod # unchanged MCP server

Every statement then gets the following:

  • Read-only enforcement. Writes, DDL, COPY and SET of anything outside a small allowlist are rejected. Allowed statements run in a READ ONLY transaction on a session that defaults to read-only, so COMMIT; DROP TABLE … is rejected.
  • Row filters and the row cap. The rewritten SQL is what reaches the database, so the policy's row_filters hold under joins, subqueries and CTEs, and LIMIT is capped at max_rows.
  • Masking. masking_rules apply by output position, so upper(email) AS contact is masked too.
  • Errors an agent can repair. A rejection is a normal Postgres error with a SQLSTATE, the validator's message, and a HINT, for example Column 'nope' does not exist. Columns of orders: id, customer_id, ….
  • Audit. One JSONL record per statement goes to --audit-log, with the client's SQL, the SQL that ran, the row count, and the client user and application.

Driver handshakes, SET/SHOW of formatting settings, and catalog queries for psql \d and ORM reflection pass through an allowlist. Catalog queries that could read data, such as pg_stats or query_to_xml(...), are rejected. The policy file is a normal querypilot.yaml, and its database_url is used when you omit --upstream. Off loopback, set QUERYPILOT_PROXY_PASSWORD. Protocol coverage, known gaps (no TLS termination yet, no server-side cursors), and the reasons it fails closed are in docs/proxy.md.

Watch the SQL your agent already runs: querypilot trace and hooks

Some query tools can't sit behind QueryPilot, for example Palantir Foundry's MCP SQL tool. For those, QueryPilot reads what the agent did instead. trace import pairs every query tool call in Claude Code transcripts with its result. hooks install logs new calls live. trace doctor reports the failure rate by class, retry chains, latency and stalls, and says for each problem whether it is best fixed in the tool, the prompt, or the data:

querypilot trace doctor                        # reads ~/.claude/projects

querypilot trace doctor --output report.md # redacted, shareable querypilot hooks install --guard --max-rows 200

With --guard, a PreToolUse hook validates each query against schemas cached from the agent's own schema calls. It denies unknown columns with a "did you mean" reply before the query reaches the warehouse, blocks date arithmetic on DATE columns stored as epoch milliseconds, and enforces a row cap. Foundry's tool is mapped by default; map any other with --tool NAME=SQL_FIELD[:DIALECT]. Recovered retry chains export to eval replay as a regression suite. See docs/trace.md and the first Foundry report.

Better SQL from the model

When QueryPilot writes the SQL itself (ask, ask_database, evals), it uses the techniques with the largest measured gains in the text-to-SQL literature. The sources and numbers are in docs/research/developer-needs.md.

  • Grounded schema. The prompt shows each table as compact DDL with primary keys, foreign-key join paths, comments and real values for category-like text columns: every value when there are 10 or fewer, otherwise the 3 most common. Sample values are never drawn from blocked, masked or row-filtered columns.
  • Your business rules. Pass hints= and descriptions= to connect(), or set them in querypilot.yaml, for definitions such as "revenue means paid invoices only".
  • Pruning only when needed. Below schema_token_budget (default 6000 tokens) the full schema is sent. Above it, QueryPilot sends the relevant tables plus the foreign-key bridge tables that join them.
  • A repair loop that converges. Validation errors get "did you mean" hints. Database errors are cleaned before they go back to the model. An empty result triggers one gentle review. Up to 3 attempts by default.
from querypilot import AnthropicSQLGenerator, QueryPilot

qp = QueryPilot.connect( "duckdb:///analytics.duckdb", generator=AnthropicSQLGenerator(), hints=["Revenue means SUM(amount_cents) / 100 over invoices with status = 'paid'"], descriptions={"accounts.segment": "smb, midmarket or enterprise"}, ) answer = qp.ask("Revenue by se

ตัดมาแค่ช่วงต้น อ่านต่อใน repo

ถาม PopNx