mysql database.com
mysql database.com logo

MySQL Database

Integrates with MySQL databases to enable secure query execution, schema management, and CRUD operations for structured...

Created byApr 22, 2025

@enemyrr/mcp-mysql-server

A Model Context Protocol server that provides MySQL database operations. This server enables AI models to interact with MySQL databases through a standardized interface.
<a href="https://glama.ai/mcp/servers/hcqqd3qi8q"><img width="380" height="200" src="https://glama.ai/mcp/servers/hcqqd3qi8q/badge" alt="MCP-MySQL Server MCP server" /></a>

Installation & Setup for Cursor IDE

Installing via Smithery

To install MySQL Database Server for Claude Desktop automatically via Smithery:

Installing Manually

  1. Clone and build the project:
  1. Add the server in Cursor IDE settings:
Note: Replace /absolute/path/to/ with the actual path where you cloned and built the project.

Database Configuration

You can configure the database connection in three ways:
  1. Database URL in .env (Recommended):
  1. Individual Parameters in .env:
  1. Direct Connection via Tool:

Available Tools

1. connect_db

Connect to MySQL database using URL, workspace path, or direct credentials.

2. query

Execute SELECT queries with optional prepared statement parameters.

3. execute

Execute INSERT, UPDATE, or DELETE queries with optional prepared statement parameters.

4. list_tables

List all tables in the connected database.

5. describe_table

Get the structure of a specific table.

6. create_table

Create a new table with specified fields and indexes.

7. add_column

Add a new column to an existing table.

Features

  • Multiple connection methods (URL, workspace, direct)
  • Secure connection handling with automatic cleanup
  • Prepared statement support for query parameters
  • Schema management tools
  • Comprehensive error handling and validation
  • TypeScript support
  • Automatic workspace detection

Security

  • Uses prepared statements to prevent SQL injection
  • Supports secure password handling through environment variables
  • Validates queries before execution
  • Automatically closes connections when done

Error Handling

The server provides detailed error messages for:
  • Connection failures
  • Invalid queries or parameters
  • Missing configuration
  • Database errors
  • Schema validation errors

Contributing

Contributions are welcome! Please feel free to submit a Pull Request to https://github.com/enemyrr/mcp-mysql-server

License

MIT

@enemyrr/mcp-mysql-server

A Model Context Protocol server that provides MySQL database operations. This server enables AI models to interact with MySQL databases through a standardized interface.
<a href="https://glama.ai/mcp/servers/hcqqd3qi8q"><img width="380" height="200" src="https://glama.ai/mcp/servers/hcqqd3qi8q/badge" alt="MCP-MySQL Server MCP server" /></a>

Installation & Setup for Cursor IDE

Installing via Smithery

To install MySQL Database Server for Claude Desktop automatically via Smithery:

Installing Manually

  1. Clone and build the project:
  1. Add the server in Cursor IDE settings:
Note: Replace /absolute/path/to/ with the actual path where you cloned and built the project.

Database Configuration

You can configure the database connection in three ways:
  1. Database URL in .env (Recommended):
  1. Individual Parameters in .env:
  1. Direct Connection via Tool:

Available Tools

1. connect_db

Connect to MySQL database using URL, workspace path, or direct credentials.

2. query

Execute SELECT queries with optional prepared statement parameters.

3. execute

Execute INSERT, UPDATE, or DELETE queries with optional prepared statement parameters.

4. list_tables

List all tables in the connected database.

5. describe_table

Get the structure of a specific table.

6. create_table

Create a new table with specified fields and indexes.

7. add_column

Add a new column to an existing table.

Features

  • Multiple connection methods (URL, workspace, direct)
  • Secure connection handling with automatic cleanup
  • Prepared statement support for query parameters
  • Schema management tools
  • Comprehensive error handling and validation
  • TypeScript support
  • Automatic workspace detection

Security

  • Uses prepared statements to prevent SQL injection
  • Supports secure password handling through environment variables
  • Validates queries before execution
  • Automatically closes connections when done

Error Handling

The server provides detailed error messages for:
  • Connection failures
  • Invalid queries or parameters
  • Missing configuration
  • Database errors
  • Schema validation errors

Contributing

Contributions are welcome! Please feel free to submit a Pull Request to https://github.com/enemyrr/mcp-mysql-server

License

MIT