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

MySQL (read-only, switchable)

โดย shibbirwebรุ่น 1.1.6i★ –iรันบนเครื่อง
ชื่อใน registryio.github.shibbirweb/mcp-mysql-read-only

ติดตั้ง

ภาพรวม

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

Read-only MySQL access, with the database and server switchable mid-conversation.

สามเสาของ PopNx MCP

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

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

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

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

ติดตั้ง

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

ก่อนติดตั้ง

  • ผลตรวจเบื้องต้น: ผ่าน 1 จาก 1 ข้อ
  • รันในเครื่องคุณด้วยสิทธิ์ของผู้ใช้คุณ (ไฟล์ อินเทอร์เน็ต แอปต่าง ๆ)
  • ค่าที่คุณต้องใส่เอง: MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE, MYSQL_PROFILES, MYSQL_DEFAULT_PROFILE, MYSQL_CONNECT_TIMEOUT_MS, MYSQL_QUERY_TIMEOUT_MS

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

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

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

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

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

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

{
  "mcpServers": {
    "mysql-read-only": {
      "command": "npx",
      "args": [
        "-y",
        "@shibbirweb/mcp-mysql-read-only"
      ],
      "env": {
        "MYSQL_HOST": "ใส่ค่าของคุณ",
        "MYSQL_PORT": "ใส่ค่าของคุณ",
        "MYSQL_USER": "ใส่ค่าของคุณ",
        "MYSQL_PASSWORD": "ใส่ค่าของคุณ",
        "MYSQL_DATABASE": "ใส่ค่าของคุณ",
        "MYSQL_PROFILES": "ใส่ค่าของคุณ",
        "MYSQL_DEFAULT_PROFILE": "ใส่ค่าของคุณ",
        "MYSQL_CONNECT_TIMEOUT_MS": "ใส่ค่าของคุณ",
        "MYSQL_QUERY_TIMEOUT_MS": "ใส่ค่าของคุณ"
      }
    }
  }
}

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

claude mcp add mysql-read-only --env MYSQL_HOST='ใส่ค่าของคุณ' --env MYSQL_PORT='ใส่ค่าของคุณ' --env MYSQL_USER='ใส่ค่าของคุณ' --env MYSQL_PASSWORD='ใส่ค่าของคุณ' --env MYSQL_DATABASE='ใส่ค่าของคุณ' --env MYSQL_PROFILES='ใส่ค่าของคุณ' --env MYSQL_DEFAULT_PROFILE='ใส่ค่าของคุณ' --env MYSQL_CONNECT_TIMEOUT_MS='ใส่ค่าของคุณ' --env MYSQL_QUERY_TIMEOUT_MS='ใส่ค่าของคุณ' -- npx -y @shibbirweb/mcp-mysql-read-only

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

เปิดใน Cursor

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

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

{
  "mcpServers": {
    "mysql-read-only": {
      "command": "npx",
      "args": [
        "-y",
        "@shibbirweb/mcp-mysql-read-only"
      ],
      "env": {
        "MYSQL_HOST": "ใส่ค่าของคุณ",
        "MYSQL_PORT": "ใส่ค่าของคุณ",
        "MYSQL_USER": "ใส่ค่าของคุณ",
        "MYSQL_PASSWORD": "ใส่ค่าของคุณ",
        "MYSQL_DATABASE": "ใส่ค่าของคุณ",
        "MYSQL_PROFILES": "ใส่ค่าของคุณ",
        "MYSQL_DEFAULT_PROFILE": "ใส่ค่าของคุณ",
        "MYSQL_CONNECT_TIMEOUT_MS": "ใส่ค่าของคุณ",
        "MYSQL_QUERY_TIMEOUT_MS": "ใส่ค่าของคุณ"
      }
    }
  }
}

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

เปิดใน VS Code

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

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

{
  "servers": {
    "mysql-read-only": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@shibbirweb/mcp-mysql-read-only"
      ],
      "env": {
        "MYSQL_HOST": "ใส่ค่าของคุณ",
        "MYSQL_PORT": "ใส่ค่าของคุณ",
        "MYSQL_USER": "ใส่ค่าของคุณ",
        "MYSQL_PASSWORD": "ใส่ค่าของคุณ",
        "MYSQL_DATABASE": "ใส่ค่าของคุณ",
        "MYSQL_PROFILES": "ใส่ค่าของคุณ",
        "MYSQL_DEFAULT_PROFILE": "ใส่ค่าของคุณ",
        "MYSQL_CONNECT_TIMEOUT_MS": "ใส่ค่าของคุณ",
        "MYSQL_QUERY_TIMEOUT_MS": "ใส่ค่าของคุณ"
      }
    }
  }
}

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

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

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

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

  • MYSQL_HOST env
    Hostname of the MySQL server. Defaults to 127.0.0.1
  • MYSQL_PORT env
    Port of the MySQL server. Defaults to 3306
  • MYSQL_USER env
    MySQL user. Prefer an account holding only SELECT grants
  • MYSQL_PASSWORD ความลับ env
    Password for MYSQL_USER. Empty when the account has none
  • MYSQL_DATABASE env
    Database to open at startup. Can be changed later without restarting
  • MYSQL_PROFILES ความลับ env
    JSON object of named connections to switch between, keyed by profile name
  • MYSQL_DEFAULT_PROFILE env
    Which MYSQL_PROFILES entry to start on
  • MYSQL_CONNECT_TIMEOUT_MS env
    Connection timeout in milliseconds. Defaults to 10000
  • MYSQL_QUERY_TIMEOUT_MS env
    Server-side query timeout in milliseconds. Defaults to 30000

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

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

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

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

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

  • ✓ ผ่าน

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

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

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

    ยังมีคนดูแล

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

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

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

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

  • – ไม่เกี่ยว

    endpoint ตอบ

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

  • – ไม่เกี่ยว

    ล็อกอินแบบ OAuth

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

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

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

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

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

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

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

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

MySQL (read-only, switchable) ปลอดภัยไหม?

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

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

ต้องใส่ค่าเหล่านี้: MYSQL_PASSWORD, MYSQL_PROFILES

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

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

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

repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (1.1.6) เข้า registry 44 วันที่ผ่านมา

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

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

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

ในหมวดเดียวกันมี 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อัปเดต 3 วันที่ผ่านมา
ติดตั้ง

Elasticsearch MCP Server

โดย cr7258

MCP server for interacting with Elasticsearch

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

README จากผู้ทำ

เปิดอ่าน README

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

mcp-mysql-read-only

An MCP server that gives an AI assistant read-only access to MySQL, and lets it change database, server and credentials mid-conversation without restarting the client.

Most MySQL MCP servers read their connection from environment variables once at startup. Pointing one at a different database means editing a config file and restarting the assistant, which loses your conversation. This server keeps the connection as runtime state, so switching is just another tool call.

Runs from npm with npx, or entirely in Docker with nothing installed on your machine.

flowchart LR

A["AI assistant Claude Desktop / Claude Code"] B["mcp-mysql-read-only one process, whole session"] C[("app_dev")] D[("staging")] E[("analytics")] F[("any server reached with connect")]

A <-->|"MCP over stdio"| B B -.->|"pooled per target"| C B -.->|"pooled per target"| D B -.->|"pooled per target"| E B -.->|"opened at runtime"| F

The server lives for the whole session, so the active connection is just state inside it. Switching selects a different pool rather than reconnecting, and switching back reuses a warm one.


Quick start

Two ways to run it. npm is the shorter setup; Docker keeps the server inside a container.

npm
MYSQL_HOST=127.0.0.1 \

MYSQL_USER=readonly \ MYSQL_PASSWORD=secret \ MYSQL_DATABASE=my_database \ npx -y @shibbirweb/mcp-mysql-read-only

Requires Node 22 or newer. There is no container in the way, so 127.0.0.1 means what you expect.

Docker
docker run -i --rm \

--add-host host.docker.internal:host-gateway \ -e MYSQL_HOST=host.docker.internal \ -e MYSQL_USER=readonly \ -e MYSQL_PASSWORD=secret \ -e MYSQL_DATABASE=my_database \ shibbirweb/mcp-mysql-read-only

Use host.docker.internal to reach a MySQL running on the same machine as Docker. Inside the container, localhost means the container itself.

The container is the more isolated of the two: the server runs with only what the image and the environment give it. Over npm it runs directly on your machine with your user's access. Both enforce the same read-only guarantee.

Claude Desktop

Add to claude_desktop_config.json:

{

"mcpServers": { "mysql": { "command": "npx", "args": ["-y", "@shibbirweb/mcp-mysql-read-only"], "env": { "MYSQL_HOST": "127.0.0.1", "MYSQL_USER": "readonly", "MYSQL_PASSWORD": "secret", "MYSQL_DATABASE": "my_database" } } } }

Or the same server in Docker:

{

"mcpServers": { "mysql": { "command": "docker", "args": [ "run", "-i", "--rm", "--add-host", "host.docker.internal:host-gateway", "-e", "MYSQL_HOST=host.docker.internal", "-e", "MYSQL_USER=readonly", "-e", "MYSQL_PASSWORD=secret", "-e", "MYSQL_DATABASE=my_database", "shibbirweb/mcp-mysql-read-only" ] } } }

Claude Code

Same shape, in .mcp.json at your project root:

{

"mcpServers": { "mysql": { "command": "npx", "args": ["-y", "@shibbirweb/mcp-mysql-read-only"], "env": { "MYSQL_HOST": "127.0.0.1", "MYSQL_USER": "readonly", "MYSQL_PASSWORD": "secret", "MYSQL_DATABASE": "my_database" } } } }

Either form from the Claude Desktop section works here too.

Restart the client once. After that you never need to restart it to change database.

Credentials in these files sit on disk in plain text. Prefer a MySQL account with only SELECT grants, and keep the file out of version control. See Security.


Switching connections

Just ask. These map onto the connection tools:

"switch to the staging database"

"what tables are in analytics?"

"connect to MySQL on 10.0.0.5 as reporting_user"

WantRestart?
Another database on the same serverNo
Another named profileNo
A different server or credentialsNo
A new permanent profile in MYSQL_PROFILESYes, once
sequenceDiagram

autonumber actor You participant A as Assistant participant S as MCP server participant M as MySQL

You->>A: "how many users in staging?" A->>S: use_connection(staging) S->>M: open + SELECT 1 M-->>S: ok Note over S: verified, so the switch is committed S-->>A: Switched to staging A->>S: run_query(SELECT COUNT(*) ...) S->>M: SELECT COUNT(*) ... M-->>S: 4821 A-->>You: 4821 users in staging

You->>A: "and in production?" Note over A,S: same session, no restart A->>S: use_connection(production)

A switch that fails verification is never committed, so the previous connection stays active and the session keeps working:

sequenceDiagram

participant S as MCP server participant M as MySQL

S->>M: open "no_such_db" + SELECT 1 M-->>S: Unknown database Note over S: active connection left untouched S-->>S: Error: Unknown database 'no_such_db'

Named profiles

Define several connections up front with MYSQL_PROFILES, a JSON object:

{

"local": { "host": "host.docker.internal", "user": "root", "password": "", "database": "app_dev" }, "staging": { "host": "db.staging.internal", "user": "readonly", "password": "secret", "database": "app" }, "reports": { "host": "db.staging.internal", "user": "readonly", "password": "secret", "database": "analytics" } }

Passed as a single environment variable:

docker run -i --rm \

-e MYSQL_PROFILES='{"local":{"host":"host.docker.internal","user":"root","password":"","database":"app_dev"}}' \ -e MYSQL_DEFAULT_PROFILE=local \ shibbirweb/mcp-mysql-read-only

host defaults to host.docker.internal, port to 3306, password to empty. user and database are required; a profile missing either is skipped with a warning rather than taking the server down.

Reaching somewhere not in the profiles

The connect tool takes a host, user, password and database at runtime and keeps it for the rest of the session under an alias. Nothing is written to disk, and no restart is involved, so you never have to edit MYSQL_PROFILES just to look at one database once.


Tools

Connection
ToolPurpose
current_connectionWhich server and database is active
list_connectionsAvailable profiles, * marks the active one
list_databasesDatabases on the connected server
use_databaseSwitch schema on the current server
use_connectionSwitch to a named profile, optional database override
connectOpen any server with explicit credentials, optional alias
Reading
ToolPurpose
list_tablesTables in the active database
describe_tableColumns and types for one table
get_table_indexesIndexes for one table
get_foreign_keysForeign key relationships for one table
get_table_sampleUp to 50 sample rows
run_queryOne read-only statement

Every reading tool also accepts an optional database, applied to that call only, leaving the active connection alone. Useful for comparing two databases without switching back and forth.

use_database, use_connection and connect each open the connection and run SELECT 1 before committing the switch, so a bad database name or unreachable host fails immediately. A failed switch leaves the previous connection active.


Configuration

VariableDefaultPurpose
MYSQL_PROFILESnoneJSON object of named profiles
MYSQL_DEFAULT_PROFILEnoneWhich profile starts active
MYSQL_HOSThost.docker.internalSingle-connection fallback
MYSQL_PORT3306"
MYSQL_USERnone"
MYSQL_PASSWORDempty"
MYSQL_DATABASEnone"
MYSQL_QUERY_TIMEOUT_MS30000Statement timeout
MYSQL_CONNECT_TIMEOUT_MS10000Connection timeout

MYSQL_USER plus MYSQL_DATABASE register a profile named default. None of these are required: with no configuration at all the server still starts, and the tools tell you to call connect.

Starting profile: MYSQL_DEFAULT_PROFILE if it names a real profile, else default, else the first one defined.


Security

Two independent layers keep this read-only, so a hole in one is not automatically a write.

flowchart TD

Q["run_query"] --> V{"SQL validator"} V -->|"DELETE, DROP, stacked statements, write behind a CTE, INTO OUTFILE"| R1["rejected, no connection used"] V -->|"reads only"| D{"mysql2 driver"} D -->|"multipleStatements: false"| R2["a second statement cannot even be sent"] D --> M{"MySQL session"} M -->|"SET SESSION TRANSACTION READ ONLY"| R3["writes rejected by the server with error 1792"] M -->|"read"| OK["rows returned"]

style R1 fill:#fde,stroke:#b55 style R2 fill:#fde,stroke:#b55 style R3 fill:#fde,stroke:#b55 style OK fill:#dfd,stroke:#5b5

A SQL validator. Only SELECT, WITH, SHOW, DESCRIBE, DESC and EXPLAIN may lead a statement. Before any keyword check, string literals, backtick identifiers and --, # and /* */ comments are blanked out, so a keyword or semicolon hidden inside a literal is never mistaken for SQL. Statement stacking is rejected. WITH and EXPLAIN ANALYZE have their bodies scanned for write keywords, because both can carry a write behind a harmless first word. INTO OUTFILE, INTO DUMPFILE, LOAD DATA, SLEEP() and BENCHMARK() are blocked. Table and database names passed as tool arguments must match ^[A-Za-z0-9_$]+$, so they cannot break out of the identifier they are interpolated into.

The MySQL session. Every pooled connection runs SET SESSION TRANSACTION READ ONLY and SET SESSION MAX_EXECUTION_TIME. With autocommit on, each statement is its own read-only transaction, so the server rejects a write with error 1792 even if the validator were somehow bypassed. The driver runs with multipleStatements: false, so a second statement cannot be smuggled in at all.

What this is not

This is a guard, not a permission system. It stops an assistant from writing through *this* server. It does not stop anyone holding the same credentials from writing through any other client.

Point it at a read-only MySQL user. This is the real protection:

CREATE USER 'readonly'@'%' IDENTIFIED BY 'a strong password';

GRANT SELECT ON your_database.* TO 'readonly'@'%';

With that, a bug in this server st

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

ถาม PopNx