Back to Home
Anashel-RPG icon

mcp-postgres

Verified Safe

by Anashel-RPG

Overview

LLM-powered data analysis and exploration on a PostgreSQL database, utilizing Cloudflare Workers for scalable and secure deployment.

Installation

Run Command
npm run deploy:all

Environment Variables

  • MCP_API_KEY
  • MCP_SERVER_URL
  • OPENAI_API_KEY
  • SESSION_TTL
  • TOTP_ISSUER
  • TOTP_ACCOUNT
  • HYPERDRIVE_ID (in wrangler.toml)
  • ALLOWED_SOURCES
  • EXCLUDED_SCHEMAS
  • DEFAULT_MODEL
  • MAX_TOOL_ITERATIONS
  • LLM_MAX_TOKENS
  • PG_QUERY_TIMEOUT_MS

Security Notes

The project demonstrates strong security practices. SQL queries use parameterized statements and identifier escaping to prevent injection. API keys are managed via environment variables and validated with `timingSafeEqual`. TOTP-based 2FA with brute-force protection is implemented for `llm-app`. Cross-Origin Resource Sharing (CORS) is explicitly configured. Sensitive data is sanitized from logs and error messages. Durable Objects are used for secure state persistence. Content Security Policy (CSP) and other security headers are enforced for frontend assets. Inputs and LLM outputs are truncated to prevent context window attacks and excessive costs, and markdown content is sanitized for XSS prevention. Default settings prioritize fail-closed security for unauthenticated access. Minor improvements could involve stricter input validation on all API endpoints or more frequent key rotation policies.

Similar Servers

Stats

Interest Score0
Security Score9
Cost ClassMedium
Avg Tokens4000
Stars0
Forks0
Last Update2026-01-19

Tags

LLMData AnalysisPostgreSQLCloudflare WorkersRAG