permit-db
Provides a read-only natural-language interface to a MySQL permit database, enabling users to query and analyze permit data through validated SQL SELECT statements.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
permit-query-agent
A read-only, natural-language interface to a permit database. Ask a question in
plain English; the local Claude Code CLI writes a SELECT, runs it through a
validated MCP tool (permit-db), and explains the result. A Streamlit UI wraps
it with deterministic Discover/Analytics pages that never call the LLM.
Project Structure
permit-query-agent/
│
├── app/ # Application source
│ ├── agent/ # PermitAgent — drives the `claude` CLI + MCP tools
│ ├── config/ # Query-safety / logging settings
│ ├── database/ # Engine, session, schema init (connection.py)
│ ├── logging/ # Logging setup
│ ├── mcp/ # MCP server + tool layer (SQL entry point)
│ ├── models/ # SQLAlchemy models
│ ├── repositories/ # Data access layer (queries)
│ ├── security/ # SQL Guard, audit, table allowlist
│ ├── services/ # Query / schema / statistics services
│ └── utils/ # Shared helpers
│
├── ui/ # Streamlit app (app.py) + deterministic reads (data.py)
├── scripts/ # Setup: init_db, create_readonly_user, seed_data
├── certs/ # DB TLS certs (e.g. Aiven ca.pem) — git-ignored
├── tests/ # Test suite
│
├── .env # Local secrets (git-ignored)
├── .env.example # Copy to .env and fill in
├── .mcp.json # MCP server configuration
└── requirements.txtRelated MCP server: MCP MySQL Server
Database
MySQL 8, database permit_system (or Aiven's defaultdb). All connection
settings are read from .env — see .env.example. Two supported targets:
Local MySQL —
DB_HOST=localhost,DB_PORT=3306,DB_SSLunset.Aiven for MySQL — the service host/port,
DB_SSL=true. Aiven requires TLS; to verify the server cert, downloadca.pemintocerts/and setDB_SSL_CA=./certs/aiven-ca.pem.
The app connects as a least-privilege read-only user (DB_USER); setup
scripts use the admin credentials (DB_ADMIN_USER / DB_ADMIN_PASSWORD).
Setup
pip install -r requirements.txt
cp .env.example .env # then fill in host / credentials
python -m app.database.init_db # create the tables (admin creds)
# create the read-only app user (name defaults to permit_ro)
RO_DB_PASSWORD=your_ro_password python -m scripts.create_readonly_user
python -m scripts.seed_data # load ~1,000 sample permitsRun
streamlit run ui/app.py # UI — needs the `claude` CLI on PATH for Ask AI
pytest # test suiteTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Query, explore, and manage your databases through natural conversation.
Query your warehouse or a CSV with Claude/ChatGPT over MCP, governed by table-level ACL + audit.
Query your org's data in natural language — read-only MCP access to SQL, NoSQL, files & warehouses.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA natural language interface that allows Claude to execute SQL queries on your local MySQL databases, enabling database interaction using natural language.5-
- AlicenseNot gradedqualityDmaintenanceEnables Claude Desktop to interact with MySQL databases through secure query execution, schema discovery, and multi-database support with configurable read/write permissions and built-in SQL injection protection.82 npmMIT
- AlicenseAqualityBmaintenanceEnables Claude Desktop to execute read-only SQL queries on MySQL databases via natural language, with dynamic connection switching and built-in security.3162 npm7MIT
- AlicenseNot gradedqualityDmaintenanceEnables natural language querying of MySQL databases via Claude Code, allowing SELECT queries, table listing, and schema inspection.798 npmMIT