Connection
Save the PostgreSQL or SQL Server connection in the Gateway. The stored connection string is protected and is not returned to the browser, LLM files, or MCP clients after save.
Database to MCP
Connect PostgreSQL or SQL Server, create a safe MCP surface for one schema or business workflow, publish only approved tables and columns, then let AI clients use metadata-only schema tools and validated executors through the Gateway. Credentials stay server-side, and Gateway Chat lets you test the surface before external MCP clients use it.
No credit card required.
app.swaggertomcp.com/databases/acme/scopes/support
Swagger to MCP
support_readonly
PostgreSQL · 4 tables · 28 columns
customers
9 columns · PII blocked
orders
8 columns · Read-only
tickets
7 columns · Scoped
Gateway validation
Scope, table, column, and read-only checks
Recent audit
query_support_scope · allowed columns only
schema_customers · returned metadata
Publishing model
The Gateway turns a database connection into smaller MCP surfaces. Each surface has its own URL key, published tables, column rules, execution mode, and audit trail.
Save the PostgreSQL or SQL Server connection in the Gateway. The stored connection string is protected and is not returned to the browser, LLM files, or MCP clients after save.
Create an MCP surface for a database, schema, or business domain such as sales, finance, support, or inventory. The public MCP URL resolves to that account-bound surface.
Select the tables and columns the AI workflow may use. The same physical table can have different permissions in different MCP surfaces.
Agent-ready context
A useful database agent needs table meaning, relationship context, and query rules. Database to MCP gives the model a structured catalog first, then validates every execution request in the Gateway.
AI clients can inspect table names, column descriptions, keys, relationships, permissions, and allowed operations before they propose a query.
Add scope, table, column, and relationship descriptions so generated schema tools explain business meaning instead of only exposing raw database names.
Use Gateway Chat to ask real questions, watch schema tools and executor tools being called, and confirm that the scope behaves correctly before configuring Claude, Cursor, or another MCP client.
Use cases
Use Database to MCP for reporting, internal operations, and approved analytics where AI needs current structured data without direct database credentials.
Let assistants answer questions over approved sales, support, finance, or inventory scopes without crossing database or schema boundaries.
Publish safe read-oriented scopes for teams that need natural language access to approved database domains, limits, and columns.
Combine Database to MCP for governed context with OpenAPI to MCP for actions, so an agent can inspect data and then call the right business operation.
Runtime surface
The MCP catalog is intentionally smaller than the database. AI clients receive metadata and validated tools, not raw credentials or unrestricted SQL access.
| Surface | What AI sees | Gateway behavior |
|---|---|---|
| Schema tools | One schema tool per published table, with metadata for columns, permissions, keys, relationships, indexes, and allowed operations. | Schema tool calls never return table rows. They help the model understand the approved data shape before execution. |
| QueryPlan executor | validate_query_plan and execute_query_plan tools for structured, provider-independent query requests. | The Gateway validates scope, tables, aliases, joins, columns, aggregates, sorting, limits, and policy before generating provider-specific SQL. |
| SQL mode executor | validate_sql and execute_sql tools for advanced SQL plus parameter workflows when a scope is configured for SQL mode. | SQL mode is conservative: single-statement SELECT behavior, published-table boundaries, relationship-gated joins, column permissions, and limit policy are enforced. |
| Gateway Chat | Active database scopes appear as chat-callable MCP surfaces when they have published tables and a supported executor mode. | Chat uses schema tools for context, validates the plan or SQL candidate, then executes only through the same Gateway MCP path external clients use. |
| Audit logs | Execution metadata such as mode, action, success or error, duration, row count, truncation, and validation errors. | Connection strings, provider secrets, and sensitive request values stay out of stored logs; request details are redacted before persistence. |
Hard boundaries
Database to MCP is useful because the Gateway keeps model context, execution, credentials, and audit controls separated.
MCP clients authenticate to the Gateway. They do not receive the database connection string, and stored connection strings are not returned after save.
Schema tools describe the approved data model. Data rows can only be returned by validated executor tools, never by metadata inspection.
Hidden, sensitive, or unpublished columns are blocked by scope-based permission checks before execution. The same column can be allowed in one scope and restricted in another.
Cross-database, cross-schema, cross-scope, and cross-owner access is rejected. The `/mcp/{scopeKey}` resolver is owner-aware.
Semantic Kernel or an LLM may propose a QueryPlan or SQL candidate, but validation, permissions, SQL safety checks, redaction, and audit logging happen in the Gateway.
Workflow
The Gateway keeps source discovery, publishing, execution, and monitoring separated so the AI-facing surface stays controlled.
Step 1
Connect PostgreSQL or SQL Server and run metadata discovery for schemas, tables, columns, keys, relationships, and indexes. Discovery does not read sample rows.
Step 2
Choose a surface key for a database, schema, or business domain. This becomes the account-bound MCP surface exposed at `/mcp/{surfaceKey}`.
Step 3
Publish the tables the AI workflow may use, add helpful table and column descriptions, and set visibility, filtering, sorting, grouping, and aggregation permissions.
Step 4
Use QueryPlan as the recommended default. Use SQL mode only for advanced scopes that need SQL candidates and can accept stricter SQL validation.
Step 5
Ask real questions in Gateway Chat, confirm the model uses schema tools and the executor correctly, then inspect validation results, latency, row counts, and redacted audit logs.
FAQ
Short answers for teams comparing MCP adapters, API gateways, and database access for AI agents.
No. The database connection stays in the Gateway. MCP clients see a published scope with schema tools and validated executor tools, not the raw connection string or a direct database login.
A database scope is the MCP surface for a database, schema, or business domain. For example, a large ERP database can be split into erp-sales, erp-finance, and erp-inventory scopes with different tables and column permissions.
No. Schema tools are metadata-only. They describe tables, columns, keys, relationships, permissions, and allowed operations without returning data row payloads.
Rows can be returned only by validated executor tools such as execute_query_plan or execute_sql. The executor must pass Gateway validation for scope, tables, columns, relationships, limits, and policy before it runs.
QueryPlan mode is the recommended database executor mode. The client submits a structured plan, the Gateway validates the plan, then generates PostgreSQL or SQL Server SQL for the approved scope.
QueryPlan mode uses a structured request that is easier to validate conservatively. SQL mode accepts SQL candidates for advanced use cases, but it is still validated before execution and is not published together with QueryPlan mode for the same scope.
No. One scope publishes either QueryPlan mode or SQL mode executor tools, never both at the same time. Schema tools appear in both modes.
Yes. Published database scopes can be selected in Gateway Chat when the scope is active, has published tables, and uses a supported executor mode. Chat uses schema tools for context and follows Gateway validation before execution.
Published database scopes include column-level permissions. Executor tools can only use columns allowed in the current scope, and sensitive, hidden, or unpublished columns are blocked by Gateway validation.
No. Cross-database, cross-schema, cross-scope, and cross-owner access is forbidden by Gateway validation. Executor tools stay inside the published scope and its approved tables, columns, and relationships.
No. The current database flow is designed for governed, read-oriented access. SQL mode is conservative and validates single-statement SELECT queries by default; QueryPlan execution also follows scope, column, relationship, limit, and read-only policy.
Database to MCP supports PostgreSQL and SQL Server scopes. The Gateway keeps provider behavior explicit so validation and SQL generation can remain conservative.
No. Connection strings are protected by the Gateway and are not returned after save. Public docs, LLM-readable files, and logs must not expose connection string values.