remote-mcp-server-with-auth  by coleam00

Remote MCP server for PostgreSQL database interaction

Created 3 months ago
261 stars

Top 97.4% on SourcePulse

GitHubView on GitHub
Project Summary

<2-3 sentences summarising what the project addresses and solves, the target audience, and the benefit.> This project offers a production-ready, Cloudflare-native MCP server template for secure, authenticated PostgreSQL database interaction via GitHub OAuth. It targets developers building MCP applications and power users needing AI-driven data access, providing a scalable and robust solution.

How It Works

The server integrates directly with PostgreSQL, enabling schema discovery, read-only queries, and write operations through GitHub OAuth. Its modular architecture defines tools in separate files for maintainability and extensibility. It supports streamable HTTP (/mcp) and legacy Server-Sent Events (/sse) protocols, recommending /mcp for performance. User permissions are GitHub username-based: all authenticated users can read, while only a configurable set can write.

Quick Start & Requirements

  • Installation: Node.js and wrangler CLI (npm install -g wrangler). Authenticate Cloudflare (wrangler login). Clone repo, install dependencies (npm install .).
  • Prerequisites: Cloudflare account, GitHub account, PostgreSQL database.
  • Configuration: Set environment variables in .dev.vars (GitHub OAuth, encryption key, DATABASE_URL). Requires GitHub OAuth App and encryption key generation.
  • Local Dev: wrangler dev. Test with MCP Inspector (npx @modelcontextprotocol/inspector@latest) at http://localhost:8792/mcp.
  • Production: Deploy via wrangler deploy after configuring Cloudflare KV and secrets.
  • Links: MCP Inspector

Highlighted Details

  • Database Integration: Direct PostgreSQL connection with automatic schema discovery.
  • Security: Role-based access via GitHub usernames for writes; built-in SQL injection protection.
  • Modularity: Single-purpose tools in src/tools/ for easy extension.
  • Cloud Native: Deploys globally on Cloudflare Workers.
  • Transport: Streamable HTTP (/mcp) and SSE (/sse).

Maintenance & Community

The README lacks details on specific contributors, community channels, or roadmap links.

Licensing & Compatibility

The repository's license is not explicitly stated, a critical omission for adoption. It's designed for Cloudflare Workers and compatible with MCP clients like Claude Desktop and Cursor, though client-specific caveats apply.

Limitations & Caveats

License is unspecified. Claude Desktop integration may have authentication issues. Cursor requires specific configurations. Database write access is controlled by a hardcoded list of GitHub usernames in source code, necessitating redeployment to modify.

Health Check
Last Commit

3 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
16 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems") and Ishaan Jaffer Ishaan Jaffer(Cofounder of LiteLLM).

llm-gateway by wealthsimple

0%
251
Secure LLM gateway for multiple providers
Created 2 years ago
Updated 3 months ago
Feedback? Help us improve.