Test Case Data Creator MCP
Allows loading sample data from MySQL databases through a database connection string for analysis and synthetic data generation.
Allows loading sample data from PostgreSQL databases through a database connection string for analysis and synthetic data generation.
Allows loading sample data from SQLite databases through a database connection string for analysis and synthetic data generation.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Test Case Data Creator MCP
A Model Context Protocol (MCP) server for generating realistic synthetic test data using the Synthetic Data Vault (SDV) library. This tool helps AI coding assistants like Claude generate high-quality, realistic test cases instead of relying on simple random data generation.
Overview
When developers use AI for creating automated tests, they often rely on the LLM to produce both the test code and test data. However, LLMs may not generate realistic synthetic data that properly represents real-world distributions and relationships. This MCP server solves that problem by providing specialized tools for creating intricate, statistically sound test data.
Related MCP server: Faker MCP Server
Features
Multiple Data Sources: Load sample data from files (CSV, JSON, Parquet), inline JSON, or database connections
Advanced Synthesizers:
GaussianCopula: Fast, suitable for most tabular data
TVAE: Deep learning-based, handles complex distributions and mixed data types
Advanced Constraints:
Basic: min/max ranges, unique values, categorical constraints
Relationships: Column inequalities (e.g., start_date < end_date)
Custom formulas: Define calculated columns (e.g., total = quantity * price)
Conditional constraints: Rules that apply based on other column values
Cross-column dependencies: Maintain realistic combinations
Comprehensive Quality Validation:
Schema validation
Statistical similarity metrics
Correlation preservation
Privacy metrics (nearest neighbor distance)
Diversity scoring
Overall quality scores with SDMetrics
Safety Limits: Built-in data size limits to prevent resource exhaustion
File Output: Generated data written to files (CSV, JSON, Parquet) with quality reports
Installation
Prerequisites
Python 3.10 or higher
pip or uv package manager
Install from source
# Clone the repository
git clone https://github.com/radurobu/tc-data-creator-mcp.git
cd tc-data-creator-mcp
# Install dependencies
pip install -r requirements.txt
# Or install in development mode
pip install -e .Install from GitHub (without cloning)
pip install git+https://github.com/radurobu/tc-data-creator-mcp.gitConfigure MCP
1. Clone and install
git clone https://github.com/radurobu/tc-data-creator-mcp.git
cd tc-data-creator-mcp
pip install -e .2. Copy the MCP config to their project or use globally
The .mcp.json now works on Windows, macOS, and Linux without modification.
{
"mcpServers": {
"tc-data-creator": {
"command": "python",
"args": ["-m", "tc_data_creator_mcp.server"]
}
}
}MCP Tools
1. analyze_sample_data
Analyze sample data to understand structure, types, and statistics. Provides recommendations for synthesizer selection and constraints.
Parameters:
file_path(optional): Path to data file (CSV, JSON, Parquet)inline_data(optional): JSON string with array of objectsdb_connection(optional): Database connection stringtable_name(optional): Table name (required with db_connection)
Returns:
Row count, column count, data size
Column-by-column analysis with types, statistics, null percentages
Suggested constraints for each column
Synthesizer recommendation
Example:
{
"file_path": "./sample_data/users.csv"
}2. generate_synthetic_data
Generate realistic synthetic test data using SDV synthesizers.
Parameters:
file_path/inline_data/db_connection+table_name: Data source (one required)synthesizer: Type of synthesizer ("gaussian_copula" or "tvae", default: "gaussian_copula")num_rows: Number of synthetic rows to generate (required)constraints: Advanced constraints object (optional)output_format: Output format ("csv", "json", "parquet", default: "csv")output_path: Custom output path (optional, defaults to ./synthetic_output/)
Returns:
Path to generated data file
Number of rows and columns generated
Quality score and detailed quality report
Warnings (if any)
Generation time
Example:
{
"file_path": "./sample_data/users.csv",
"synthesizer": "gaussian_copula",
"num_rows": 1000,
"constraints": {
"age": {"min": 18, "max": 100},
"email": {"unique": true},
"relationships": [
{
"type": "inequality",
"low_column": "start_date",
"high_column": "end_date"
}
]
},
"output_format": "csv"
}3. validate_synthetic_quality
Validate quality of synthetic data by comparing with original data.
Parameters:
original_data_path: Path to original/sample datasynthetic_data_path: Path to synthetic datametadata(optional): Metadata about columns and constraints
Returns:
Overall quality score (0-1)
Detailed metrics:
Schema validation results
Statistical comparison
Column-wise quality scores
Correlation analysis
Privacy and diversity scores
Warnings and recommendations
Usage Examples
Basic Usage with Claude
User: I need realistic test data for a users table. Here's a sample CSV with 20 rows.
Claude: Let me first analyze your sample data.
[Calls analyze_sample_data with the file path]
Based on the analysis, I'll generate 1000 rows of synthetic data using GaussianCopula.
[Calls generate_synthetic_data]
Generated synthetic data saved to: ./synthetic_output/synthetic_20260103_143022.csv
Quality score: 0.87 (Good)Advanced Constraints Example
# Generate user data with complex constraints
{
"file_path": "./users.csv",
"num_rows": 5000,
"constraints": {
"age": {"min": 18, "max": 65},
"email": {"unique": true},
"balance": {"min": 0},
"relationships": [
{
"type": "inequality",
"low_column": "registration_date",
"high_column": "last_login_date"
},
{
"type": "custom_formula",
"column": "total_spent",
"formula": "num_orders * avg_order_value"
}
],
"conditional": [
{
"if": {"column": "country", "value": "USA"},
"then": {"column": "state", "regex": "^[A-Z]{2}$"}
}
],
"dependencies": {
"column": "city",
"depends_on": ["country", "state"]
}
}
}Database Source Example
{
"db_connection": "postgresql://user:password@localhost:5432/mydb",
"table_name": "transactions",
"num_rows": 10000,
"synthesizer": "tvae",
"output_format": "parquet"
}Configuration
Configuration is in src/tc_data_creator_mcp/config.py:
# Data size limits
MAX_SAMPLE_ROWS = 50000 # Max rows in sample data
MAX_SAMPLE_SIZE_MB = 100 # Max file size
MAX_GENERATED_ROWS = 1000000 # Max synthetic rows
MAX_COLUMNS = 200 # Max columns
# Quality thresholds
MIN_QUALITY_SCORE = 0.5
QUALITY_SCORE_WARNING_THRESHOLD = 0.7Architecture
tc-data-creator-mcp/
├── src/tc_data_creator_mcp/
│ ├── server.py # MCP server entry point
│ ├── config.py # Configuration constants
│ ├── tools/
│ │ ├── analyze.py # Data analysis tool
│ │ ├── generate.py # Synthesis tool
│ │ └── validate.py # Quality validation tool
│ ├── data_loaders/
│ │ └── loader.py # Unified data loading
│ ├── synthesizers/
│ │ ├── base.py # Base synthesizer interface
│ │ ├── factory.py # Synthesizer factory
│ │ ├── gaussian_copula.py # GaussianCopula wrapper
│ │ ├── tvae.py # TVAE wrapper
│ │ └── constraints_handler.py # Advanced constraints
│ └── validators/
│ └── quality_validator.py # Quality metrics
└── tests/
├── fixtures/ # Sample test data
└── test_basic_generation.py # Basic testsDevelopment
Running Tests
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest tests/ -v
# Run with coverage
pytest tests/ --cov=tc_data_creator_mcpCode Quality
# Format code
black src/ tests/
# Lint code
ruff check src/ tests/Synthesizer Comparison
Feature | GaussianCopula | TVAE |
Speed | Fast | Slower |
Quality | Good | Excellent |
Numerical Data | Excellent | Excellent |
Categorical Data | Good | Excellent |
Mixed Types | Good | Excellent |
Training Time | Seconds | Minutes |
Best For | General purpose, quick iteration | Complex distributions, production |
Quality Metrics
The quality validator provides comprehensive metrics:
Overall Score (0-1): Weighted combination of all metrics
Schema Validation: Column names, types, nullability
Statistical Similarity: Mean, std, min, max comparisons
Column Metrics: KS test for numerical, contingency for categorical
Correlation: Preservation of column relationships
Privacy: Minimum distance to real data points
Diversity: Percentage of unique records
Limitations
Maximum sample size: 50,000 rows, 100MB
Maximum output: 1,000,000 rows
Database queries limited to MAX_SAMPLE_ROWS
Custom formula constraints require valid Python expressions
TVAE requires more memory and training time
Troubleshooting
SDV Installation Issues
If you encounter issues installing SDV:
pip install --upgrade pip
pip install sdv --no-cache-dirDatabase Connection Errors
Ensure you have the appropriate database driver installed:
PostgreSQL:
psycopg2-binaryMySQL:
pymysqlSQLite: Built-in
Quality Score Low
If quality scores are consistently low:
Increase sample data size (more rows = better learning)
Try TVAE instead of GaussianCopula
Simplify constraints
Check for data quality issues in sample
Contributing
Contributions welcome! Please:
Fork the repository
Create a feature branch
Add tests for new features
Ensure code quality (black, ruff)
Submit a pull request
License
MIT License - See LICENSE file for details
Credits
Built with:
Support
For issues, questions, or contributions:
GitHub Issues: Create an issue
Documentation: See this README
Changelog
v0.1.0 (2026-01-03)
Initial release
GaussianCopula and TVAE synthesizers
Advanced constraints support
Comprehensive quality validation
File, inline, and database data sources
CSV, JSON, Parquet output formats
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Generate realistic, FK-consistent synthetic test data for your databases from your AI assistant.
Privacy-safe synthetic financial data for LatAm fintech, AI agents, testing and ML.
Privacy-preserving synthetic health data generation. FHIR R4/R5 compliant.
Generate and run tests, manage test cases, and inspect results from your AI assistant.
Related MCP Servers
- AlicenseAqualityBmaintenanceGenerate realistic multi-table synthetic datasets from plain English. Supports 18 industry domains, narrative growth curves (Black Friday, Q4 spike, 10x MRR), and 15 locale packs. Works with Claude Desktop, Cursor, Windsurf, Zed, and Continue.15305 PyPI78MIT
- FlicenseNot gradedqualityDmaintenanceGenerates realistic, context-aware synthetic data for AI agents to populate databases, mock APIs, and create test scenarios without exposing real PII.6 npm3-
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to run tests, generate synthetic insurance data, analyze coverage and code quality, and validate insurance business rules.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to validate CSV exports against schemas, infer schemas from example files, profile datasets, and diff before/after exports for lab/LIMS data-quality checks.MIT