Django Migrations MCP Service
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Integrations
Manages Django database migrations in distributed environments by wrapping Django's migration commands as MCP endpoints, providing functionality to check migration status, create new migrations, and apply migrations with additional validation and safety checks.
Provides containerized deployment options with various configurations for running the MCP service, including development, testing, and production environments with appropriate network setups.
Enables CI/CD pipeline integration for automating migration checks on pull requests, particularly when model or migration files are modified.
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:
- Show Migrations
- Make Migrations
- Apply Migrations
This server cannot be installed
A Model Context Protocol service that wraps Django's migration commands as MCP endpoints, making it easy to manage migrations across multiple services and integrate with CI/CD pipelines.