Mysql MCP Server 9e7906f2

MCP数据服务

提供方 Lakshya-Saini

数据服务 未标注 无需鉴权 社区 / 第三方 ClaudeVS Code

一个安全且功能丰富的MySQL模型上下文协议(MCP)服务器,专为与Claude和VS Code GitHub Copilot等AI助手集成而设计。

一句话选型结论

按资料字段整理

Mysql MCP Server 9e7906f2 属于数据服务类 MCP 服务器,传输方式未标注,无需鉴权,可直接接入 Claude、VS Code,没有现成安装命令,需按官方文档接入。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类数据服务 传输方式未标注 鉴权无需鉴权 部署方式支持远程部署
GitHub 星标 0 仓库热度,无公开仓库时显示未标注
工具数 7 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

数据服务
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量7暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

MySQLTypeScript本地部署数据库管理AI集成安全协议开发工具

安装与配置

未标注 无需鉴权
上游未给出传输方式
  1. 1
    准备运行环境

    确认你的客户端支持远程端点,并拿到服务地址。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后客户端会列出约 7 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
数据库查询

用自然语言查库、取数,不用手写 SQL。

数据同步与清洗

把多来源数据拉到一处做整理。

报表取数

按口径快速拉出统计结果。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注 7 个工具,职责相对集中,接入后不容易误操作。
  • 已适配 Claude、VS Code,换客户端不用重新研究配置。
  • 资料标注无需鉴权,装好就能连。

先想清楚的地方

  • 远程端点依赖网络与服务方可用性,注意密钥与调用额度。
  • 没有现成安装命令,需要按官方文档自己填启动命令和参数。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在数据服务场景里让模型直接调用外部能力的人。
  • 已经在用 Claude、VS Code 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Mysql MCP Server 9e7906f2当前 7 未标注 支持远程部署 无 2026-05-17
Memory 9d25f64e 9 未标注 未标注 无 2026-05-17
Getzep MCP 9 stdio · 本地进程 本地部署 有 2026-05-17
anything-llm 未标注 stdio · 本地进程 本地部署 有 2026-04-11
Prisma MCP Server 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Astr Bot 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

数据服务
字段来自项目仓库与公开索引,中文说明由本站标注
提供方Lakshya-Saini上游标注的维护方 Lakshya-Saini
分类数据服务本站按上游分类展示
连接方式未标注上游未给出传输方式
鉴权方式无需鉴权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · 未标注本地安装时用到的包标识与运行时
部署类型支持远程部署上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

12.4 KB
来自项目仓库与上游目录的原文,未做删改

MySQL MCP Server

A secure, feature-rich MySQL Model Context Protocol (MCP) server designed for integration with AI assistants like Claude and VS Code GitHub Copilot.

Table of Contents

  • Features
  • Usage
  • With Visual Studio Code
  • With Claude Desktop
  • With Claude Code
  • With Gemini CLI
  • Within your project
  • Available Tools
  • Configuration Options
  • Database Configuration
  • Feature Configuration
  • Security Configuration
  • Logging Configuration
  • Security Features
  • Error Handling
  • Contributing
  • Support

Features

  • Security First: Built with security best practices, input validation, and configurable access controls
  • Configurable Operations: Enable/disable CRUD operations and table creation based on your needs (read operations enabled by default)
  • Tabular Data Display: Properly formatted responses for easy data visualization
  • Comprehensive Logging: Detailed logging for debugging and monitoring
  • Environment-Based Configuration: Easy setup using environment variables or configuration objects
  • NPM Package: Ready to use as a dependency in your projects

Usage

With Visual Studio Code

Add this to your .vscode/mcp.json:```json
{
"servers": {
"mysql": {
"command": "npx",
"args": ["@lakshya-mcp/mysql-mcp-server-claude"],
"env": {
"MYSQL_HOST": "{your_host}",
"MYSQL_PORT": "{your_port}",
"MYSQL_USER": "{your_username}",
"MYSQL_PASSWORD": "{your_password}",
"MYSQL_DATABASE": "{your_database}",
"MYSQL_ALLOW_CREATE": "false",
"MYSQL_ALLOW_UPDATE": "false",
"MYSQL_ALLOW_DELETE": "false",
"MYSQL_ALLOW_CREATE_TABLE": "false",
"MYSQL_READ_ONLY": "true" // Set to "true" for read-only mode; "false" allows writes.
}
}
}
}


### With Claude Desktop

Add this to your `claude_desktop_config.json`.
Follow these instructions to locate file.```json
{
  "mcpServers": {
    "mysql": {
      "command": "npx",
      "args": ["@lakshya-mcp/mysql-mcp-server-claude"],
      "env": {
        "MYSQL_HOST": "{your_host}",
        "MYSQL_PORT": "{your_port}",
        "MYSQL_USER": "{your_username}",
        "MYSQL_PASSWORD": "{your_password}",
        "MYSQL_DATABASE": "{your_database}",
        "MYSQL_ALLOW_CREATE": "false",
        "MYSQL_ALLOW_UPDATE": "false",
        "MYSQL_ALLOW_DELETE": "false",
        "MYSQL_ALLOW_CREATE_TABLE": "false",
        "MYSQL_READ_ONLY": "true" // Set to "true" for read-only mode; "false" allows writes.
      }
    }
  }
}

Save file and restart claude desktop. It should be visible under tools (check icon next to +).

With Claude Code

Open terminal and run this command:

For windows (without wsl):```bash
claude mcp add mysql -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=root -e MYSQL_PASSWORD={your_password} -e MYSQL_DATABASE={your_database} -e MYSQL_ALLOW_CREATE=false -e MYSQL_ALLOW_UPDATE=false -e MYSQL_ALLOW_DELETE=false -e MYSQL_ALLOW_CREATE_TABLE=false -e MYSQL_READ_ONLY=true -- cmd /c npx @lakshya-mcp/mysql-mcp-server-claude


For mac / windows (with wsl):```bash
claude mcp add mysql -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=root -e MYSQL_PASSWORD={your_password} -e MYSQL_DATABASE={your_database} -e MYSQL_ALLOW_CREATE=false -e MYSQL_ALLOW_UPDATE=false -e MYSQL_ALLOW_DELETE=false -e MYSQL_ALLOW_CREATE_TABLE=false -e MYSQL_READ_ONLY=true -- npx -y @lakshya-mcp/mysql-mcp-server-claude

Then type: claude and run /mcp. It should show:```
❯ 1. mysql ✔ connected · Enter to view details


### With Gemini CLI

Navigate to your home directory and look for a folder named `.gemini`.
Inside that folder, you will find the `settings.json` file.
Add this in your `.gemini/settings.json` file:```json
{
  "mcpServers": {
    "mysql": {
      "command": "npx",
      "args": ["@lakshya-mcp/mysql-mcp-server-claude"],
      "env": {
        "MYSQL_HOST": "{your_host}",
        "MYSQL_PORT": "{your_port}",
        "MYSQL_USER": "{your_username}",
        "MYSQL_PASSWORD": "{your_password}",
        "MYSQL_DATABASE": "{your_database}",
        "MYSQL_ALLOW_CREATE": "false",
        "MYSQL_ALLOW_UPDATE": "false",
        "MYSQL_ALLOW_DELETE": "false",
        "MYSQL_ALLOW_CREATE_TABLE": "false",
        "MYSQL_READ_ONLY": "true" // Set to "true" for read-only mode; "false" allows writes.
      }
    }
  }
}

Then restart gemini cli. You should be able to see mysql mcp server.
You can verify by running /mcp.

Within your project

  1. Install package```bash
    npm install -g @lakshya-mcp/mysql-mcp-server-claude

2. Create server and use```javascript
const { MySQLMCPServer } = require("@lakshya-mcp/mysql-mcp-server-claude");

// Using environment variables
const server = new MySQLMCPServer();
await server.start();

// Or with custom configuration
const server = new MySQLMCPServer({
  database: {
    host: "localhost",
    port: 3306,
    user: "username",
    password: "password",
    database: "mydb",
  },
  features: {
    fetch: true,
    create: false,
    update: false,
    delete: false,
    createTable: false,
  },
});

Available Tools

The MySQL MCP Server provides several powerful tools for database interaction. Each tool is designed with security in mind and includes proper input validation:

mysql_list_tables

Purpose: Lists all accessible tables in the database

  • Returns a comprehensive list of all tables you have access to
  • Useful for discovering the database structure
  • No parameters required
  • Respects table access controls if configured

mysql_describe_table

Purpose: Get detailed information about a table structure including columns, types, and constraints

  • Shows column names, data types, nullable status, and key information
  • Essential for understanding table schema before querying
  • Helps identify primary keys, foreign keys, and data constraints
  • Parameters:
  • table_name (string, required): Name of the table to describe

mysql_select_data

Purpose: Select data from a table with optional filtering and pagination

  • Flexible querying with support for filtering, sorting, and pagination
  • Returns data in a tabular format for easy visualization
  • Supports complex WHERE clauses for precise data retrieval
  • Built-in row limiting for performance and security
  • Parameters:
  • table_name (string, required): Name of the table to query
  • columns (array, optional): Specific columns to select (e.g., ["name", "email"])
  • where (string, optional): WHERE clause conditions (e.g., "age > 25 AND status = 'active'")
  • order_by (string, optional): ORDER BY clause (e.g., "name ASC" or "created_at DESC")
  • limit (number, optional): Maximum number of rows to return
  • offset (number, optional): Number of rows to skip for pagination

mysql_insert_data (if enabled)

Purpose: Insert new data into a table

  • Allows adding new records to the database
  • Only available when CREATE operations are enabled in configuration
  • Validates data against table schema before insertion
  • Supports batch inserts for efficiency
  • Parameters:
  • table_name (string, required): Name of the table to insert into
  • data (object, required): Data to insert as key-value pairs (e.g., {"name": "John", "age": 30})

mysql_update_data (if enabled)

Purpose: Update existing data in a table

  • Modifies existing records based on specified criteria
  • Only available when UPDATE operations are enabled in configuration
  • Requires WHERE clause to prevent accidental mass updates
  • Validates updated data against table constraints
  • Parameters:
  • table_name (string, required): Name of the table to update
  • data (object, required): Data to update as key-value pairs (e.g., {"status": "inactive"})
  • where (string, required): WHERE clause to identify rows to update (e.g., "id = 123")
  • where_params (array, optional): Parameters for parameterized WHERE clauses

mysql_delete_data (if enabled)

Purpose: Delete data from a table

  • Removes records from the database based on specified criteria
  • Only available when DELETE operations are enabled in configuration
  • Requires WHERE clause to prevent accidental mass deletions
  • Includes safety checks and confirmation prompts
  • Parameters:
  • table_name (string, required): Name of the table to delete from
  • where (string, required): WHERE clause to identify rows to delete (e.g., "status = 'expired'")
  • where_params (array, optional): Parameters for parameterized WHERE clauses

mysql_create_table (if enabled)

Purpose: Create new tables with specified columns and constraints

  • Allows creating new database tables with custom schema definitions
  • Only available when CREATE TABLE operations are enabled in configuration
  • Supports various column types, constraints, and table options
  • Includes safety features like IF NOT EXISTS option
  • Parameters:
  • table_name (string, required): Name of the table to create
  • columns (array, required): Array of column definitions with the following properties:
    • name (string, required): Column name
    • type (string, required): Column data type (e.g., "VARCHAR", "INT", "TEXT", "DATETIME")
    • length (number, optional): Column length for types that support it (e.g., VARCHAR(255))
    • nullable (boolean, optional): Whether the column can be NULL (default: true)
    • primaryKey (boolean, optional): Whether this column is part of the primary key (default: false)
    • autoIncrement (boolean, optional): Whether this column auto-increments (default: false)
    • unique (boolean, optional): Whether this column has a unique constraint (default: false)
    • defaultValue (any, optional): Default value for the column
  • if_not_exists (boolean, optional): Use CREATE TABLE IF NOT EXISTS to avoid errors if table exists (default: false)
  • engine (string, optional): Storage engine (e.g., "InnoDB", "MyISAM")
  • charset (string, optional): Character set (e.g., "utf8mb4")
  • collation (string, optional): Collation (e.g., "utf8mb4_unicode_ci")

Note: Write operations (INSERT, UPDATE, DELETE, CREATE TABLE) are disabled by default for security. Enable them only when necessary and ensure proper access controls are in place.

Configuration Options

Database Configuration```javascript

{
database: {
host: "localhost", // MySQL host
port: 3306, // MySQL port
user: "username", // MySQL username
password: "password", // MySQL password
database: "dbname", // Database name
ssl: false, // Enable SSL
connectionLimit: 10, // Connection pool limit
acquireTimeout: 60000 // Connection acquire timeout in ms
}
}


### Feature Configuration```javascript
{
  features: {
    fetch: true,        // Always enabled - read operations
    create: false,      // Enable INSERT operations
    update: false,      // Enable UPDATE operations
    delete: false,      // Enable DELETE operations
    createTable: false  // Enable CREATE TABLE operations
  }
}

Security Configuration```javascript

{
security: {
allowedTables: ["users", "products"], // Only allow these tables
blockedTables: ["admin", "secrets"], // Block these tables
maxRows: 1000, // Maximum rows per query
readOnly: true // Disable all write operations
}
}


### Logging Configuration```javascript
{
  logging: {
    level: "info",              // error, warn, info, debug
    file: "./mysql-mcp.log"     // Optional log file path
  }
}

Security Features

  • Input Validation: All inputs are validated using Joi schemas
  • SQL Injection Prevention: Uses parameterized queries exclusively
  • Table Access Control: Configurable allow/block lists for tables
  • Row Limiting: Configurable maximum rows per query
  • Read-Only Mode: Option to disable all write operations
  • Connection Pooling: Secure connection management with timeouts
  • Audit Logging: Comprehensive logging of all operations and security events

Error Handling

The server includes comprehensive error handling:

  • Database connection errors
  • Invalid SQL queries
  • Permission denied operations
  • Configuration validation errors
  • Runtime exceptions

All errors are logged with context and returned as structured responses.

Contributing

Contributions are welcome! Please ensure all security best practices are maintained and add appropriate tests for new features.

Support

For issues and questions, please create an issue in the GitHub repository.

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
Mysql MCP Server 9e7906f2 怎么安装?

资料没有给出安装命令,请到官方仓库或文档按说明接入;这类条目多数是生态应用,或尚未发布可安装包。

Mysql MCP Server 9e7906f2 怎么在 Claude、VS Code 里配置?

它的传输方式未标注,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

Mysql MCP Server 9e7906f2 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Mysql MCP Server 9e7906f2 需要 API Key 吗?

资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

Mysql MCP Server 9e7906f2 支持哪些客户端?

资料标注支持 Claude、VS Code;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

Mysql MCP Server 9e7906f2 能提供哪些能力?

资料显示约 7 个工具;能力标签包括 安全协议、开发工具、MySQL、Claude、数据分析。具体工具清单以官方文档为准。

Mysql MCP Server 9e7906f2 需要什么运行环境?

属于远程端点,不需要在本地装运行时。

Mysql MCP Server 9e7906f2 是本地还是远程?

它是远程端点,连服务地址即可。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。