Skip to main content
Glama
RJrohan47

MCP Data Integration Server

by RJrohan47

Multi-Source Lakehouse Ingestion Pipeline

An end-to-end Python data pipeline that uses FastMCP to expose reusable ingestion tools. It stages mocked PostgreSQL, CSV, Excel, and JSON sales data in Amazon S3, standardizes those sources into a common model, and writes Snappy-compressed Parquet tables to a Silver layer.

NOTE

All files insample_data/ are mocked demo data and are intentionally kept in the repository. Credentials are read only from a local .env file, which is ignored by Git.

Contents

Related MCP server: PySqlitMCP

Architecture

                         BRONZE — RAW INGESTION

 PostgreSQL table ──┐
 CSV file ──────────┼──> FastMCP tools ───> Amazon S3 landing/
 Excel workbook ────┤                         ├── sql/
 JSON API payload ──┘                         ├── csv/
                                            ├── excel/
                                            └── json/
                                                        │
                                                        ▼
                    SILVER — STANDARDIZATION AND PARQUET

                    Source transformers normalize, combine,
                       and deduplicate mocked source data
                                                        │
                                                        ▼
                                             Amazon S3 silver/
                                             ├── fact_sales_transactions/
                                             ├── dim_customers/
                                             └── dim_products/

Features

  • Multi-source ingestion: PostgreSQL, CSV, Excel, and JSON inputs.

  • MCP tool interface: FastMCP exposes ingestion and transformation routines as callable tools.

  • Schema normalization: Source-specific column names are mapped into common sales, customer, and product entities.

  • In-memory S3 processing: Landing files are read from S3 and Parquet is written through memory buffers.

  • Efficient Silver storage: Output is Apache Parquet with Snappy compression.

  • Mocked data included: The repository can be inspected without sharing real business data.

Repository structure

.
├── sample_data/                         # Mocked CSV, Excel, and JSON source files
├── src/
│   ├── config.py                         # Reads AWS and PostgreSQL variables from .env
│   ├── database.py                       # PostgreSQL table-to-CSV extraction
│   ├── storage.py                        # Amazon S3 client and upload helper
│   ├── parquet_utils.py                  # S3 reads and Snappy Parquet writes
│   ├── server.py                         # FastMCP server and public tools
│   └── transformers/
│       ├── sql_source.py                 # PostgreSQL landing-data transformer
│       ├── spreadsheet_source.py         # CSV and Excel transformer
│       ├── json_source.py                # JSON order transformer
│       └── base.py                       # Shared name-cleaning helper
├── test_connections.py                   # Optional AWS and PostgreSQL connectivity test
├── requirements.txt
├── .gitignore
└── README.md

Quick start

Prerequisites

  • Python 3.10 or later

  • An AWS account, S3 bucket, and IAM credentials with bucket access

  • A reachable PostgreSQL instance containing the configured source table

Install

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt

Configuration

Create a .env file in the project root. Never commit this file.

# AWS / S3
AWS_ACCESS_KEY_ID=your_access_key_id
AWS_SECRET_ACCESS_KEY=your_secret_access_key
AWS_REGION=eu-north-1
S3_BUCKET_NAME=your_s3_bucket_name

# PostgreSQL
POSTGRES_HOST=localhost
POSTGRES_PORT=5433
POSTGRES_DB=etl_pipeline
POSTGRES_USER=postgres
POSTGRES_PASSWORD=your_postgres_password
TIP

.env and .env.* are ignored by Git. You can safely keep local credentials there; use .env.example for a commit-safe template if you add one later.

Verify connectivity

python test_connections.py

This tests the configured PostgreSQL connection and lists objects in the configured S3 bucket.

Run the pipeline

1. Stage every source in the Bronze layer

python -c "from src.server import batch_ingest_all_sources; print(batch_ingest_all_sources())"

This stages the mocked local CSV, Excel, and JSON files plus the configured PostgreSQL table under landing/ in S3.

2. Build the Silver layer

python -c "from src.server import build_complete_silver_layer; print(build_complete_silver_layer())"

This reads the landing files, normalizes them, removes duplicates, and writes three Parquet datasets to silver/ in S3.

3. Start the FastMCP server

python src/server.py

An MCP-compatible client can then discover and call the project tools.

MCP tools

Tool

Purpose

Default behavior

ingest_postgres_table_to_s3

Extracts a PostgreSQL table as CSV and uploads it to S3.

Reads store.customer_transactions.

ingest_file_to_s3

Uploads one local raw file to a category in the landing layer.

Caller supplies a path and category.

batch_ingest_all_sources

Runs the PostgreSQL, CSV, Excel, and JSON Bronze ingestion steps.

Uses the files in sample_data/.

build_complete_silver_layer

Builds and uploads the normalized Silver Parquet datasets.

Writes sales, customer, and product tables.

Data layers and outputs

Bronze: raw S3 landing files

landing/sql/customer_transactions.csv
landing/csv/source_regional_sales.csv
landing/excel/raw_regional_sales.xlsx
landing/json/source_api_orders.json

Silver: standardized Parquet datasets

silver/fact_sales_transactions/data.parquet
silver/dim_customers/data.parquet
silver/dim_products/data.parquet

The transformations produce these logical entities:

Dataset

Description

Key fields

fact_sales_transactions

Individual sales transactions from every source.

transaction_id, customer_id, product_id, transaction_date, amount

dim_customers

Deduplicated customer records.

customer_id, full_name, email, customer_region

dim_products

Deduplicated product and category records.

product_id, product_name, category

  • PostgreSQL column variants such as id / transaction_id and total / amount are handled by the SQL transformer.

  • CSV and Excel headers are lowercased, trimmed, and converted to underscore-separated names before their records are combined.

  • JSON orders are flattened with pandas.json_normalize().

  • Customer names are cleaned into first name, last name, and full name fields.

  • Sales are deduplicated by transaction_id plus data_source; customers and products are deduplicated by their IDs.

Troubleshooting

Symptom

Likely cause

Resolution

NoCredentialsError or S3 authentication failure

AWS values are missing or invalid.

Check the .env values and the IAM policy for the bucket.

Connection refused on PostgreSQL

PostgreSQL is unavailable or using another port.

Check POSTGRES_HOST, POSTGRES_PORT, and that the database service is running.

Missing landing object during Silver build

Bronze ingestion has not run successfully.

Run batch_ingest_all_sources() before building Silver.

Parquet engine error

pyarrow was not installed in the active environment.

Run python -m pip install -r requirements.txt.

Security

  • .env, .env.*, private keys, certificates, and common credential-file names are excluded in .gitignore.

  • Do not paste access keys or passwords into source code, issues, commits, or README examples.

  • The included sample_data/ files are mocked; replace them with governed data sources for production use.

  • For production, use short-lived IAM roles or a managed secret store instead of long-lived local access keys where possible.

Roadmap

  • Add automated tests for transformations and S3 integrations.

  • Add structured logging, run IDs, and data-quality reports.

  • Add a configurable metadata layer for source mappings.

  • Add Databricks / Delta Lake Gold-layer transformations.

  • Add orchestration through scheduled workflows.

  • Add secure deployment configuration and managed secret integration.

License

Add a license file before distributing or reusing this project outside its current scope.

F
license - not found
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • -
    license
    -
    quality
    -
    maintenance
    Enables interaction with MySQL databases through MCP tools for querying table structures, searching data across single or multiple tables, and managing database information. Built with FastMCP framework for secure database operations using environment-based configuration.
    Last updated
  • A
    license
    -
    quality
    C
    maintenance
    Enables comprehensive SQLite database management through natural language including database creation, table operations, data CRUD operations, backup/restore, and CSV import/export functionality. Built on FastMCP framework with PySqlit library for reliable database interactions.
    Last updated
    1
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    Enables reading and writing Excel workbooks (.xlsx) through MCP. Supports listing sheets, tables, pivot tables, reading cell data, exporting to CSV/text/Markdown, and creating/modifying Excel files.
    Last updated
    GPL 3.0

View all related MCP servers

Related MCP Connectors

  • UN FAOSTAT global food & agriculture statistics over a local SQLite mirror, via MCP.

  • CSV <-> JSON MCP.

  • Query SEC EDGAR filings, XBRL financials, and company data through MCP. STDIO & Streamable HTTP.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RJrohan47/MCP_Data_Pipeline'

If you have feedback or need assistance with the MCP directory API, please join our Discord server