Download the PHP package momodemo333/php-mcp-mysql without Composer
On this page you can find all versions of the php package momodemo333/php-mcp-mysql. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download momodemo333/php-mcp-mysql
More information about momodemo333/php-mcp-mysql
Files in momodemo333/php-mcp-mysql
Package php-mcp-mysql
Short Description MySQL MCP Server for Claude Code - Secure and configurable MySQL integration via Model Context Protocol
License MIT
Homepage https://github.com/momodemo333/php-mcp-mysql
Informations about the package php-mcp-mysql
๐๏ธ PHP MCP MySQL Server
MySQL MCP Server for Claude Code - Secure and configurable MySQL integration via Model Context Protocol.
๐ Acknowledgments
This project is built on top of the excellent php-mcp/server library. Special thanks to the MCP community for providing the foundation that makes this integration possible.
๐ Quick Installation
Via Composer (Recommended)
Claude Code Configuration
Add to your .cursor/mcp.json
:
Quick Test
๐ That's it! Your MySQL MCP Server is ready!
โจ Features
๐ ๏ธ Available MCP Tools
mysql_list_databases
- List all databasesmysql_list_tables
- List tables in a databasemysql_describe_table
- Describe table structure (columns, indexes, foreign keys)mysql_server_status
- Get MySQL server status and healthmysql_select
- Execute secure SELECT queriesmysql_insert
- Insert data with validationmysql_update
- Update data with mandatory conditionsmysql_delete
- Delete data with safety limitsmysql_execute_query
- Execute custom SQL queries
๐ Security Features
- SQL Injection Protection - All queries use prepared statements
- Operation Permissions - Granular control (INSERT, UPDATE, DELETE)
- Query Validation - Dangerous keyword blocking
- Connection Pooling - Efficient resource management
- Result Limiting - Configurable result set limits
- Schema Restrictions - Limit access to specific databases
โ๏ธ Configuration Options
Environment Variables:
MYSQL_HOST
,MYSQL_PORT
,MYSQL_USER
,MYSQL_PASS
,MYSQL_DB
ALLOW_INSERT_OPERATION
,ALLOW_UPDATE_OPERATION
,ALLOW_DELETE_OPERATION
ALLOW_DDL_OPERATIONS
โญ - New! Authorize CREATE, ALTER, DROP operationsALLOW_ALL_OPERATIONS
โญ - New! Super admin mode (use with caution)MAX_RESULTS
,QUERY_TIMEOUT
,LOG_LEVEL
CONNECTION_POOL_SIZE
,ENABLE_PREPARED_STATEMENTS
Configuration Methods:
- Environment Variables (via MCP config)
.env
Files (per project)- CLI Arguments (for testing)
๐ Documentation
๐ Complete Guides
- Quick Start - Get running in 5 minutes
- MCP Configuration - Understanding MCP transports (
stdio
,http
,websocket
) - Installation Guide - Detailed setup instructions
- MCP Tools Reference - Complete tool documentation
- Usage Examples - Practical examples
- Multi-Project Setup - Configure for multiple projects
- Troubleshooting - Common issues and solutions
๐ง Configuration Examples
Simple Configuration:
๐ก MCP Transport Types: The
"type": "stdio"
parameter specifies the communication method between your MCP client and the server. See MCP Configuration Guide for complete details onstdio
,http
, andwebsocket
transports.
Multi-Environment Configuration:
๐ก๏ธ Security & Best Practices
๐ Security Recommendations
-
Use Read-Only Users in Production
-
Limit Database Access
-
Set Result Limits
- Use Environment Variables for Passwords
๐ DDL Permissions (v1.1.0+)
Three-level permission system:
-
Level 1 - CRUD Operations:
-
Level 2 - Schema Operations (NEW!):
- Level 3 - Super Admin (NEW!):
Example - Enable schema modifications:
โ Production Checklist
- [ ] Use dedicated MySQL user with minimal permissions
- [ ] Set
ALLOW_*_OPERATION=false
for production (except SELECT) - [ ] Carefully consider
ALLOW_DDL_OPERATIONS=false
in production โ ๏ธ - [ ] Never use
ALLOW_ALL_OPERATIONS=true
in production โ - [ ] Configure
MAX_RESULTS
andQUERY_TIMEOUT
- [ ] Use
LOG_LEVEL=ERROR
in production - [ ] Restrict
ALLOWED_SCHEMAS
to necessary databases - [ ] Store passwords securely (environment variables)
- [ ] Enable
BLOCK_DANGEROUS_KEYWORDS=true
๐งช Development & Testing
๐ New Test Suite (v1.1.0+)
Professional testing infrastructure with Docker:
Test Coverage:
- ๐งช 29+ tests (unit + integration)
- ๐ฏ >90% coverage of critical services
- ๐ณ Automated Docker MySQL environment
- ๐ CI/CD ready with GitHub Actions
Documentation:
- ๐ Complete Testing Guide
- ๐ Quick Testing README
Legacy Testing
Development Setup
๐ Usage with Claude Code
Natural Language Examples
Database Exploration:
Data Analysis:
Business Intelligence:
Data Management:
๐ค Contributing
Contributions are welcome! Please read our contributing guidelines and:
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to branch:
git push origin feature/amazing-feature
- Open a Pull Request
Development Guidelines
- Follow PSR-12 coding standards
- Add tests for new features
- Update documentation
- Ensure security best practices
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License Summary:
- โ Commercial use
- โ Modification
- โ Distribution
- โ Private use
- โ Liability
- โ Warranty
๐ Support
- ๐ Documentation: docs/
- ๐ Issues: GitHub Issues
- ๐ก Feature Requests: GitHub Discussions
๐ฏ Roadmap
- [ ] PostgreSQL support
- [ ] Advanced query caching
- [ ] Connection encryption (SSL/TLS)
- [ ] Query performance analytics
- [ ] Multi-database connection management
- [ ] GraphQL-style query building
Made with โค๏ธ for the Claude Code community
Powered by php-mcp/server