MCP MySQL Lens

MySQL MCP server for executing commands from MCP Clients
  • javascript

0

GitHub Stars

javascript

Language

7 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "himanshu-agg12-mcp-mysql-lens": {
      "command": "npx",
      "args": [
        "mcp-mysql-lens"
      ],
      "env": {
        "MYSQL_HOST": "<YOUR_MYSQL_HOST>",
        "MYSQL_PORT": "<YOUR_MYSQL_PORT>",
        "MYSQL_USER": "<YOUR_MYSQL_USERNAME>",
        "MYSQL_DATABASE": "<YOUR_MYSQL_DEFAULT_DB>",
        "MYSQL_PASSWORD": "<YOUR_MYSQL_PASSWORD>"
      }
    }
  }
}

This MCP server lets Claude Desktop connect to your MySQL databases so you can query, inspect schemas, and analyze data using natural language. It brings SQL capabilities into Claude workflows with built‑in safeguards and a straightforward setup.

How to use

You install and run a local MCP server for MySQL, then configure Claude Desktop to communicate with it. Once configured, you can ask Claude to show tables, describe schemas, run read‑only queries, and analyze data patterns across your databases. Use natural language prompts like asking for top products by sales, or to describe the structure of a specific table. Claude will translate your requests into SQL, execute them through the MCP server, and return the results in an actionable format.

How to install

Prerequisites: you need Node.js (v16 or higher) and a MySQL server (v5.7 or higher). You also need Claude Desktop installed and valid MySQL credentials with appropriate permissions.

npm install -g mcp-mysql-lens

Configuration and usage notes

Configure Claude Desktop to run the MCP server locally using the following setup. This starts the MCP client that launches the MySQL lens tool and passes your MySQL connection details via environment variables.

{
  "mcpServers": {
    "mysql": {
      "command": "npx",
      "args": [
        "mcp-mysql-lens"
      ],
      "env": {
        "MYSQL_HOST": "<YOUR_MYSQL_HOST>",
        "MYSQL_PORT": "<YOUR_MYSQL_PORT>",
        "MYSQL_USER": "<YOUR_MYSQL_USERNAME>",
        "MYSQL_PASSWORD": "<YOUR_MYSQL_PASSWORD>",
        "MYSQL_DATABASE": "<YOUR_MYSQL_DEFAULT_DB>"
      }
    }
  }
}

Security considerations

Follow best practices to protect your data. Prefer read‑only credentials for analysis, avoid exposing credentials in version control, and use environment variable substitutions for production. Ensure encryption for remote connections and monitor access logs regularly.

Troubleshooting

If you cannot connect to MySQL, verify the server is running, host and port values, and that your credentials have the right permissions. Check firewall rules and ensure the Claude Desktop config is in the correct location. Review logs for errors after restarting Claude Desktop.

Notes on capabilities and limitations

This MCP server supports read‑only data access for analysis and exploration. Write operations are not supported through Claude Desktop via this server. Large result sets may be truncated, and long queries may time out depending on your MySQL server settings.

Available tools

query

Execute SQL queries against the connected MySQL database and return results.

inspect_schema

Inspect database schemas, list tables and columns, and describe relationships.

analyze_data

Analyze data patterns, run aggregate queries, and visualize insights from results.

safeguards

Built‑in safeguards to prevent potentially destructive operations and limit write access.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational