# Mysql Mcp Server

> A Model Context Protocol (MCP) server that enables secure interaction with MySQL databases

- **Type:** MCP server
- **Install:** `agentstack add mcp-he426100-mysql-mcp-server`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [he426100](https://agentstack.voostack.com/s/he426100)
- **Installs:** 0
- **Category:** [Databases](https://agentstack.voostack.com/c/databases)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [he426100](https://github.com/he426100)
- **Source:** https://github.com/he426100/mysql-mcp-server

## Install

```sh
agentstack add mcp-he426100-mysql-mcp-server
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# MySQL MCP Server

A Model Context Protocol (MCP) server that enables secure interaction with MySQL databases. This server allows AI assistants to list tables, read data, and execute SQL queries through a controlled interface, making database exploration and analysis safer and more structured.

## Features

- List available MySQL tables as resources
- Read table contents
- Execute SQL queries with proper error handling
- Secure database access through environment variables
- Comprehensive logging

## Installation

```bash
git clone https://github.com/he426100/mysql-mcp-server
cd mysql-mcp-server
composer install
```

## Configuration

Set the following environment variables:

```bash
DB_HOST=localhost     # Database host
DB_PORT=3306         # Optional: Database port (defaults to 3306 if not specified)
DB_USERNAME=your_username
DB_PASSWORD=your_password
DB_DATABASE=your_database
```

## Usage

### As a standalone server

```bash
# Install dependencies
composer install

# Run the server
php bin/console
```

### docker

```bash
docker build -t mysql-mcp-server .
docker run -i --rm mysql-mcp-server --host 127.0.0.1
```

## Security Considerations

- Never commit environment variables or credentials
- Use a database user with minimal required permissions
- Consider implementing query whitelisting for production use
- Monitor and log all database operations

## Security Best Practices

This MCP server requires database access to function. For security:

1. **Create a dedicated MySQL user** with minimal permissions
2. **Never use root credentials** or administrative accounts
3. **Restrict database access** to only necessary operations
4. **Enable logging** for audit purposes
5. **Regular security reviews** of database access

See [MySQL Security Configuration Guide](https://github.com/he426100/mysql-mcp-server/blob/main/SECURITY.md) for detailed instructions on:
- Creating a restricted MySQL user
- Setting appropriate permissions
- Monitoring database access
- Security best practices

⚠️ IMPORTANT: Always follow the principle of least privilege when configuring database access.

## Credits

[mysql_mcp_server](https://github.com/designcomputer/mysql_mcp_server/) .

## License

MIT License - see LICENSE file for details.

## Contributing

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [he426100](https://github.com/he426100)
- **Source:** [he426100/mysql-mcp-server](https://github.com/he426100/mysql-mcp-server)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-he426100-mysql-mcp-server
- Seller: https://agentstack.voostack.com/s/he426100
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
