# Json2sql

> Convert JSON arrays and objects to SQL INSERT statements from the command line

- **Type:** MCP server
- **Install:** `agentstack add mcp-coding-dev-tools-json2sql`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Coding-Dev-Tools](https://agentstack.voostack.com/s/coding-dev-tools)
- **Installs:** 0
- **Category:** [Databases](https://agentstack.voostack.com/c/databases)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Coding-Dev-Tools](https://github.com/Coding-Dev-Tools)
- **Source:** https://github.com/Coding-Dev-Tools/json2sql
- **Website:** https://coding-dev-tools.github.io/devforge/

## Install

```sh
agentstack add mcp-coding-dev-tools-json2sql
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# json2sql

[](https://github.com/Coding-Dev-Tools/json2sql/stargazers)

Convert JSON files and datasets to SQL INSERT statements. Supports nested JSON, PostgreSQL, MySQL, and SQLite output dialects.

> ⭐ **Star this repo** if you work with JSON data — it helps other devs discover json2sql!

[](https://github.com/Coding-Dev-Tools/json2sql/releases)

[](https://github.com/Coding-Dev-Tools/json2sql/blob/main/LICENSE)
|[](https://www.opensourcealternative.to/project/json2sql)
[](https://github.com/Coding-Dev-Tools/json2sql/actions/workflows/ci.yml)
[](https://pypi.org/project/json2sql-cli/)

Real-world scenarios:
- **Seeding test databases**: Convert API response fixtures into seed data for integration tests
- **Data migrations**: Transform JSON exports from one system into INSERT statements for a new database
- **CI/CD pipelines**: Generate SQL from JSON configs as part of automated deployment
- **Analytics imports**: Convert event JSON payloads into structured SQL tables for querying

## Installation

```bash
pip install json2sql-cli
```

Or install directly from GitHub:

```bash
pip install git+https://github.com/Coding-Dev-Tools/json2sql.git
```

Or install via Homebrew (macOS/Linux):
```bash
brew tap Coding-Dev-Tools/tap
brew install json2sql
```

Or install via Scoop (Windows):
```bash
scoop bucket add Coding-Dev-Tools https://github.com/Coding-Dev-Tools/scoop-bucket
scoop install json2sql
```

**npm (Node.js wrapper):**
```bash
npm install -g json2sql-cli
```
Then run: `json2sql --help`

## Quick Start

```bash
# Basic usage — converts JSON to SQL INSERT statements
json2sql convert data.json

# Specify output dialect
json2sql convert data.json --dialect postgres
json2sql convert data.json --dialect mysql
json2sql convert data.json --dialect sqlite

# Specify output file
json2sql convert data.json -o output.sql

# Specify table name
json2sql convert data.json --table users

# Handle nested JSON (auto-flattens into relational tables)
json2sql convert nested_data.json --flatten
```

## Features

- **Nested JSON support**: Automatically flattens nested objects into separate relational tables
- **Multi-dialect output**: PostgreSQL, MySQL, SQLite INSERT syntax
- **Array of objects**: Handles JSON arrays as multiple INSERT rows
- **Type inference**: Auto-detects strings, numbers, booleans, nulls
- **Pipe support**: Read from stdin for pipeline usage
- **Zero dependencies**: Only Python 3.10+ required (typer for CLI)

## CI/CD Integration

```bash
# Generate SQL as part of a data pipeline
cat data.json | json2sql convert --dialect postgres --table events > events.sql

# Use in GitHub Actions to prepare test data
json2sql convert fixtures.json --dialect sqlite -o seed.sql
sqlite3 test.db 
  Part of Revenue Holdings — CLI tools built by autonomous AI.

## License

MIT

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Coding-Dev-Tools](https://github.com/Coding-Dev-Tools)
- **Source:** [Coding-Dev-Tools/json2sql](https://github.com/Coding-Dev-Tools/json2sql)
- **License:** MIT
- **Homepage:** https://coding-dev-tools.github.io/devforge/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-coding-dev-tools-json2sql
- Seller: https://agentstack.voostack.com/s/coding-dev-tools
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
