Provides read-only access to query PostgreSQL databases with tools for running SELECT queries, listing tables, describing schemas, sampling data, counting rows, and searching columns across the database.
Avanti Fellows PostgreSQL MCP Server
Read-only MCP server for querying the Avanti Fellows DB Service (PostgreSQL).
What is this?
This is an MCP (Model Context Protocol) server that lets Claude Code, Cursor, and other AI tools query our PostgreSQL database directly. It's read-only - no writes allowed.
Available Tools
Tool | Description |
| Run any SELECT query |
| List all tables in the database |
| Get column info, primary keys, foreign keys |
| Get sample rows from a table |
| Count rows with optional WHERE clause |
| Find columns by name across all tables |
Installation
1. Install the package
2. Set up credentials
Add these to your shell profile (~/.zshrc or ~/.bashrc):
Then reload: source ~/.zshrc
3. Configure your AI tool
Claude Code
Verify it's working:
Cursor
Add to ~/.cursor/mcp.json:
Usage Examples
Once configured, just ask Claude/Cursor about the database:
Updating
Local Development
Security Notes
This server is read-only - INSERT, UPDATE, DELETE are blocked
Uses your personal database credentials
Queries are logged locally but not sent anywhere
Don't commit credentials to git
Troubleshooting
"Connection refused"
Check that
AF_DB_HOSTis correct and accessible from your networkVerify you're on VPN if required
"Authentication failed"
Double-check
AF_DB_USERandAF_DB_PASSWORDEnsure your user has SELECT permissions
Server not showing in Claude Code
Run
claude mcp listto check statusTry removing and re-adding:
claude mcp remove avanti-db && claude mcp add avanti-db -- avanti-mcp-postgres