Skip to main content
Glama
hindocharaj1997

Data Recon MCP Server

README.md
# Data Recon MCP Server

An MCP (Model Context Protocol) server for data reconciliation between MySQL and Snowflake databases. Enables LLM agents like Claude, Antigravity, and Perplexity to validate data integrity during migrations, ETL processes, and ongoing monitoring.

## ๐Ÿš€ Quick Start

### Installation

```bash
pip install data-recon-mcp
```

### Configuration

Add to your MCP client configuration:

**For Claude Desktop** (`~/Library/Application Support/Claude/claude_desktop_config.json`):
```json
{
  "mcpServers": {
    "data-recon": {
      "command": "python3",
      "args": ["-m", "mcp_server"]
    }
  }
}
```

**For Antigravity** (`~/.gemini/antigravity/mcp_config.json`):
```json
{
  "data-recon": {
    "command": "python3",
    "args": ["-m", "mcp_server"]
  }
}
```

**For Perplexity** (MCP Settings):
```json
{
  "data-recon": {
    "command": "python3",
    "args": ["-m", "mcp_server"]
  }
}
```

That's it! Restart your LLM client and start using the tools.

## โœจ Features

- **All-in-One** - Single command starts everything (MCP server + FastAPI backend)
- **23 MCP Tools** for comprehensive data reconciliation
- **MySQL and Snowflake** support
- **Async job execution** with progress tracking
- **SQLite metadata storage** - datasource configs persist locally

## ๐Ÿ”ง Advanced Configuration

### Using a Centralized Backend

For team environments where you want everyone to share the same datasources:

**1. Start the centralized backend:**
```bash
git clone https://github.com/hindocharaj1997/data-recon-mcp.git
cd data-recon-mcp
pip install -e .
uvicorn data_recon.main:app --host 0.0.0.0 --port 8000
```

**2. Configure clients to use it:**
```json
{
  "data-recon": {
    "command": "python3",
    "args": ["-m", "mcp_server"],
    "env": {
      "FASTAPI_URL": "http://your-server.company.com:8000"
    }
  }
}
```

### Pre-configured Data Sources

Register data sources via environment variables:

```json
{
  "data-recon": {
    "command": "python3",
    "args": ["-m", "mcp_server"],
    "env": {
      "DATASOURCE_MYSQL_PROD": "{\"type\":\"mysql\",\"host\":\"localhost\",\"port\":3306,\"username\":\"user\",\"password\":\"pass\",\"database\":\"mydb\"}"
    }
  }
}
```

## ๐Ÿ“Š MCP Tools

| Category | Tools | Description |
|----------|-------|-------------|
| **Data Source Management** | 7 | Add, list, test, remove datasources |
| **Discovery & Validation** | 7 | Search tables, validate existence, preview data |
| **Individual Checks** | 4 | Row count, aggregates, schema, sample rows |
| **Job Management** | 5 | Create/monitor reconciliation jobs |

### Key Tools

- `add_datasource` - Register a MySQL or Snowflake connection
- `search_tables` - Find tables by pattern
- `run_row_count_check` - Compare row counts between source and target
- `run_aggregate_check` - Compare SUM, AVG, MIN, MAX values
- `create_recon_job` - Run comprehensive reconciliation with all checks

## ๐Ÿ—๏ธ Architecture

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    LLM Client                           โ”‚
โ”‚              (Claude, Antigravity, etc.)                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ”‚ MCP Protocol (stdio)
                      โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                 MCP Server                              โ”‚
โ”‚            (python3 -m mcp_server)                      โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Embedded FastAPI Backend (or external via FASTAPI_URL) โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚   SQLite    โ”‚  โ”‚   MySQL     โ”‚  โ”‚   Snowflake     โ”‚ โ”‚
โ”‚  โ”‚  (metadata) โ”‚  โ”‚  Connector  โ”‚  โ”‚   Connector     โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

## ๐Ÿงช Development

```bash
# Clone and setup
git clone https://github.com/hindocharaj1997/data-recon-mcp.git
cd data-recon-mcp
pip install -e ".[dev]"

# Run tests
pytest

# Start local MySQL for testing
docker compose -f tests/docker-compose.yml up -d
```

## ๐Ÿ“ License

MIT

## ๐Ÿค Contributing

Contributions welcome! Please open an issue first to discuss proposed changes.

TDQS

B3.4/5.0

Scored across 23 tools

Disambiguation5/5

Each tool has a distinct purpose: data source management, discovery, validation, various checks, and job control. No significant overlap; similar tools like compare_table_structures and run_schema_check are differentiated by usage context.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern using lowercase and underscores, e.g., add_datasource, validate_table_exists, run_row_count_check. No naming inconsistencies or mixed conventions.

Tool Count4/5

With 23 tools, the set is slightly on the higher side but each tool fulfills a clear role in the reconciliation workflow. The count is justified by the need for separate validation, discovery, and check functions.

Completeness4/5

The tool surface covers the core reconciliation lifecycle: source management, discovery, validation, structural and data checks, job creation, monitoring, and results retrieval. Minor gaps like updating datasource configuration exist but do not hinder the primary workflow.

Maintenance

ActivityInactive
ResponsivenessNo issues