Back to Home
microsoft icon

MCP-Server-and-PostgreSQL-Sample-Retail

Verified Safe

by microsoft

Overview

Enables AI assistants to securely access and analyze retail sales data through a Model Context Protocol (MCP) server, integrating with PostgreSQL and Azure AI services.

Installation

Run Command
docker compose up -d

Environment Variables

  • POSTGRES_DB_HOST
  • POSTGRES_DB_PORT
  • POSTGRES_DB
  • POSTGRES_USER
  • POSTGRES_PASSWORD
  • AZURE_OPENAI_ENDPOINT
  • EMBEDDING_MODEL_DEPLOYMENT_NAME
  • PROJECT_ENDPOINT
  • AZURE_CLIENT_ID
  • AZURE_CLIENT_SECRET
  • AZURE_TENANT_ID
  • APPLICATIONINSIGHTS_CONNECTION_STRING
  • LOG_LEVEL
  • ENVIRONMENT

Security Notes

The server implements robust security features including Row Level Security (RLS) for data isolation, Azure AD authentication for AI services (DefaultAzureCredential), input validation for table names, and parameterized queries (implied by `asyncpg` usage in Python for database interaction). Secrets like database passwords and Azure API keys are expected to be provided via environment variables, reducing the risk of hardcoding. Docker containers run as a non-root user. Minor exposure of PGPASSWORD in a healthcheck is noted but generally within a trusted network context.

Similar Servers

Stats

Interest Score38
Security Score9
Cost ClassMedium
Avg Tokens50
Stars10
Forks13
Last Update2026-01-13

Tags

Retail AnalyticsAI AssistantsModel Context ProtocolPostgreSQLAzure AISemantic SearchMulti-Tenancy