Integrates Django migrations across distributed services, enabling coordinated database schema changes and enhanced migr...
Created byApr 23, 2025
Django Migrations MCP Service
A Model Context Protocol (MCP) service for managing Django migrations in distributed environments. This service wraps Django's migration commands and exposes them as MCP endpoints, making it easy to manage migrations across multiple services and integrate with CI/CD pipelines.
Features
Check migration status (equivalent to `showmigrations`)
Create new migrations with validation (equivalent to `makemigrations`)
Apply migrations with safety checks (equivalent to `migrate`)
Additional validation and safety checks:
- Sequential migration order verification
- Conflict detection
- Dependency validation
- Safety analysis of migration operations
Installation
Local Development
Clone the repository:
Install dependencies:
Configuration
Set the following environment variables:
Usage
Running the Service
Directly with Python:
Using Docker:
MCP Endpoints
Show Migrations:
Make Migrations:
Apply Migrations:
CI/CD Integration
Example GitHub Actions workflow:
Example check_migrations.py script:
Development
Running Tests
Code Style
The project follows PEP 8 guidelines. Format your code using:
License
MIT License. See LICENSE file for details.
Contributing
Fork the repository
Create your feature branch (`git checkout -b feature/amazing-feature`)
Commit your changes (`git commit -m 'Add amazing feature'`)
Push to the branch (`git push origin feature/amazing-feature`)
Open a Pull Request
Docker Usage
The project includes a `docker-commands.json` file that provides structured commands for different deployment scenarios. You can use these commands directly or parse them in your scripts.
Available Docker Configurations
**Redis MCP Server**
**Django Migrations MCP Server**
**Development Environment**
**Testing Environment**
**Production Environment**
Using the Commands Programmatically
You can parse and use the commands programmatically:
Network Setup
**Development Network**
**Production Network**
Using MCP Tools
The service exposes several endpoints that can be accessed via curl or any HTTP client: