# Quick Start Guide
Get started with MariaDB MCP Server in 5 minutes!
## Prerequisites
- **Python 3.8+**
- **MariaDB** server running and accessible
- **Claude Desktop** installed
## Automated Setup (Recommended)
### macOS/Linux
```bash
# Clone or download the repository
cd mariadb_mcp_server
# Run the setup script
./setup.sh
# Edit config.json with your database credentials
nano config.json # or use any text editor
# Copy config to Claude Desktop
cp config.json ~/Library/Application\ Support/Claude/claude_desktop_config.json
# Restart Claude Desktop
```
The setup script will:
- Install MariaDB Connector/C (via Homebrew)
- Create a virtual environment
- Install all Python dependencies
- Generate config.json with absolute paths
## Manual Setup
### 1. Install MariaDB Connector/C
**macOS:**
```bash
brew install mariadb-connector-c
export MARIADB_CONFIG=$(brew --prefix mariadb-connector-c)/bin/mariadb_config
```
**Ubuntu/Debian:**
```bash
sudo apt-get update
sudo apt-get install libmariadb-dev
```
**RHEL/CentOS:**
```bash
sudo yum install mariadb-connector-c-devel
```
### 2. Set Up Virtual Environment
```bash
# Create virtual environment
python3 -m venv venv
# Activate it
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
```
### 3. Configure Database Connection
Create `config.json` from the example:
```bash
cp config.example.json config.json
```
Edit `config.json` and update:
- `command`: Full path to your venv Python (e.g., `/absolute/path/to/project/venv/bin/python`)
- `args`: Full path to `mariadb_mcp_server.py`
- `MARIADB_HOST`: Use `127.0.0.1` (not `localhost`) to force TCP connection
- `MARIADB_PASSWORD`: Your database password
- Other connection settings as needed
Example config.json:
```json
{
"mcpServers": {
"mariadb": {
"command": "/absolute/path/to/mariadb_mcp_server/venv/bin/python",
"args": ["/absolute/path/to/mariadb_mcp_server/mariadb_mcp_server.py"],
"env": {
"MARIADB_HOST": "127.0.0.1",
"MARIADB_PORT": "3306",
"MARIADB_USER": "root",
"MARIADB_PASSWORD": "your_password",
"MARIADB_DATABASE": "",
"MARIADB_READ_ONLY": "false",
"MARIADB_POOL_SIZE": "5"
}
}
}
}
```
### 4. Install in Claude Desktop
**macOS:**
```bash
cp config.json ~/Library/Application\ Support/Claude/claude_desktop_config.json
```
**Windows:**
```bash
copy config.json %APPDATA%\Claude\claude_desktop_config.json
```
**Linux:**
```bash
cp config.json ~/.config/Claude/claude_desktop_config.json
```
### 5. Restart Claude Desktop
Quit and restart Claude Desktop for the changes to take effect.
## 💬 Example Usage in Claude
Once configured, you can ask Claude things like:
- "What databases do I have?"
- "Show me all tables in the sales database"
- "What's the schema of the customers table?"
- "Find the top 10 customers by revenue"
- "How large is my analytics database?"
- "Run a query to find orders from last month"
## 🔒 Security Notes
- The server runs in **read-only mode** by default
- To enable write queries, set `MARIADB_READ_ONLY="false"`
- Always use a dedicated database user with appropriate permissions
- Consider using read-only users for production databases
## 📚 Need More Help?
- Check the full **README.md** for detailed documentation
- Review **config_examples.md** for different deployment scenarios
- Run **test_connection.py** to troubleshoot connection issues
## 🎉 You're All Set!
Your MariaDB MCP server is ready to use. Just complete the setup steps above and Claude will be able to interact with your MariaDB databases intelligently and securely!
---
*Created with the MCP Builder skill following best practices for production-ready MCP servers*