junko5/laravel-safe-migration
Composer 安装命令:
composer require junko5/laravel-safe-migration
包简介
MCP server for safe Laravel database migrations with confirmation prompts
README 文档
README
⚠️ Beta Version / β版
Laravelデータベースマイグレーション安全実行MCPサーバー。Claude Code/Cursor用。 MCP server for safe Laravel database migrations with confirmation prompts for Claude Code/Cursor.
📺 Demo / デモ
こちらの動画でインストール方法・使い方ご紹介しています。
🎥 Watch Full Demo Video (Vimeo)
📖 日本語ドキュメント
概要
AIエージェントがデータベースマイグレーションを実行する際に、データ損失を防ぐためのMCPサーバーです。 破壊的な操作を行う前に、データベースの影響を分析し、ユーザー確認を要求します。
インストール方法
1. Composerでインストール
composer require junko5/laravel-safe-migration:dev-main
2. MCPクライアントの設定
Claude Code
claude mcp add safe-migration --scope local -- php artisan mcp:start safe-migration
Cursor
.cursor/mcp.jsonに追加:
{
"mcpServers": {
"safe-migration": {
"type": "stdio",
"command": "php",
"args": [
"{your-laravel-project-path}/artisan",
"mcp:start",
"safe-migration"
]
}
}
}
パスについて注意:
{your-laravel-project-path}は、Laravelプロジェクトの絶対パスに置き換えてください(pwdコマンドで確認できます)。 例:C:/Users/username/Documents/laravel-project/artisanバックスラッシュ(
\)はスラッシュ(/)に置き換えてください。
phpについて注意:
phpコマンドがPATHに登録されていない場合(XAMPPなど)は、フルパスを指定してください:Claude Code:
claude mcp add safe-migration --scope local -- C:/xampp/php/php.exe artisan mcp:start safe-migrationCursor:
"command": "C:/xampp/php/php.exe"
使い方
MCPサーバーは以下のコマンドを自動的に監視します:
php artisan migrate:rollbackphp artisan migrate:resetphp artisan migrate:freshphp artisan db:wipe
AIエージェントがこれらのコマンドを実行しようとすると、以下の処理が行われます:
- データベースへの影響(テーブルとレコード数)を確認
- データ損失がある場合に警告
- 明示的な確認を要求
動作環境
- PHP ^8.2
- Laravel ^12.28.1以上
テスト済み環境
- AIクライアント: Claude Code, Cursor
- データベース: SQLite, MySQL (phpMyAdmin)
その他のAIクライアントやデータベースでも動作する可能性がありますが、まだテストしていません。
ライセンス
MIT
📖 English Documentation
Overview
MCP server that prevents data loss when AI agents execute database migrations. Analyzes database impact before destructive operations and requires user confirmation.
Installation
1. Install via Composer
composer require junko5/laravel-safe-migration:dev-main
2. Configure MCP Client
Claude Code
claude mcp add safe-migration --scope local -- php artisan mcp:start safe-migration
Cursor
Add to .cursor/mcp.json:
{
"mcpServers": {
"safe-migration": {
"type": "stdio",
"command": "php",
"args": [
"{your-laravel-project-path}/artisan",
"mcp:start",
"safe-migration"
]
}
}
}
Note: Replace
{your-laravel-project-path}with the absolute path to your Laravel project (usepwdcommand to get the path). Example:C:/Users/username/Documents/laravel-project/artisanReplace backslashes (
\) with forward slashes (/).
Note: If
phpis not in your PATH (e.g., XAMPP), specify the full path:Claude Code:
claude mcp add safe-migration --scope local -- C:/xampp/php/php.exe artisan mcp:start safe-migrationCursor:
"command": "C:/xampp/php/php.exe"
Usage
The MCP server automatically monitors the following commands:
php artisan migrate:rollbackphp artisan migrate:resetphp artisan migrate:freshphp artisan db:wipe
When AI agents attempt to run these commands, they will:
- Check database impact (tables and records)
- Warn about data loss if applicable
- Request explicit confirmation from you
Requirements
- PHP ^8.2
- Laravel ^12.28.1+
Tested Environments
- AI Client: Claude Code, Cursor
- Database: SQLite, MySQL (phpMyAdmin)
Other AI clients and databases may work but have not been tested yet.
License
MIT
junko5/laravel-safe-migration 适用场景与选型建议
junko5/laravel-safe-migration 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 10 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「database」 「migration」 「laravel」 「safety」 「mcp」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 junko5/laravel-safe-migration 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 junko5/laravel-safe-migration 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 junko5/laravel-safe-migration 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Dibi is Database Abstraction Library for PHP
Store your language lines in the database, yaml or other sources
A package for automatically encrypting and decrypting Eloquent attributes in Laravel 5.5+, based on configuration settings.
Lets you add foreign keys in a swift! Foreign key adder in laravel migration.
A PSR-7 compatible library for making CRUD API endpoints
Manage PostgreSQL schemas in Laravel applications
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-05
