Skip to main content
Glama
verifydream

SchemaPilot MCP

by verifydream
README.md
# SchemaPilot MCP

> MCP server for PostgreSQL schema metadata — read-only, local-first, AI-coding-agent ready.

## Features

- Read-only PostgreSQL introspection (no writes, no arbitrary SQL)
- MCP protocol (Model Context Protocol) for AI coding agents
- Schema/table/column metadata with PK/FK/index details
- Explicit cache refresh (`sync_schema`)
- Markdown documentation export (deterministic)
- Schema allowlist + max table/column limits
- Secret redaction in logs

## Quick Start

```bash
pip install -e .
# Configure
cp schemapilot.yaml.example schemapilot.yaml
# Edit with your PostgreSQL credentials
schemapilot
```

## MCP Tools

| Tool | Description |
|------|-------------|
| `list_schemas` | List available schemas |
| `list_tables` | List tables with column counts |
| `describe_table` | Full table details |
| `get_relationships` | FK relationship graph |
| `export_schema` | Markdown documentation |
| `sync_schema` | Refresh schema cache |

## Configuration

```yaml
postgres:
  host: localhost
  port: 5432
  database: mydb
  user: app
  password: secret
schema_allowlist:
  - public
  - app
max_tables: 100
max_columns: 500
cache_ttl_seconds: 300
```

## License

MIT