Skip to content
VS Code

MySQL (read-only, switchable) for VS Code

io.github.shibbirweb/mcp-mysql-read-only

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

client:VS Code transport:stdio runtime:npm

Install MySQL (read-only, switchable) in VS Code

.vscode/mcp.json

{
  "inputs": [
    {
      "type": "promptString",
      "id": "mysql-host",
      "description": "MYSQL_HOST",
      "password": true
    },
    {
      "type": "promptString",
      "id": "mysql-port",
      "description": "MYSQL_PORT",
      "password": true
    },
    {
      "type": "promptString",
      "id": "mysql-user",
      "description": "MYSQL_USER",
      "password": true
    },
    {
      "type": "promptString",
      "id": "mysql-password",
      "description": "MYSQL_PASSWORD",
      "password": true
    },
    {
      "type": "promptString",
      "id": "mysql-database",
      "description": "MYSQL_DATABASE",
      "password": true
    },
    {
      "type": "promptString",
      "id": "mysql-profiles",
      "description": "MYSQL_PROFILES",
      "password": true
    },
    {
      "type": "promptString",
      "id": "mysql-default-profile",
      "description": "MYSQL_DEFAULT_PROFILE",
      "password": true
    },
    {
      "type": "promptString",
      "id": "mysql-connect-timeout-ms",
      "description": "MYSQL_CONNECT_TIMEOUT_MS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "mysql-query-timeout-ms",
      "description": "MYSQL_QUERY_TIMEOUT_MS",
      "password": true
    }
  ],
  "servers": {
    "mcp-mysql-read-only": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@shibbirweb/mcp-mysql-read-only"
      ],
      "env": {
        "MYSQL_HOST": "${input:mysql-host}",
        "MYSQL_PORT": "${input:mysql-port}",
        "MYSQL_USER": "${input:mysql-user}",
        "MYSQL_PASSWORD": "${input:mysql-password}",
        "MYSQL_DATABASE": "${input:mysql-database}",
        "MYSQL_PROFILES": "${input:mysql-profiles}",
        "MYSQL_DEFAULT_PROFILE": "${input:mysql-default-profile}",
        "MYSQL_CONNECT_TIMEOUT_MS": "${input:mysql-connect-timeout-ms}",
        "MYSQL_QUERY_TIMEOUT_MS": "${input:mysql-query-timeout-ms}"
      }
    }
  }
}

VS Code prompts for each input the first time the server starts, so no secret is written to the file. VS Code docs

MySQL (read-only, switchable) in other clients