home / mcp / avanti fellows postgresql mcp server

Avanti Fellows PostgreSQL MCP Server

Provides read-only access to the Avanti Fellows PostgreSQL database via MCP for querying tables, schemas, and sample data.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "avantifellows-mcp-postgres": {
      "command": "avanti-mcp-postgres",
      "args": [],
      "env": {
        "AF_DB_HOST": "af-database-host",
        "AF_DB_NAME": "database_name",
        "AF_DB_PORT": "5432",
        "AF_DB_USER": "your_username",
        "AF_DB_PASSWORD": "your_password"
      }
    }
  }
}

You can query the Avanti Fellows PostgreSQL database directly through a read-only MCP server. This setup lets Claude Code, Cursor, and other AI tools run SELECT queries and inspect schema without modifying data, making it ideal for analytical exploration and data discovery.

How to use

After you configure an MCP client, you can ask your AI tools to interact with the database. You can run queries to fetch data, list tables, inspect table schemas, sample data, count rows with optional filters, and search for columns by name. Examples of practical tasks include discovering what tables exist, viewing the columns and keys for a table, retrieving a small sample of rows from a table, and counting rows that match a condition.

How to install

Prerequisites you need installed on your system before setting up the MCP server are Python and pip. The server is provided as a Python package you install from a git URL.

pip install git+https://github.com/avantifellows/mcp-postgres.git

Additional configuration and usage notes

Configure your database credentials in your shell environment to point the MCP server at your PostgreSQL instance. The required variables are AF_DB_HOST, AF_DB_PORT, AF_DB_USER, AF_DB_PASSWORD, and AF_DB_NAME. Use the values that correspond to your database deployment.

To run the local MCP server for testing and development, start the server binary provided by the package. The command is: avanti-mcp-postgres.

If you want to validate the server is active, you can run it in your shell and then connect your MCP client to it using the standard MCP workflow your tool supports.

Security and best practices

The server is read-only by design; INSERT, UPDATE, and DELETE operations are blocked. You use your own database credentials, so protect them and do not commit them to version control. Queries are executed locally and logged on your side; they are not sent to external services.

Troubleshooting

Connection issues can arise if the AF_DB_HOST is unreachable or if network rules prevent access. Ensure the hostname and port are correct and that network access (including VPNs or security groups) allows connectivity to the PostgreSQL instance.

Authentication problems typically involve incorrect AF_DB_USER or AF_DB_PASSWORD, or missing SELECT permissions for the user. Verify credentials and permissions on the database side.

If your MCP client does not show the Avanti server, refresh or reconfigure your MCP client’s server list and retry the addition command to register the server.

Available tools

query

Run a SELECT query to retrieve data from the database.

list_tables

List all tables present in the connected database.

describe_table

Retrieve column information, primary keys, and foreign keys for a table.

sample_data

Fetch a sample of rows from a specified table.

count_rows

Count rows in a table with an optional WHERE clause.

search_columns

Find columns by name across all tables to locate relevant fields.