
This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

A FastMCP-based MCP server that lets LLMs explore PostgreSQL schemas and tables, execute SELECT queries, and use predefined prompts, returning results in YAML format.
FastMCP server for PostgreSQL database exploration and querying is cataloged as an MCP server attributed to tibiritabara. A FastMCP-based MCP server that lets LLMs explore PostgreSQL schemas and tables, execute SELECT queries, and use predefined prompts, returning results in YAML format. It is categorized under databases storage. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.
Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for FastMCP server for PostgreSQL database exploration and querying are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
No; the query_database tool is limited to SELECT queries only.
Results are returned in YAML format for easy consumption by LLMs.
It is configured using environment variables such as DB_HOST, DB_PORT, DB_USER, DB_PASSWORD, and DB_NAME for the PostgreSQL connection.
README.md · 2237c8bb40cd · Fetched 2026-11-13 10:26:42 UTC
Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.
Showing the last retrieved documentation snapshot; check the source for current changes.
A FastMCP server that enables LLMs to connect and interact with PostgreSQL databases. This project demonstrates how to use the Model Context Protocol (MCP) to allow Language Models to query and explore database schemas and tables.
The server exposes the following MCP resources:
database://{schema} - Get information about all tables in a schemadatabase://{schema}/tables/{table} - Get detailed information about a specific tablequery_database - Execute SQL queries against the database (SELECT queries only)The server includes the following predefined prompts:
prompt_schema_description - Ask for a description of a database schemaprompt_table_description - Ask for a description of a specific tableprompt_query_database - Ask for data from a specific tableClone the repository:
git clone <repository-url>
cd mcp-demo
Create a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
Install UV (if not already installed):
pip install uv
Install dependencies with UV:
uv sync
Configure environment variables:
.env.example to .envThe application is configured using environment variables:
| Variable | Description | Default |
|---|---|---|
| APP_NAME | Application name | mcp-demo |
| DB_HOST | PostgreSQL host | localhost |
| DB_PORT | PostgreSQL port | 5432 |
| DB_USER | PostgreSQL username | postgres |
| DB_PASSWORD | PostgreSQL password | postgres |
| DB_NAME | PostgreSQL database name | postgres |
First, uncomment the run function in src/main.py by removing the comment from these lines at the bottom of the file:
# if __name__ == "__main__":
# print("Starting FastMCP server...")
# mcp.run()
Start the FastMCP server:
python -m src.main
The server will be available for LLMs to connect to and query your PostgreSQL database. With the server running, the MCP can be loaded into client applications for interaction.
To use this MCP in a client application, add the following configuration to your client's MCP configuration file (e.g., .cursor/mcp.json):
{
"mcpServers": {
"postgres-mcp-server": {
"command": "/path/to/your/venv/bin/mcp",
"args": ["run", "/path/to/your/postgres-mcp/src/main.py"],
"env": {
"APP_NAME": "mcp-demo",
"DB_HOST": "localhost",
"DB_PORT": "5432",
"DB_USER": "postgres",
"DB_PASSWORD": "postgres",
"DB_NAME": "postgres"
}
}
}
}
Be sure to replace the paths with the actual paths to your virtual environment and project directory, and update the environment variables to match your PostgreSQL configuration.
Install development dependencies with UV:
uv pip install -e ".[dev]"
Development tools included:
To run the application with Docker:
Build the Docker image:
docker build -t mcp-demo .
Run the container:
docker run --env-file .env.docker -p 8000:8000 mcp-demo
from mcp.client import get_client
client = get_client("http://localhost:8000")
schema_info = client.get_resource("database://public")
print(schema_info)
table_info = client.get_resource("database://public/tables/users")
print(table_info)
result = client.invoke_tool("query_database", {"query": "SELECT * FROM users LIMIT 10"})
print(result)
[Add your license information here]
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for FastMCP server for PostgreSQL database exploration and querying from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/postgres-mcp-tibiritabara)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.
No reviewed package or image identity; download statistics are not listed yet.
Alternative and complementary servers in the same category

This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

A Model Context Protocol server that lets AI assistants run SQL queries against AWS Athena databases and retrieve results.

A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 instance using the InfluxDB OSS API v2.