dorangao
MCP Serverdorangaopublic

migrasure

MigraSure is designed to help developers and database administrators ensure that their database migrations are successful and that the data integrity is maintained across different database systems.

Repository Info

1
Stars
0
Forks
1
Watchers
0
Issues
Python
Language
Other
License

About This Server

MigraSure is designed to help developers and database administrators ensure that their database migrations are successful and that the data integrity is maintained across different database systems.

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

Database Migration Validator (MigraSure)

MigraSure is designed to help developers and database administrators ensure that their database migrations are successful and that the data integrity is maintained across different database systems.

A system that uses AI agents to validate database migrations from SQL Server to PostgreSQL by comparing schemas, row counts, and data consistency.

System Overview

This project contains a Docker-based environment that:

  1. Runs a SQL Server source database with sample data
  2. Runs a PostgreSQL target database that mirrors the schema
  3. Connects both databases to DBHub MCP servers (database connectors)
  4. Provides a Flask web interface for running AI-powered migration validation

The system uses OpenAI or Google Gemini models through the agents framework to intelligently compare databases, detect inconsistencies, and produce a detailed validation report.

Prerequisites

  • Docker and Docker Compose
  • OpenAI API key (for OpenAI models)
  • Google Gemini API key (optional, for Gemini models)

Setup Instructions

  1. Clone this repository

  2. Set environment variables

    Create a .env file in the project root with:

    OPENAI_API_KEY=your_openai_api_key
    GEMINI_API_KEY=your_gemini_api_key
    
  3. Build and start the containers

    docker-compose up -d
    

    This will:

    • Start SQL Server with sample data
    • Start PostgreSQL with mirrored schema
    • Start DBHub connectors for both databases
    • Build and start the validation agent
  4. Access the web interface

    Open your browser and navigate to:

    http://localhost:5005
    

Usage

  1. On the web interface, select an AI model from the dropdown:

    • OpenAI models (GPT-4.1-mini, GPT-4.1-nano)
    • Google Gemini models (via LiteLLM)
  2. Click "Run Validation" to start the validation process

  3. The system will:

    • Connect to both databases
    • Compare table schemas
    • Compare row counts
    • Check data consistency
    • Generate an HTML report with findings
  4. Review the validation results showing tables that matched or had discrepancies

  5. Click the "View Execution Trace" link to see detailed agent execution steps

Troubleshooting

Dependency Conflicts

If you encounter dependency conflicts between openai-agents and litellm, update your requirements.txt:

openai-agents==0.0.14
openai>=1.76.0,<1.78.0
Flask~=2.3.3
litellm>=1.70.0

Database Connection Issues

Ensure Docker containers are running properly:

docker ps

Check logs for specific services:

docker logs sqlserver
docker logs postgres
docker logs dbhub_source
docker logs dbhub_target
docker logs agent

Components

  • SQL Server: Source database with sample ecommerce data
  • PostgreSQL: Target database with migrated schema
  • DBHub MCP Servers: Database connectors with REST API interfaces
  • Agent Service: Flask app with OpenAI/Gemini integration for validation

Architecture

!Architecture Diagram

The agent accesses both databases through their respective DBHub MCP servers, which provide a consistent interface regardless of the underlying database technology.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Quick Start

1

Clone the repository

git clone https://github.com/dorangao/migrasure
2

Install dependencies

cd migrasure
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerdorangao
Repomigrasure
LanguagePython
LicenseOther
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation