AgentHubAgentHub

tokenlite-mysql-mcp

MCP ServerMCP Registry官方收录

io.github.andezdev/tokenlite-mysql-mcp · v4.1.0

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

概览

tokenlite-mysql-mcp 是一个MCP Server,收录自 官方 MCP Registry。支持 stdio 传输。本页提供 Cursor、Claude Code 等客户端的安装配置片段。

安装

选择你的平台查看安装方式

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

环境变量

DB_HOST可选

MySQL Host address (defaults to localhost)

DB_PORT可选

MySQL Port (defaults to 3306)

DB_USER可选

MySQL Username (defaults to root)

DB_PASSWORD可选secret

MySQL Password (defaults to empty string)

DB_NAME必填

MySQL Database name

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)

相关资源

统一 Manifest

{
  "id": "io.github.andezdev/tokenlite-mysql-mcp",
  "type": "mcp-server",
  "version": "4.1.0",
  "displayName": "tokenlite-mysql-mcp",
  "description": "A secure, efficient, and intelligent MySQL server for the Model Context Protocol",
  "repository": {
    "url": "https://github.com/andezdev/tokenlite-mysql-mcp",
    "source": "github"
  },
  "distribution": {
    "packages": [
      {
        "registryType": "npm",
        "identifier": "@andezdev/tokenlite-mysql-mcp",
        "version": "4.1.0",
        "transport": "stdio",
        "environmentVariables": [
          {
            "name": "DB_HOST",
            "description": "MySQL Host address (defaults to localhost)"
          },
          {
            "name": "DB_PORT",
            "description": "MySQL Port (defaults to 3306)"
          },
          {
            "name": "DB_USER",
            "description": "MySQL Username (defaults to root)"
          },
          {
            "name": "DB_PASSWORD",
            "description": "MySQL Password (defaults to empty string)",
            "isSecret": true
          },
          {
            "name": "DB_NAME",
            "description": "MySQL Database name",
            "isRequired": true
          },
          {
            "name": "MCP_EXPLAIN_MAX_SCAN_ROWS",
            "description": "EXPLAIN guardrail: max estimated rows for unindexed full table scans before blocking (defaults to 1000). MCP_SAFE_QUERY_MAX_ROWS is a deprecated alias."
          },
          {
            "name": "MCP_QUERY_ROW_LIMIT",
            "description": "Max rows returned per SELECT; injected as LIMIT at the AST level (defaults to 500)"
          },
          {
            "name": "MCP_SAFE_QUERY_MAX_ROWS",
            "description": "Deprecated alias for MCP_EXPLAIN_MAX_SCAN_ROWS"
          },
          {
            "name": "MCP_SAFE_QUERY_ENABLE_BLOCKING",
            "description": "Enable or disable the EXPLAIN guardrail (defaults to true)"
          },
          {
            "name": "MCP_METADATA_PATH",
            "description": "Absolute path to your custom metadata.json dictionary"
          },
          {
            "name": "MCP_TEMPLATES_PATH",
            "description": "Absolute path to your custom templates.json pre-approved queries"
          },
          {
            "name": "TOOL_PREFIX",
            "description": "Prefix for tool names, e.g., to run multiple instances (defaults to DB_NAME, e.g. mydb_). Only set to override."
          },
          {
            "name": "MCP_RATE_LIMIT_RPM",
            "description": "Max tool invocations per minute, sliding window (defaults to 60). Set to 0 to disable."
          },
          {
            "name": "MYSQL_QUERY_TIMEOUT",
            "description": "Max execution time for a query in milliseconds to protect against DoS (defaults to 15000)"
          },
          {
            "name": "MYSQL_CONNECTION_LIMIT",
            "description": "Max concurrent pool connections (defaults to 10)"
          },
          {
            "name": "MYSQL_CONNECT_TIMEOUT",
            "description": "Max time to wait for a connection socket to establish in milliseconds (defaults to 10000)"
          },
          {
            "name": "MYSQL_RETRY_ATTEMPTS",
            "description": "Max retries on transient connection errors (defaults to 3)"
          },
          {
            "name": "MYSQL_RETRY_DELAY_MS",
            "description": "Base delay in milliseconds for exponential backoff between retries (defaults to 1000)"
          },
          {
            "name": "MYSQL_QUEUE_LIMIT",
            "description": "Max queued requests when all pool connections are busy to prevent memory leak (defaults to 50)"
          },
          {
            "name": "MCP_DDL_CACHE_TTL",
            "description": "Time-to-live in seconds for cached DDL statements (defaults to 60)"
          },
          {
            "name": "MCP_LOG_LEVEL",
            "description": "Minimum severity level for MCP log notifications (defaults to info). Levels: debug, info, notice, warning, error, critical, alert, emergency"
          },
          {
            "name": "ALLOW_INSERT_OPERATION",
            "description": "Enable INSERT and REPLACE queries (defaults to false)"
          },
          {
            "name": "ALLOW_UPDATE_OPERATION",
            "description": "Enable UPDATE queries (defaults to false)"
          },
          {
            "name": "ALLOW_DELETE_OPERATION",
            "description": "Enable DELETE and TRUNCATE queries (defaults to false)"
          },
          {
            "name": "ALLOW_DDL_OPERATION",
            "description": "Enable Data Definition Language queries like CREATE, ALTER, DROP, RENAME (defaults to false)"
          },
          {
            "name": "DB_SSL",
            "description": "Enable TLS for the MySQL connection (defaults to false)"
          },
          {
            "name": "DB_SSL_REJECT_UNAUTHORIZED",
            "description": "Reject self-signed or untrusted TLS certificates when DB_SSL is true (defaults to true)"
          }
        ]
      }
    ],
    "remotes": []
  },
  "dependencies": [],
  "installTargets": [
    "claude-code",
    "claude-desktop",
    "cursor",
    "vscode"
  ],
  "keywords": [],
  "provenance": {
    "origin": "official-mcp-registry",
    "originalId": "io.github.andezdev/tokenlite-mysql-mcp",
    "originalUrl": "https://registry.modelcontextprotocol.io/v0.1/servers/io.github.andezdev%2Ftokenlite-mysql-mcp/versions/latest",
    "isOfficial": true,
    "status": "active"
  }
}
tokenlite-mysql-mcp — MCP Server 安装与配置 · AgentHub