
Database Report Generator
Converts natural language queries into SELECT-only SQL statements for Postgres, MySQL, or SQLite databases using a provided DATABASE_URL and BYOK OpenAI. Executes queries to generate reports directly from the database. Data analysts, business intelligence users, and developers use it to query data without manual SQL writing.
Overview
The Database Report Generator MCP server enables natural language (NL) to SQL translation specifically for SELECT-only queries on Postgres, MySQL, and SQLite. Users provide a DATABASE_URL for connection and their own OpenAI API key (BYOK) to power the NL processing. It generates executable SQL from plain English questions and runs them to fetch data, outputting results as database reports.
Key Capabilities
- NL to SELECT SQL Conversion: Parses natural language inputs like "Show total sales by region in 2023" into precise SELECT queries, avoiding INSERT/UPDATE/DELETE for read-only safety.
- Database Connectivity: Supports Postgres, MySQL, SQLite via standard DATABASE_URL; handles schema introspection for accurate query generation.
- Report Execution and Output: Runs the generated SQL and returns formatted results, such as tables or aggregated summaries.
- BYOK OpenAI Integration: Uses user-provided OpenAI credentials to minimize vendor lock-in and control costs.
Use Cases
-
Sales Reporting: A business analyst inputs "List top 10 customers by revenue last quarter"; the server generates and executes SELECT customer, SUM(revenue) FROM sales WHERE date >= '2023-10-01' GROUP BY customer ORDER BY SUM(revenue) DESC LIMIT 10, returning a ranked table.
-
Inventory Analysis: Query "Average stock levels for products under $50"; outputs SQL aggregating inventory data for quick insights without schema knowledge.
-
User Metrics Dashboard: Developers ask "Count active users per month in the last year"; gets time-series SQL results for prototyping dashboards.
-
Ad-hoc Data Exploration: Non-technical teams query "Recent orders from California" on SQLite dev DBs, iterating via conversational NL refinements.
Tools (canonical reference)
This table is the source of truth for what the server exposes. If the MCPize marketplace Capabilities tab shows no tools, use this section (and tools/list over an authenticated MCP session) instead.
| Tool | What it does | Inputs | Output (structured) |
|---|---|---|---|
| report_generator_get_database_info | Detect engine from DATABASE_URL and return read-only metadata. | (none) | engine, version, database, warnings[] |
| report_generator_list_tables | List user tables; on PostgreSQL you can filter by schema. | schema (optional), limit (optional, default 100, max 500) | tables[] (strings; Postgres uses schema.table) |
| report_generator_describe_table | Column names, types, nullability, PK hints where available. | schema (optional), table (required) | schema, table, columns[] (name, data_type, is_nullable, column_key optional) |
| report_generator_validate_select_sql | Parse and validate a single SELECT (or UNION of SELECTs); does not run the query. | sql (required) | ok, errors[], normalized? |
| report_generator_generate_report | Natural language → validated SELECT → execute; SELECT-only; row cap enforced. | question (required), max_rows (optional, default 500, max 2000), schema_hint (optional), title (optional) | sql, rows[], truncated, execution_ms, report_title |
Who This Is For
Data analysts querying production databases without deep SQL expertise; BI users generating on-demand reports; developers accelerating data exploration in prototypes; business stakeholders needing quick DB insights via chat-like interfaces.