PostgreSQL with GitHub OAuth
by coleam00 · Added 26d ago
Install
git clone https://github.com/coleam00/remote-mcp-server-with-authAbout
This MCP server provides AI assistants with secure database access through GitHub OAuth authentication and PostgreSQL integration, built by Cole Medin using Cloudflare Workers with Durable Objects for stateful session management. The implementation features role-based access control where all authenticated GitHub users can perform read-only database operations like table listing and SELECT queries, while write operations (INSERT, UPDATE, DELETE) are restricted to specific GitHub usernames defined in an allowlist. Built with TypeScript using the workers-mcp framework, Hono for HTTP handling, and the postgres library for database connectivity, it includes SQL injection protection, query validation, connection pooling optimized for Cloudflare Workers' constraints, and optional Sentry integration for error monitoring and performance tracking. The server supports both simple math operations for testing and full PostgreSQL database management, making it valuable for teams building AI-powered database applications that need secure, authenticated access to production databases with granular permission controls based on GitHub identity.