Allows querying and accessing MySQL databases, supporting SQL query execution and table structure examination on configured MySQL connections
Enables SQL query execution and database management for PostgreSQL databases through configured connections
Provides access to SQLite databases, allowing SQL queries and database structure exploration through configured connections
MCPDB - Database Access MCP Server
MCPDB is a Laravel-based MCP (Model Context Protocol) server that provides Claude Desktop with secure access to multiple database connections. Through a web-based management interface, you can configure database connections and then query them directly from Claude Desktop using natural language.
Features
- Multi-Database Support: Connect to MySQL, PostgreSQL, SQLite, and SQL Server databases
- Web Management Interface: Easy-to-use web UI for managing database connections
- MCP Integration: Seamlessly integrates with Claude Desktop via the Model Context Protocol
- Secure Connection Management: Store and manage database credentials securely
- SQL Query Execution: Execute SQL queries directly from Claude Desktop conversations
Prerequisites
- Docker and Docker Compose (for Laravel Sail)
- Node.js and npm (for frontend assets)
- Claude Desktop application
Installation
1. Clone and Setup the Project
2. Start the Laravel Application
The application will be available at http://localhost:8000
3. Configure Database Connections
- Open http://localhost:8000 in your browser
- Click "Add Connection" to create database connections
- Fill in the connection details:
- Connection Name: Unique identifier (e.g., "my_production_db")
- Driver: mysql, pgsql, sqlite, or sqlsrv
- Host: Database host address
- Port: Database port (optional, uses default if empty)
- Database: Database name
- Username: Database username
- Password: Database password
- Description: Optional description
- Test the connection to ensure it works
- Make sure "Active" is checked
4. Configure Claude Desktop
Create or edit the Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Add the following configuration:
5. Install mcp-remote (if not already installed)
6. Restart Claude Desktop
Completely quit and restart Claude Desktop for the configuration to take effect.
Usage
Once configured, you can interact with your databases directly through Claude Desktop:
List Available Connections
Execute SQL Queries
Available MCP Tools
The server provides two main tools:
- list_connections: Lists all active database connections
- execute_sql: Executes SQL queries on specified connections
Development
Project Structure
app/Models/SubjectConnection.php
- Database connection modelapp/Http/Controllers/ConnectionController.php
- Web interface for managing connectionsapp/Http/Controllers/McpController.php
- MCP server implementationresources/views/connections/
- Web interface viewsdatabase/migrations/
- Database schema migrations
Running Tests
Code Formatting
Security Considerations
- Database passwords are stored in the application database
- Only active connections are exposed to the MCP server
- SQL queries are executed with the permissions of the configured database user
- Consider using read-only database users for security
- The MCP server runs on localhost only by default
Troubleshooting
MCP Server Not Connecting
- Ensure Laravel server is running:
./vendor/bin/sail up -d
- Check MCP server health:
curl http://localhost:8000/health
- Verify Claude Desktop configuration file syntax
- Check Claude Desktop logs:
~/Library/Logs/Claude/
Database Connection Failures
- Test connections in the web interface: http://localhost:8000
- Verify database credentials and network access
- Check if database user has appropriate permissions
- For remote databases, ensure firewall allows connections
Asset Loading Issues
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and ensure code formatting
- Submit a pull request
License
This project is open-sourced software licensed under the MIT license.
This server cannot be installed
Provides Claude Desktop with secure access to multiple database connections, allowing users to query MySQL, PostgreSQL, SQLite, and SQL Server databases directly through natural language.
Related MCP Servers
- -securityAlicense-qualityConnects Claude Desktop directly to databases, allowing it to explore database structures, write SQL queries, analyze datasets, and create reports through an API layer with tools for table exploration and query execution.Last updated -210PythonMozilla Public License 2.0
- -securityFlicense-qualityA server that enables interaction with PostgreSQL, MySQL, MariaDB, or SQLite databases through Claude Desktop using natural language queries.Last updated -Python
- -securityFlicense-qualityA natural language interface that allows Claude to execute SQL queries on your local MySQL databases, enabling database interaction using natural language.Last updated -2Python
- -securityAlicense-qualityAn MCP server that enables MySQL database integration with Claude. You can execute SQL queries and manage database connections.Last updated -1PythonMIT License