Skip to main content

csv-ingest-mcp

PyPI License: MIT

MCP server for ingesting CSV / TSV / Parquet / Excel / JSON / JSONL files into any SQLAlchemy-supported database (Postgres, MySQL, SQLite, MSSQL, ...). Plug into Claude Desktop, Cursor, Cline, or Continue and let the LLM load tabular data on demand.

Install

uvx csv-ingest-mcp        # one-shot, no global install
# or
pip install csv-ingest-mcp

Quick start (Claude Desktop)

~/.config/Claude/claude_desktop_config.json (Linux) / ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

{
  "mcpServers": {
    "csv-ingest": {
      "command": "uvx",
      "args": ["csv-ingest-mcp"],
      "env": {
        "CSV_MCP_ALLOWED_DIRS": "/home/you/data",
        "CSV_MCP_DB_URL": "postgresql://user:pass@localhost/mydb"
      }
    }
  }
}

Restart Claude Desktop. The model now has six tools.

Tools

Tool Purpose
ingest_file(path, table, if_exists, sheet, auto_alter, dry_run) Load file into table
upsert_file(path, table, key_columns, sheet, dedupe_source) Key-based replace + insert
list_tables() Database table names
describe_table(table) Schema + row count
ingest_async(path, table, if_exists, auto_alter) Queue large file via Celery
job_status(job_id) Poll Celery job

Configuration

Env var Default Purpose
CSV_MCP_ALLOWED_DIRS (required) :-separated path allowlist
CSV_MCP_DB_URL sqlite:///./csv_ingest.db SQLAlchemy DSN
CSV_MCP_MAX_ROWS 1000000 Per-file row cap
CSV_MCP_CHUNK_SIZE 50000 Streaming chunk rows
CSV_MCP_BROKER_URL redis://localhost:6379/0 Celery broker
CSV_MCP_RESULT_BACKEND redis://localhost:6379/1 Celery backend
CSV_MCP_WATCH_IF_EXISTS append Watcher write mode

Cursor / Cline / Continue

{
  "mcp": {
    "servers": {
      "csv-ingest": {
        "command": "uvx",
        "args": ["csv-ingest-mcp"],
        "env": { "CSV_MCP_ALLOWED_DIRS": "/abs/data" }
      }
    }
  }
}

Async + watcher (optional)

# 1. Redis
docker run -d -p 6379:6379 redis:7

# 2. Celery worker
CSV_MCP_ALLOWED_DIRS=/data CSV_MCP_DB_URL=postgresql://... \
  uv run celery -A csv_ingest_mcp.tasks worker -l info

# 3. File watcher (drops a CSV in /data/inbox -> table auto-created)
CSV_MCP_ALLOWED_DIRS=/data uv run csv-ingest-watch

Docker (self-host)

docker compose up -d

See docker-compose.yml (server + worker + redis).

Security

  • Path allowlist (CSV_MCP_ALLOWED_DIRS) — only listed dirs readable
  • SQL identifier regex — table/column names validated
  • Parametrized inserts (no string concat)
  • Row cap + chunk streaming — bounded memory
  • JSON-only Celery serializer — no pickle RCE

Disclose security issues to: priyank.salot@dbcorp.in

Architecture

See ARCHITECTURE.md for component map, request flows, and publishing approach.

Development

git clone https://github.com/priyak-salot/csv-ingest-mcp
cd csv-ingest-mcp
uv sync
uv run pytest

License

MIT

Metadata

Release files for csv-ingest-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for csv-ingest-mcp 0.1.0
File Size Uploaded Provenance Actions
csv_ingest_mcp-0.1.0.tar.gz 6.8 kB Without provenance Details for csv_ingest_mcp-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for csv-ingest-mcp 0.1.0
File Interpreter ABI Platform Actions
csv_ingest_mcp-0.1.0-py3-none-any.whl Python 3 none any Details for csv_ingest_mcp-0.1.0-py3-none-any.whl

Total release size: 15.8 kB

Release files / csv_ingest_mcp-0.1.0.tar.gz

Download URL csv_ingest_mcp-0.1.0.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
66cbee41d362b4bcac32e21137a0016c57adf94083f0dc7c75918443c09ab8a7
BLAKE2b-256 checksum
How to use checksums
293e8a385762b128898d0b013eadf110e0575517906ce45e2309d2c961b6b63b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / csv_ingest_mcp-0.1.0-py3-none-any.whl

Download URL csv_ingest_mcp-0.1.0-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e92c7ad861952d70d088b6938b40d83d6c2629a76e80bc836d83a7765457a07
BLAKE2b-256 checksum
How to use checksums
3077cfb6e8bc6c6dbc28c20ba6a7dd743203d4a5ff6446bf2b9e930086e64b08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for csv-ingest-mcp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page