# Secure Schema MCP [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/Siddharth-coder13/secure_schema_mcp  
**GitHub Stars:** 0  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/secure-schema-mcp

## Description
Read-only MCP server for exposing database schema metadata without row data.

## Tools
Capabilities this server exposes over MCP:

- **list_tables** — Lists all user tables and views available in the current database.
Use this to understand what architectural entities exist.
- **schema_overview** — Summarizes available tables, views, primary keys, and foreign key relationships.
Strictly constrained to structural metadata. Does not reveal data rows.
- **inspect_table** — Exposes exact column names, types, nullability, primary keys, and foreign key relationships.
Strictly constrained to structural layouts. Does not reveal data rows.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "secure-schema-mcp": {
    "command": "uvx",
    "args": ["mcp-secure-schema"],
    "env": {
      "DATABASE_URL": ""
    }
  }
}
```

**Requires environment variables:** `DATABASE_URL` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What Secure Schema MCP MCP server does

Secure Schema MCP provides AI coding tools with database structure while keeping row data outside the MCP interface. It can expose table and view names, column names and SQL types, nullability, primary keys, unique constraints, and foreign-key relationships. The server does not provide SQL query execution, row samples, row counts, mutation tools, or database credentials.

The server supports reachable SQLite, PostgreSQL, and MySQL databases. SQLite uses Python's built-in driver; PostgreSQL and MySQL drivers are included. Other SQLAlchemy dialects are not tested or bundled in version 1.

## How it works

The server runs as a Python MCP process over standard input and output. An MCP-compatible client starts it when needed, typically through `uvx` or an installed `mcp-secure-schema` command. It performs SQLAlchemy inspection operations against the configured database and returns only metadata permitted by the configured namespace and table allowlist.

Three tools are available:

- `schema_overview` returns a compact map of permitted tables, views, primary keys, and foreign-key links.
- `list_tables` returns the permitted table and view inventory.
- `inspect_table` returns detailed metadata for one permitted entity.

Tools default to compact formatting to reduce model context usage. Callers can request markdown when a more readable representation is preferable. When an allowlist is active, missing and disallowed names use the same client-facing message, reducing the chance of revealing whether an object exists. Operational details are written to standard error and client-facing errors are sanitized.

## Setup and configuration

The Secure Schema MCP MCP server requires `DATABASE_URL`, which accepts a SQLAlchemy URL. Examples include absolute-path SQLite URLs, PostgreSQL URLs using `psycopg2`, and MySQL URLs using `pymysql`. Reserved characters in usernames and passwords must be percent-encoded. Remote connections also require working DNS, network and firewall access, and valid TLS settings where applicable.

The recommended installation uses `uvx`, which downloads and runs the published package in an isolated environment. A persistent alternative is `pipx install mcp-secure-schema`; the installed command can then be used directly in the MCP client configuration. Python 3.12 or newer is needed when installing without `uvx`.

`DATABASE_SCHEMA` selects the default schema or catalog namespace. In production, it is treated as a security boundary and cannot be overridden by tool arguments. Outside production, an explicit tool schema can override it. `SECURE_SCHEMA_ENV=production` or `prod` enables strict startup validation, including the requirement for a non-empty `ALLOWED_TABLES` value. For multiple production schemas, configure one server entry per schema and allowlist.

Use a dedicated least-privilege database account. Do not commit credentials in client configuration; a wrapper can obtain `DATABASE_URL` from an operating-system keychain or secret manager. The server's configuration and launching IDE should be treated as trusted.

## Limitations and notes

The Secure Schema MCP MCP server reveals metadata, which can still be sensitive: names such as `ssn` may disclose information even though values remain inaccessible. The allowlist is therefore important for production deployments. Its entries are comma-separated, case-sensitive, unqualified table or view names rather than `schema.table` values.

Database metadata visibility depends on the database provider's policies and permissions. PostgreSQL deployments may need additional catalog or object privileges for inspection; avoid granting row `SELECT` unless required by the environment. A process started directly may appear to hang because it is waiting for an MCP client on standard input. If startup fails, check that `DATABASE_URL` is present and that production mode has a non-empty allowlist.

_Full upstream README: https://allmcps.com/mcp/secure-schema-mcp/readme_

