原型 · 预览版:收录官方注册中心里的全部服务器,每 30 分钟同步一次。使用 Google 登录即可撰写评价。原型 · 每 30 分钟更新
PopNx MCP为使用 AI 的人准备的 MCP 服务器 · 用大白话讲清楚

Tokenlite Mysql MCP

作者:andezdev版本 4.1.0i★ 0i在你的电脑上运行
注册名称io.github.andezdev/tokenlite-mysql-mcp

安装方法

What it does

A secure, efficient, and intelligent MySQL server for the Model Context Protocol

  • Connects 在你的电脑上运行
  • Account or key No key needed · 1 setting to fill in (DB_NAME)
  • Category 数据库与数据集

安装

选择你使用的 AI 应用,然后复制设置。

通过 3/3 项检查 · 在你的电脑上运行 · ✓ 命令已检查 2026年11月14日

第一步:你用哪个 AI?

选择你用的应用,步骤会显示在下方。

可连接 Claude,但需要先准备

需要填写 1 项设置(DB_NAME) · 需要先在电脑上安装 Node.js(只需一次) · 仅限电脑上的 Claude 应用(Windows 或 Mac),网页和手机不可用

让 AI 帮你安装

把这段话复制到 Claude 的对话里。AI 会先检查电脑,告诉你要改哪个文件,并且每次都等你同意。

请在这台电脑上为 Claude 安装 MCP server Tokenlite Mysql MCP,按顺序:1) 用 node -v 检查是否有 Node.js。没有的话,请让我从 https://nodejs.org/en/download 安装,不要自己安装。2) 只使用这份配置(已通过 PopNx MCP 检查):{ "mcpServers": { "tokenlite-mysql": { "command": "npx", "args": [ "-y", "@andezdev/tokenlite-mysql-mcp" ], "env": { "DB_NAME": "your-value" } } } } 3) 告诉我要修改的文件完整路径或要运行的命令,等我同意。4) DB_NAME 先保留 "your-value",请我自己把真实值粘贴到文件或应用的输入框里。不要让我在对话里输入密钥。5) 按约定执行,然后确认 Tokenlite Mysql MCP 的工具真的出现了。

这段话不包含你的密钥。如果需要密钥,AI 会请你自己粘贴到文件或应用的输入框里。

  1. 安装 Node.js(如果还没有)

    已经装好了吗?先检查 · 打开终端,输入这条命令后按 Enter

    node -v
    • 显示版本号(例如 v26.13.1)= 已安装,可跳过这一步
    • 显示 "command not found"(Windows 显示 "is not recognized")= 还没安装,或刚装好但需要关掉终端再重新打开
    怎么打开终端

    Mac:按 ⌘ + Space,输入 Terminal 后按 Enter

    Windows:打开“开始”菜单,输入 Windows PowerShell,然后选“打开”

    还没安装: 打开官方下载页,选择 LTS 版本和点选式安装程序:Mac 用 .pkg · Windows 用 .msi。双击后一路下一步即可,不需要 curl 命令

    打开 Node.js 下载页 ↗

    装好后关掉终端再打开,重新运行同一条命令,应显示版本号: node -v

    安装一次,所有需要 Node.js 的工具都能用

  2. 填写 1 项设置

    这些是程序设置,不是密钥,无需注册。按开发者的说明填写。

    • DB_NAME MySQL Database name

    说明仍为英文原文。

  3. 打开电脑版 Claude 应用的设置文件

    SettingsDeveloperEdit Config

  4. 粘贴这些设置并保存文件

    {
      "mcpServers": {
        "tokenlite-mysql": {
          "command": "npx",
          "args": [
            "-y",
            "@andezdev/tokenlite-mysql-mcp"
          ],
          "env": {
            "DB_NAME": "your-value"
          }
        }
      }
    }
  5. 退出 Claude 再重新打开

  6. 试一试

    用 Tokenlite Mysql MCP 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 Claude 说正在使用 Tokenlite Mysql MCP,或回答中出现 Tokenlite Mysql MCP 的工具名称,就表示连接成功

26 项可选设置(不填也能用)

上面的命令不填这些也能用。想调整时再按开发者的说明添加。

  • DB_HOST MySQL Host address (defaults to localhost)
  • DB_PORT MySQL Port (defaults to 3306)
  • DB_USER MySQL Username (defaults to root)
  • DB_PASSWORD MySQL Password (defaults to empty string)
  • MCP_EXPLAIN_MAX_SCAN_ROWS EXPLAIN guardrail: max estimated rows for unindexed full table scans before blocking (defaults to 1000). MCP_SAFE_QUERY_MAX_ROWS is a deprecated alias.
  • MCP_QUERY_ROW_LIMIT Max rows returned per SELECT; injected as LIMIT at the AST level (defaults to 500)
  • MCP_SAFE_QUERY_MAX_ROWS Deprecated alias for MCP_EXPLAIN_MAX_SCAN_ROWS
  • MCP_SAFE_QUERY_ENABLE_BLOCKING Enable or disable the EXPLAIN guardrail (defaults to true)
  • MCP_METADATA_PATH Absolute path to your custom metadata.json dictionary
  • MCP_TEMPLATES_PATH Absolute path to your custom templates.json pre-approved queries
  • TOOL_PREFIX Prefix for tool names, e.g., to run multiple instances (defaults to DB_NAME, e.g. mydb_). Only set to override.
  • MCP_RATE_LIMIT_RPM Max tool invocations per minute, sliding window (defaults to 60). Set to 0 to disable.
  • MYSQL_QUERY_TIMEOUT Max execution time for a query in milliseconds to protect against DoS (defaults to 15000)
  • MYSQL_CONNECTION_LIMIT Max concurrent pool connections (defaults to 10)
  • MYSQL_CONNECT_TIMEOUT Max time to wait for a connection socket to establish in milliseconds (defaults to 10000)
  • MYSQL_RETRY_ATTEMPTS Max retries on transient connection errors (defaults to 3)
  • MYSQL_RETRY_DELAY_MS Base delay in milliseconds for exponential backoff between retries (defaults to 1000)
  • MYSQL_QUEUE_LIMIT Max queued requests when all pool connections are busy to prevent memory leak (defaults to 50)
  • MCP_DDL_CACHE_TTL Time-to-live in seconds for cached DDL statements (defaults to 60)
  • MCP_LOG_LEVEL Minimum severity level for MCP log notifications (defaults to info). Levels: debug, info, notice, warning, error, critical, alert, emergency
  • ALLOW_INSERT_OPERATION Enable INSERT and REPLACE queries (defaults to false)
  • ALLOW_UPDATE_OPERATION Enable UPDATE queries (defaults to false)
  • ALLOW_DELETE_OPERATION Enable DELETE and TRUNCATE queries (defaults to false)
  • ALLOW_DDL_OPERATION Enable Data Definition Language queries like CREATE, ALTER, DROP, RENAME (defaults to false)
  • DB_SSL Enable TLS for the MySQL connection (defaults to false)
  • DB_SSL_REJECT_UNAUTHORIZED Reject self-signed or untrusted TLS certificates when DB_SSL is true (defaults to true)

说明仍为英文原文。

菜单名称已于 2026年11月11日 对照 Anthropic 帮助页面核实 · 你的界面可能因版本略有不同

ChatGPT 暂时无法连接 Tokenlite Mysql MCP

Tokenlite Mysql MCP 需要安装在你的电脑上,而 ChatGPT 只能连接在网上运行的服务器

你可以改用这些方式

A · 使用能连接 Tokenlite Mysql MCP 的应用

  • 需要填写 1 项设置(DB_NAME) · 需要先在电脑上安装 Node.js(只需一次) · 仅限电脑上的 Claude 应用(Windows 或 Mac),网页和手机不可用
  • 需要填写 1 项设置(DB_NAME) · 需要先在电脑上安装 Node.js(只需一次)
  • 需要填写 1 项设置(DB_NAME) · 需要先在电脑上安装 Node.js(只需一次)
  • 需要填写 1 项设置(DB_NAME) · 需要先在电脑上安装 Node.js(只需一次)

B · 数据库与数据集 类中能连接 ChatGPT 的其他服务器

从同类中使用较多的里挑选,仅限用地址即可连接、无需密钥的

可连接 Claude Code,但需要先准备

需要填写 1 项设置(DB_NAME) · 需要先在电脑上安装 Node.js(只需一次)

让 AI 帮你安装

把这段话复制到 Claude Code 的对话里。AI 会先检查电脑,告诉你要改哪个文件,并且每次都等你同意。

请在这台电脑上为 Claude Code 安装 MCP server Tokenlite Mysql MCP,按顺序:1) 用 node -v 检查是否有 Node.js。没有的话,请让我从 https://nodejs.org/en/download 安装,不要自己安装。2) 只使用这份配置(已通过 PopNx MCP 检查):claude mcp add --scope user tokenlite-mysql --env DB_NAME=your-value -- npx -y @andezdev/tokenlite-mysql-mcp 3) 告诉我要修改的文件完整路径或要运行的命令,等我同意。4) DB_NAME 先保留 "your-value",请我自己把真实值粘贴到文件或应用的输入框里。不要让我在对话里输入密钥。5) 按约定执行,然后确认 Tokenlite Mysql MCP 的工具真的出现了。

这段话不包含你的密钥。如果需要密钥,AI 会请你自己粘贴到文件或应用的输入框里。

  1. 安装 Node.js(如果还没有)

    已经装好了吗?先检查 · 打开终端,输入这条命令后按 Enter

    node -v
    • 显示版本号(例如 v26.13.1)= 已安装,可跳过这一步
    • 显示 "command not found"(Windows 显示 "is not recognized")= 还没安装,或刚装好但需要关掉终端再重新打开
    怎么打开终端

    Mac:按 ⌘ + Space,输入 Terminal 后按 Enter

    Windows:打开“开始”菜单,输入 Windows PowerShell,然后选“打开”

    还没安装: 打开官方下载页,选择 LTS 版本和点选式安装程序:Mac 用 .pkg · Windows 用 .msi。双击后一路下一步即可,不需要 curl 命令

    打开 Node.js 下载页 ↗

    装好后关掉终端再打开,重新运行同一条命令,应显示版本号: node -v

    安装一次,所有需要 Node.js 的工具都能用

  2. 填写 1 项设置

    这些是程序设置,不是密钥,无需注册。按开发者的说明填写。

    • DB_NAME MySQL Database name

    说明仍为英文原文。

  3. 打开终端

    Mac:按 Command+空格,输入 Terminal · Windows:打开 PowerShell

  4. 粘贴这条命令并按 Enter

    claude mcp add --scope user tokenlite-mysql --env DB_NAME=your-value -- npx -y @andezdev/tokenlite-mysql-mcp
  5. 在 Claude Code 中输入 /mcp

    应能看到 Tokenlite Mysql MCP 在列表中并显示已连接

  6. 试一试

    用 Tokenlite Mysql MCP 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 Claude Code 说正在使用 Tokenlite Mysql MCP,或回答中出现 Tokenlite Mysql MCP 的工具名称,就表示连接成功

26 项可选设置(不填也能用)

上面的命令不填这些也能用。想调整时再按开发者的说明添加。

  • DB_HOST MySQL Host address (defaults to localhost)
  • DB_PORT MySQL Port (defaults to 3306)
  • DB_USER MySQL Username (defaults to root)
  • DB_PASSWORD MySQL Password (defaults to empty string)
  • MCP_EXPLAIN_MAX_SCAN_ROWS EXPLAIN guardrail: max estimated rows for unindexed full table scans before blocking (defaults to 1000). MCP_SAFE_QUERY_MAX_ROWS is a deprecated alias.
  • MCP_QUERY_ROW_LIMIT Max rows returned per SELECT; injected as LIMIT at the AST level (defaults to 500)
  • MCP_SAFE_QUERY_MAX_ROWS Deprecated alias for MCP_EXPLAIN_MAX_SCAN_ROWS
  • MCP_SAFE_QUERY_ENABLE_BLOCKING Enable or disable the EXPLAIN guardrail (defaults to true)
  • MCP_METADATA_PATH Absolute path to your custom metadata.json dictionary
  • MCP_TEMPLATES_PATH Absolute path to your custom templates.json pre-approved queries
  • TOOL_PREFIX Prefix for tool names, e.g., to run multiple instances (defaults to DB_NAME, e.g. mydb_). Only set to override.
  • MCP_RATE_LIMIT_RPM Max tool invocations per minute, sliding window (defaults to 60). Set to 0 to disable.
  • MYSQL_QUERY_TIMEOUT Max execution time for a query in milliseconds to protect against DoS (defaults to 15000)
  • MYSQL_CONNECTION_LIMIT Max concurrent pool connections (defaults to 10)
  • MYSQL_CONNECT_TIMEOUT Max time to wait for a connection socket to establish in milliseconds (defaults to 10000)
  • MYSQL_RETRY_ATTEMPTS Max retries on transient connection errors (defaults to 3)
  • MYSQL_RETRY_DELAY_MS Base delay in milliseconds for exponential backoff between retries (defaults to 1000)
  • MYSQL_QUEUE_LIMIT Max queued requests when all pool connections are busy to prevent memory leak (defaults to 50)
  • MCP_DDL_CACHE_TTL Time-to-live in seconds for cached DDL statements (defaults to 60)
  • MCP_LOG_LEVEL Minimum severity level for MCP log notifications (defaults to info). Levels: debug, info, notice, warning, error, critical, alert, emergency
  • ALLOW_INSERT_OPERATION Enable INSERT and REPLACE queries (defaults to false)
  • ALLOW_UPDATE_OPERATION Enable UPDATE queries (defaults to false)
  • ALLOW_DELETE_OPERATION Enable DELETE and TRUNCATE queries (defaults to false)
  • ALLOW_DDL_OPERATION Enable Data Definition Language queries like CREATE, ALTER, DROP, RENAME (defaults to false)
  • DB_SSL Enable TLS for the MySQL connection (defaults to false)
  • DB_SSL_REJECT_UNAUTHORIZED Reject self-signed or untrusted TLS certificates when DB_SSL is true (defaults to true)

说明仍为英文原文。

菜单名称已于 2026年11月11日 对照 Anthropic 帮助页面核实 · 你的界面可能因版本略有不同

可连接 Cursor,但需要先准备

需要填写 1 项设置(DB_NAME) · 需要先在电脑上安装 Node.js(只需一次)

让 AI 帮你安装

把这段话复制到 Cursor 的对话里。AI 会先检查电脑,告诉你要改哪个文件,并且每次都等你同意。

请在这台电脑上为 Cursor 安装 MCP server Tokenlite Mysql MCP,按顺序:1) 用 node -v 检查是否有 Node.js。没有的话,请让我从 https://nodejs.org/en/download 安装,不要自己安装。2) 只使用这份配置(已通过 PopNx MCP 检查):{ "mcpServers": { "tokenlite-mysql": { "command": "npx", "args": [ "-y", "@andezdev/tokenlite-mysql-mcp" ], "env": { "DB_NAME": "your-value" } } } } 3) 告诉我要修改的文件完整路径或要运行的命令,等我同意。4) DB_NAME 先保留 "your-value",请我自己把真实值粘贴到文件或应用的输入框里。不要让我在对话里输入密钥。5) 按约定执行,然后确认 Tokenlite Mysql MCP 的工具真的出现了。

这段话不包含你的密钥。如果需要密钥,AI 会请你自己粘贴到文件或应用的输入框里。

  1. 安装 Node.js(如果还没有)

    已经装好了吗?先检查 · 打开终端,输入这条命令后按 Enter

    node -v
    • 显示版本号(例如 v26.13.1)= 已安装,可跳过这一步
    • 显示 "command not found"(Windows 显示 "is not recognized")= 还没安装,或刚装好但需要关掉终端再重新打开
    怎么打开终端

    Mac:按 ⌘ + Space,输入 Terminal 后按 Enter

    Windows:打开“开始”菜单,输入 Windows PowerShell,然后选“打开”

    还没安装: 打开官方下载页,选择 LTS 版本和点选式安装程序:Mac 用 .pkg · Windows 用 .msi。双击后一路下一步即可,不需要 curl 命令

    打开 Node.js 下载页 ↗

    装好后关掉终端再打开,重新运行同一条命令,应显示版本号: node -v

    安装一次,所有需要 Node.js 的工具都能用

  2. 填写 1 项设置

    这些是程序设置,不是密钥,无需注册。按开发者的说明填写。

    • DB_NAME MySQL Database name

    说明仍为英文原文。

  3. 点击这个按钮打开 Cursor

    在 Cursor 中打开

    Cursor 会请你确认安装,点击 Install

  4. 填写你的密钥

    在 Tokenlite Mysql MCP 的设置中,DB_NAME 还是空的,填入你的密钥并保存

  5. 在 Cursor 中以 Agent 模式打开 AI 聊天

  6. 试一试

    用 Tokenlite Mysql MCP 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 Cursor 说正在使用 Tokenlite Mysql MCP,或回答中出现 Tokenlite Mysql MCP 的工具名称,就表示连接成功

26 项可选设置(不填也能用)

上面的命令不填这些也能用。想调整时再按开发者的说明添加。

  • DB_HOST MySQL Host address (defaults to localhost)
  • DB_PORT MySQL Port (defaults to 3306)
  • DB_USER MySQL Username (defaults to root)
  • DB_PASSWORD MySQL Password (defaults to empty string)
  • MCP_EXPLAIN_MAX_SCAN_ROWS EXPLAIN guardrail: max estimated rows for unindexed full table scans before blocking (defaults to 1000). MCP_SAFE_QUERY_MAX_ROWS is a deprecated alias.
  • MCP_QUERY_ROW_LIMIT Max rows returned per SELECT; injected as LIMIT at the AST level (defaults to 500)
  • MCP_SAFE_QUERY_MAX_ROWS Deprecated alias for MCP_EXPLAIN_MAX_SCAN_ROWS
  • MCP_SAFE_QUERY_ENABLE_BLOCKING Enable or disable the EXPLAIN guardrail (defaults to true)
  • MCP_METADATA_PATH Absolute path to your custom metadata.json dictionary
  • MCP_TEMPLATES_PATH Absolute path to your custom templates.json pre-approved queries
  • TOOL_PREFIX Prefix for tool names, e.g., to run multiple instances (defaults to DB_NAME, e.g. mydb_). Only set to override.
  • MCP_RATE_LIMIT_RPM Max tool invocations per minute, sliding window (defaults to 60). Set to 0 to disable.
  • MYSQL_QUERY_TIMEOUT Max execution time for a query in milliseconds to protect against DoS (defaults to 15000)
  • MYSQL_CONNECTION_LIMIT Max concurrent pool connections (defaults to 10)
  • MYSQL_CONNECT_TIMEOUT Max time to wait for a connection socket to establish in milliseconds (defaults to 10000)
  • MYSQL_RETRY_ATTEMPTS Max retries on transient connection errors (defaults to 3)
  • MYSQL_RETRY_DELAY_MS Base delay in milliseconds for exponential backoff between retries (defaults to 1000)
  • MYSQL_QUEUE_LIMIT Max queued requests when all pool connections are busy to prevent memory leak (defaults to 50)
  • MCP_DDL_CACHE_TTL Time-to-live in seconds for cached DDL statements (defaults to 60)
  • MCP_LOG_LEVEL Minimum severity level for MCP log notifications (defaults to info). Levels: debug, info, notice, warning, error, critical, alert, emergency
  • ALLOW_INSERT_OPERATION Enable INSERT and REPLACE queries (defaults to false)
  • ALLOW_UPDATE_OPERATION Enable UPDATE queries (defaults to false)
  • ALLOW_DELETE_OPERATION Enable DELETE and TRUNCATE queries (defaults to false)
  • ALLOW_DDL_OPERATION Enable Data Definition Language queries like CREATE, ALTER, DROP, RENAME (defaults to false)
  • DB_SSL Enable TLS for the MySQL connection (defaults to false)
  • DB_SSL_REJECT_UNAUTHORIZED Reject self-signed or untrusted TLS certificates when DB_SSL is true (defaults to true)

说明仍为英文原文。

菜单名称已于 2026年11月11日 对照 Cursor 帮助页面核实 · 你的界面可能因版本略有不同

可连接 VS Code,但需要先准备

需要填写 1 项设置(DB_NAME) · 需要先在电脑上安装 Node.js(只需一次)

让 AI 帮你安装

把这段话复制到 VS Code 的对话里。AI 会先检查电脑,告诉你要改哪个文件,并且每次都等你同意。

请在这台电脑上为 VS Code 安装 MCP server Tokenlite Mysql MCP,按顺序:1) 用 node -v 检查是否有 Node.js。没有的话,请让我从 https://nodejs.org/en/download 安装,不要自己安装。2) 只使用这份配置(已通过 PopNx MCP 检查):{ "servers": { "tokenlite-mysql": { "type": "stdio", "command": "npx", "args": [ "-y", "@andezdev/tokenlite-mysql-mcp" ], "env": { "DB_NAME": "your-value" } } } } 3) 告诉我要修改的文件完整路径或要运行的命令,等我同意。4) DB_NAME 先保留 "your-value",请我自己把真实值粘贴到文件或应用的输入框里。不要让我在对话里输入密钥。5) 按约定执行,然后确认 Tokenlite Mysql MCP 的工具真的出现了。

这段话不包含你的密钥。如果需要密钥,AI 会请你自己粘贴到文件或应用的输入框里。

  1. 安装 Node.js(如果还没有)

    已经装好了吗?先检查 · 打开终端,输入这条命令后按 Enter

    node -v
    • 显示版本号(例如 v26.13.1)= 已安装,可跳过这一步
    • 显示 "command not found"(Windows 显示 "is not recognized")= 还没安装,或刚装好但需要关掉终端再重新打开
    怎么打开终端

    Mac:按 ⌘ + Space,输入 Terminal 后按 Enter

    Windows:打开“开始”菜单,输入 Windows PowerShell,然后选“打开”

    还没安装: 打开官方下载页,选择 LTS 版本和点选式安装程序:Mac 用 .pkg · Windows 用 .msi。双击后一路下一步即可,不需要 curl 命令

    打开 Node.js 下载页 ↗

    装好后关掉终端再打开,重新运行同一条命令,应显示版本号: node -v

    安装一次,所有需要 Node.js 的工具都能用

  2. 填写 1 项设置

    这些是程序设置,不是密钥,无需注册。按开发者的说明填写。

    • DB_NAME MySQL Database name

    说明仍为英文原文。

  3. 点击这个按钮打开 VS Code

    在 VS Code 中打开

    VS Code 会请你确认安装,点击 Install

  4. 填写你的密钥

    在 Tokenlite Mysql MCP 的设置中,DB_NAME 还是空的,填入你的密钥并保存

  5. 在 VS Code 中以 Agent 模式打开 AI 聊天

  6. 试一试

    用 Tokenlite Mysql MCP 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 VS Code 说正在使用 Tokenlite Mysql MCP,或回答中出现 Tokenlite Mysql MCP 的工具名称,就表示连接成功

26 项可选设置(不填也能用)

上面的命令不填这些也能用。想调整时再按开发者的说明添加。

  • DB_HOST MySQL Host address (defaults to localhost)
  • DB_PORT MySQL Port (defaults to 3306)
  • DB_USER MySQL Username (defaults to root)
  • DB_PASSWORD MySQL Password (defaults to empty string)
  • MCP_EXPLAIN_MAX_SCAN_ROWS EXPLAIN guardrail: max estimated rows for unindexed full table scans before blocking (defaults to 1000). MCP_SAFE_QUERY_MAX_ROWS is a deprecated alias.
  • MCP_QUERY_ROW_LIMIT Max rows returned per SELECT; injected as LIMIT at the AST level (defaults to 500)
  • MCP_SAFE_QUERY_MAX_ROWS Deprecated alias for MCP_EXPLAIN_MAX_SCAN_ROWS
  • MCP_SAFE_QUERY_ENABLE_BLOCKING Enable or disable the EXPLAIN guardrail (defaults to true)
  • MCP_METADATA_PATH Absolute path to your custom metadata.json dictionary
  • MCP_TEMPLATES_PATH Absolute path to your custom templates.json pre-approved queries
  • TOOL_PREFIX Prefix for tool names, e.g., to run multiple instances (defaults to DB_NAME, e.g. mydb_). Only set to override.
  • MCP_RATE_LIMIT_RPM Max tool invocations per minute, sliding window (defaults to 60). Set to 0 to disable.
  • MYSQL_QUERY_TIMEOUT Max execution time for a query in milliseconds to protect against DoS (defaults to 15000)
  • MYSQL_CONNECTION_LIMIT Max concurrent pool connections (defaults to 10)
  • MYSQL_CONNECT_TIMEOUT Max time to wait for a connection socket to establish in milliseconds (defaults to 10000)
  • MYSQL_RETRY_ATTEMPTS Max retries on transient connection errors (defaults to 3)
  • MYSQL_RETRY_DELAY_MS Base delay in milliseconds for exponential backoff between retries (defaults to 1000)
  • MYSQL_QUEUE_LIMIT Max queued requests when all pool connections are busy to prevent memory leak (defaults to 50)
  • MCP_DDL_CACHE_TTL Time-to-live in seconds for cached DDL statements (defaults to 60)
  • MCP_LOG_LEVEL Minimum severity level for MCP log notifications (defaults to info). Levels: debug, info, notice, warning, error, critical, alert, emergency
  • ALLOW_INSERT_OPERATION Enable INSERT and REPLACE queries (defaults to false)
  • ALLOW_UPDATE_OPERATION Enable UPDATE queries (defaults to false)
  • ALLOW_DELETE_OPERATION Enable DELETE and TRUNCATE queries (defaults to false)
  • ALLOW_DDL_OPERATION Enable Data Definition Language queries like CREATE, ALTER, DROP, RENAME (defaults to false)
  • DB_SSL Enable TLS for the MySQL connection (defaults to false)
  • DB_SSL_REJECT_UNAUTHORIZED Reject self-signed or untrusted TLS certificates when DB_SSL is true (defaults to true)

说明仍为英文原文。

菜单名称已于 2026年11月11日 对照 VS Code 帮助页面核实 · 你的界面可能因版本略有不同

其他支持 MCP 的应用(如 Windsurf、Zed、Gemini CLI)添加方式各不相同,请在应用列表中查看

查看所有支持 MCP 的应用 →

JSON 设置在下方“开发者专用”中

卡住了?问问正在用 Tokenlite Mysql MCP 的人💬 讨论 →
开发者专用:终端命令和 JSON 设置

安装在电脑上

Claude Code

claude mcp add --scope user tokenlite-mysql --env DB_NAME=your-value -- npx -y @andezdev/tokenlite-mysql-mcp

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "tokenlite-mysql": {
      "command": "npx",
      "args": [
        "-y",
        "@andezdev/tokenlite-mysql-mcp"
      ],
      "env": {
        "DB_NAME": "your-value"
      }
    }
  }
}

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "tokenlite-mysql": {
      "command": "npx",
      "args": [
        "-y",
        "@andezdev/tokenlite-mysql-mcp"
      ],
      "env": {
        "DB_NAME": "your-value"
      }
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "tokenlite-mysql": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@andezdev/tokenlite-mysql-mcp"
      ],
      "env": {
        "DB_NAME": "your-value"
      }
    }
  }
}

需要你填写的值

  • DB_HOST env
    MySQL Host address (defaults to localhost)
  • DB_PORT env
    MySQL Port (defaults to 3306)
  • DB_USER env
    MySQL Username (defaults to root)
  • DB_PASSWORD 机密 env
    MySQL Password (defaults to empty string)
  • DB_NAME 必填 env
    MySQL Database name
  • MCP_EXPLAIN_MAX_SCAN_ROWS env
    EXPLAIN guardrail: max estimated rows for unindexed full table scans before blocking (defaults to 1000). MCP_SAFE_QUERY_MAX_ROWS is a deprecated alias.
  • MCP_QUERY_ROW_LIMIT env
    Max rows returned per SELECT; injected as LIMIT at the AST level (defaults to 500)
  • MCP_SAFE_QUERY_MAX_ROWS env
    Deprecated alias for MCP_EXPLAIN_MAX_SCAN_ROWS
  • MCP_SAFE_QUERY_ENABLE_BLOCKING env
    Enable or disable the EXPLAIN guardrail (defaults to true)
  • MCP_METADATA_PATH env
    Absolute path to your custom metadata.json dictionary
  • MCP_TEMPLATES_PATH env
    Absolute path to your custom templates.json pre-approved queries
  • TOOL_PREFIX env
    Prefix for tool names, e.g., to run multiple instances (defaults to DB_NAME, e.g. mydb_). Only set to override.
  • MCP_RATE_LIMIT_RPM env
    Max tool invocations per minute, sliding window (defaults to 60). Set to 0 to disable.
  • MYSQL_QUERY_TIMEOUT env
    Max execution time for a query in milliseconds to protect against DoS (defaults to 15000)
  • MYSQL_CONNECTION_LIMIT env
    Max concurrent pool connections (defaults to 10)
  • MYSQL_CONNECT_TIMEOUT env
    Max time to wait for a connection socket to establish in milliseconds (defaults to 10000)
  • MYSQL_RETRY_ATTEMPTS env
    Max retries on transient connection errors (defaults to 3)
  • MYSQL_RETRY_DELAY_MS env
    Base delay in milliseconds for exponential backoff between retries (defaults to 1000)
  • MYSQL_QUEUE_LIMIT env
    Max queued requests when all pool connections are busy to prevent memory leak (defaults to 50)
  • MCP_DDL_CACHE_TTL env
    Time-to-live in seconds for cached DDL statements (defaults to 60)
  • MCP_LOG_LEVEL env
    Minimum severity level for MCP log notifications (defaults to info). Levels: debug, info, notice, warning, error, critical, alert, emergency
  • ALLOW_INSERT_OPERATION env
    Enable INSERT and REPLACE queries (defaults to false)
  • ALLOW_UPDATE_OPERATION env
    Enable UPDATE queries (defaults to false)
  • ALLOW_DELETE_OPERATION env
    Enable DELETE and TRUNCATE queries (defaults to false)
  • ALLOW_DDL_OPERATION env
    Enable Data Definition Language queries like CREATE, ALTER, DROP, RENAME (defaults to false)
  • DB_SSL env
    Enable TLS for the MySQL connection (defaults to false)
  • DB_SSL_REJECT_UNAUTHORIZED env
    Reject self-signed or untrusted TLS certificates when DB_SSL is true (defaults to true)

说明仍为英文原文。

这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。

一览

每周下载量i
52/周
连接方式
在你的电脑上运行
最新版本i
4.1.0
发布到注册中心i
2026年6月7日
代码最后更新i
2026年9月11日
作者
andezdev
软件包
npm: @andezdev/tokenlite-mysql-mcp
注册状态
活跃

哪些应用可以使用它

依据这个服务器的连接方式和各应用自己的文档,检查于 2026年11月10日。

在你的电脑上运行,适用于

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

全部应用及其优缺点 →

它能做什么

它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。

基础检查i

我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月15日

  • ✓ 通过

    作者与仓库一致

    注册名称已通过 GitHub 账户 andezdev 验证,该账户拥有此仓库

  • ✓ 通过

    仍在维护

    代码最后更新于2个月前

  • ✓ 通过

    有许可证

    使用 MIT

  • – 不适用

    端点有响应

    它在你的电脑上运行,没有互联网端点

  • – 不适用

    使用 OAuth 登录

    在你的电脑上运行,改用本地设置

  • … 尚未检查

    工具描述中没有隐藏指令

    它在你的电脑上运行;我们只能读取互联网端点的工具列表

已公开的漏洞(OSV.dev)

尚未检查

我们检查什么 → · JSON

作者:申请重新检查或报告信息错误

讨论

提问、分享技巧或报告无法使用。按“有帮助”数量排序。

还没有帖子,欢迎第一个提问或分享。

此处内容由用户撰写,不代表 PopNx 团队。

登录后发帖

用户评价

还没有评价

登录后写评价

与“数据库与数据集”中的其他服务器比较i

  • 星标数多于此分类中其他 1199 个服务器的 0%
  • 发布到注册中心的时间比此分类中其他 1199 个服务器的 12% 更新
  • 基础检查结果等于或优于此分类中其他 1199 个服务器的 100%

与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。

常见问题

Tokenlite Mysql MCP 安全吗?

它在 3 项适用的基础检查中通过了 3 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。

它需要哪些密钥或代码?

注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。

它在我的电脑上运行还是在云端?

它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。

它还在维护吗?

GitHub 仓库最后更新于2个月前,最新版本(4.1.0)于5个月前进入注册中心。

哪些应用可以使用它?

支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。

有什么可以替代它?

同一分类中有:QueryWeaver, Supabase, Neon, DBCode, Keboola MCP

功能相近的其他选择

同一分类、其他作者、命令已通过检查。官方的排在前面,再按星标排序。

如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i

QueryWeaver

An MCP server for Text2SQL: transforms natural language into SQL using graph schema understanding.

作者:FalkorDB正在增长★ 109614个月前更新

在你的电脑上运行✓ falkordb.com

Supabase

MCP server for interacting with the Supabase platform

作者:supabase广泛使用↓ 24.6万/周★ 3012 整个仓库的星标前天更新

电脑或云端✓ 服务方 · supabase.com

Neon

Official Neon MCP server for managing Neon projects and Lakebase Postgres databases.

作者:neondatabase正在增长★ 6639天前更新

在云端运行✓ 服务方 · neon.com

DBCode

Query and explore 100+ databases through your DBCode connections.

作者:dbcodeio起步阶段↓ 80/周★ 366 整个仓库的星标43天前更新

在你的电脑上运行✓ 服务方 · dbcode.io

Keboola MCP

Connect your AI assistants to Keboola and expose your data, transformations, SQL queries, ...

作者:keboola正在增长↓ 1421/周★ 854天前更新

电脑或云端✓ 服务方 · keboola.com
  • QueryWeaver — 需要安装在电脑上 · 不需要密钥
  • Supabase — 云端或安装在电脑上都可以 · 需要密钥 · 在 Claude 的目录中
  • Neon — 在云端运行,无需安装 · 不需要密钥
  • DBCode — 需要安装在电脑上 · 不需要密钥
  • Keboola MCP — 云端或安装在电脑上都可以 · 不需要密钥

作者的 README

打开 README

按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。

TokenLite MySQL MCP

A robust and secure MySQL database server implemented under Anthropic's Model Context Protocol (MCP). Designed specifically to solve the shortcomings of current generic MCP servers through Graceful Degradation, Active Performance Protection, and Aggressive Token Optimization.


🌟 Core Pillars

  1. Safe-Query Optimizer (AST & EXPLAIN): Protects production databases by pre-analyzing queries. Blocks unindexed Full Table Scans that exceed configurable thresholds and injects strict LIMIT clauses automatically at the AST level.
  2. Granular AST-Based Write Permissions: By default, TokenLite is 100% Read-Only. You can surgically enable specific write operations (INSERT, UPDATE, DELETE, DDL) via environment variables. The firewall uses strict AST parsing to prevent SQL injection and comment-bypass attacks, and strictly prohibits privilege escalation commands (like GRANT or CALL).
  3. Session-Level Defense in Depth: If the server is configured in strict Read-Only mode (all write variables disabled), TokenLite injects SET SESSION TRANSACTION READ ONLY directly into the connection pool sockets. This guarantees that even if a theoretical bypass exists in the AST parser, the MySQL engine itself will physically reject any data modification.
  4. Business Intelligence Injection: Bridges the gap between raw data and company logic. Automatically attaches semantic dictionaries (metadata.json) to database schema exploration, and exposes Semantic Templates via the official MCP Prompts API (templates.json) so the LLM uses pre-approved analytical queries instead of hallucinating them.
  5. Graph-Based Semantic Schema: Avoids sending giant schemas to the LLM that saturate the context window. When a table is searched, the engine uses heuristics to deduce implicit relationships and packages the exact "Auto-Join Context".
  6. CSV Token Compression: Database results are efficiently transformed into tabular CSV markdown with unambiguous NULL representation (∅), saving up to 50% of Output Tokens compared to verbose JSON. When results hit the applied LIMIT, a -- rows: N (truncated at LIMIT X) footer is appended so the LLM does not assume a complete dataset.
  7. MCP Completions: Table names and template keywords support the official completions/complete capability for resource templates (mysql://tables/{name}) and the query_templates prompt.

📋 Requirements

  • Node.js v20 or higher
  • MySQL 5.7 or higher (MySQL 8.0+ recommended)
  • A MySQL user with SELECT and SHOW VIEW privileges.

🚀 Installation & Usage

You can use this MCP server with any compatible client. Below are the configurations for the most popular ones.

1. Claude Desktop

Edit your claude_desktop_config.json (usually located at %APPDATA%\Claude\claude_desktop_config.json on Windows or ~/Library/Application Support/Claude/claude_desktop_config.json on macOS) and add the following:

Using NPX (Recommended)

{

"mcpServers": { "tokenlite-mysql": { "command": "npx", "args": [ "-y", "@andezdev/tokenlite-mysql-mcp" ], "env": { "DB_HOST": "localhost", "DB_PORT": "3306", "DB_USER": "your_db_user", "DB_PASSWORD": "your_password", "DB_NAME": "your_database", "MCP_EXPLAIN_MAX_SCAN_ROWS": "1000", "MCP_QUERY_ROW_LIMIT": "500", "MCP_SAFE_QUERY_ENABLE_BLOCKING": "true" } } } }

2. Claude Code (CLI)

You can easily integrate this server globally into Claude Code:

claude mcp add tokenlite_mysql \

-e DB_HOST="127.0.0.1" \ -e DB_PORT="3306" \ -e DB_USER="root" \ -e DB_PASSWORD="your_password" \ -e DB_NAME="your_database" \ -- npx -y @andezdev/tokenlite-mysql-mcp

3. Cursor IDE

To use within Cursor IDE:

  1. Open Cursor Settings > Features > MCP.
  2. Click + Add New MCP Server.
  3. Set the Type to command.
  4. Name it tokenlite-mysql.
  5. Set the command to:
   npx -y @andezdev/tokenlite-mysql-mcp

*(Note: Cursor handles environment variables directly in the IDE UI, make sure to add your DB credentials there).*


⚙️ Environment Variables Reference

Understanding Query Limits (two independent knobs)

execute_safe_query applies two separate limits. Do not confuse them:

VariableWhat it controlsDefaultExample
MCP_EXPLAIN_MAX_SCAN_ROWSSecurity gate: blocks queries whose EXPLAIN plan shows a full table scan (type: ALL) with more estimated rows than this threshold. The query is rejected *before* execution.10005000 allows scanning tables up to ~5000 rows without an index
MCP_QUERY_ROW_LIMITResult cap: max rows returned to the LLM. Injected as LIMIT at the AST level. When reached, CSV includes -- rows: N (truncated at LIMIT X).5001000 returns up to 1000 rows per SELECT

Deprecated alias: MCP_SAFE_QUERY_MAX_ROWS still works as a fallback for MCP_EXPLAIN_MAX_SCAN_ROWS only. It does not control the result LIMIT.

Worked example with MCP_EXPLAIN_MAX_SCAN_ROWS=5000 and MCP_QUERY_ROW_LIMIT=500 on a customers table (~1502 rows):

  1. SELECT * FROM customers → passes EXPLAIN (1502 < 5000), executes with LIMIT 500, returns 500 rows + truncation footer.
  2. Same config but table has 8000 rows → blocked by EXPLAIN before execution.
VariableDescriptionDefaultRequired
DB_HOSTMySQL Host addresslocalhostNo
DB_PORTMySQL Port3306No
DB_USERMySQL UsernamerootNo
DB_PASSWORDMySQL Password''No
DB_NAMEMySQL Database nametestYes
MCP_EXPLAIN_MAX_SCAN_ROWSEXPLAIN guardrail: max estimated rows for unindexed full table scans before blocking.1000No
MCP_QUERY_ROW_LIMITMax rows returned per SELECT (AST-injected LIMIT + truncation footer).500No
MCP_SAFE_QUERY_ENABLE_BLOCKINGEnable or disable the EXPLAIN guardrail.trueNo
MCP_METADATA_PATHAbsolute path to your custom metadata.json dictionary.(Disabled)No
MCP_TEMPLATES_PATHAbsolute path to your custom templates.json queries.(Disabled)No
TOOL_PREFIXPrefix for tool names (useful when running multiple instances).Derived from DB_NAME (e.g., mydb_). Random fallback only if DB_NAME is unset.No
MCP_RATE_LIMIT_RPMMax tool invocations per minute (sliding window). Set to 0 to disable.60No
MYSQL_QUERY_TIMEOUTMax execution time for a query (in ms). Aborts heavy queries to protect against DoS.15000No
MYSQL_CONNECTION_LIMITMax concurrent pool connections.10No
MYSQL_CONNECT_TIMEOUTMax time to wait for a socket to establish (in ms).10000No
MYSQL_RETRY_ATTEMPTSMax retries on transient connection errors (ECONNREFUSED, PROTOCOL_CONNECTION_LOST, etc.).3No
MYSQL_RETRY_DELAY_MSBase delay (ms) for exponential backoff between retries (1s, 2s, 4s...).1000No
MYSQL_QUEUE_LIMITMax queued requests when all pool connections are busy. Prevents unbounded growth if MySQL is down.50No
MCP_DDL_CACHE_TTLTime-to-live (in seconds) for cached DDL statements. Reduces latency on repeated search_schema calls. Invalidated by refresh_schema.60No
MCP_LOG_LEVELMinimum severity for MCP log notifications: debug, info, notice, warning, error, critical, alert, emergency.infoNo
ALLOW_INSERT_OPERATIONEnable INSERT and REPLACE queries.falseNo
ALLOW_UPDATE_OPERATIONEnable UPDATE queries.falseNo
ALLOW_DELETE_OPERATIONEnable DELETE and TRUNCATE queries.falseNo
ALLOW_DDL_OPERATIONEnable Data Definition Language (CREATE, ALTER, DROP, RENAME).falseNo
DB_SSLEnable TLS for the MySQL connection (recommended for managed/cloud databases).falseNo
DB_SSL_REJECT_UNAUTHORIZEDReject self-signed or untrusted TLS certificates when DB_SSL=true.trueNo

🛡️ Business Intelligence Features (Opt-in)

TokenLite can teach the LLM about your company's business rules. To enable this, map the absolute paths of two JSON files via .env or your MCP client config:

metadata.json (Semantic Dictionary)

Translate integer statuses or internal jargon so the LLM understands the data.

{

"orders.status": { "pending": "The order is waiting for payment validation", "shipped": "The order has left the warehouse" } }

Custom Relationships

Define FK mappings the heuristic engine can't auto-detect (e.g., created_by → users). Add a _relationships key to your metadata.json:

{

"orders.status": { "pending": "...", "shipped": "..." }, "_relationships": { "orders.created_by": "users.id", "categories.parent_id": "categories.id" } }

These are treated as authoritative (not heuristic) and take priority over automatic detection.

The heuristic engine also assigns a confidence score (0–100) to each inferred FK based on name matching (+40), data type validation (+30), primary key verification (+20), and index presence (+10). Only FKs scoring ≥70 are accepted.

templates.json (Pre-approved SQL)

Stop the LLM from hallucinating complex metrics by providing vetted templates.

[

{ "name": "Customer Lifetime Value (LTV)", "description": "Calculates total revenue generated by delivered orders per customer.", "sql": "SELECT c.id, SUM(oi.price) FROM customers c JOIN orders o... WHERE o.status='delivered'" } ]


📈 Benchmarks & Token Savings

TokenLite includes an automated benchmark suite using o200k_base tokenization (GPT-4o/GPT-5 standard) to measure efficiency improvements. Token counts are approximate — Claude 4.x uses a proprietary tokenizer; actual counts may vary slightly.

To run the benchmark in your own environment:

npm run benchmark
Baseline: Standard MCP Pattern

The benchmark compares against the standard pattern used by generic MySQL MCP servers: full schema exposed as information_schema.columns in pretty-printed JSON, and query results returned as JSON.stringify(rows, null, 2) with execution time metadata.

1. Schema Discovery (Input Tokens)

Standard MCP servers dump the entire schema to the LLM. For large databases, this consumes thousands of input tokens on every turn. TokenLite's relational graph serves a localized Auto-Join Context (target table + direct parent tables + direct child tables).

ScenarioStandard MCP PatternTokenLite📉 Savings
Mock (50 tables, Enterprise CRM)15,566 tokens883 tokens94.3%
Live (9 tables, Test DB)2,208 tokens531 tokens75.9%

Savings scale with the number of tables: the more tables in the database, the higher the savings because the standard pattern dumps all of them while TokenLite only fetches the target + 1-hop relationships.

2. Query Result Payloads (Output Tokens)

TokenLite converts raw database rows to a dense, structured CSV layout. This avoids JSON syntax overhead (brackets, braces, repeated keys) and compresses the output payload returned to the LLM. When the row count reaches the server-injected LIMIT, results include a truncation footer (e.g. -- rows: 500 (truncated at LIMIT 500)) so agents know more data may exist.

Mock data (varied: NULLs, long descriptions, mixed lengths):

Rows ReturnedStandard MCP Pattern (Tokens)TokenLite CSV (Tokens)📉 Output Savings (%)
10 rows

只显示了开头部分;其余内容请在仓库中阅读