
coleam00/remote-mcp-server-with-auth
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
coleam00/remote-mcp-server-with-auth — это кандидат на MCP-сервер, импортированный из https://github.com/coleam00/remote-mcp-server-with-auth.
Обзор
coleam00/remote-mcp-server-with-auth — это кандидат на MCP-сервер, импортированный из https://github.com/coleam00/remote-mcp-server-with-auth.
Обзор (машинный перевод)
Это сервер Model Context Protocol (MCP), который позволяет общаться с вашей базой данных PostgreSQL, развёртываемой как удалённый MCP-сервер с GitHub OAuth через Cloudflare. Это готовый к производству MCP.
Ключевые особенности
- ** 🗄️ Интеграция баз данных с Lifespan**: прямое подключение к базе данных PostgreSQL для всех вызовов инструментов MCP
- ** 🛠️ Модульные, универсальные инструменты**: Следование лучшим практикам, связанным с инструментами MCP и их описаниями
- ** 🔐 Доступ на основе ролей**: GitHub разрешения на основе имён пользователя для операций по записи базы данных
- ** 📊 Обнаружение схемы**: Автоматический поиск информации по таблицам и столбцам
- ** 🛡️ Защита от инъекций SQL**: встроенная валидация и дезинфекция
- ** 📈 Мониторинг**: Опциональная интеграция Sentry для мониторинга производства
- ** ☁️ Cloud Native**: Работает на Cloudflare Workers для глобального масштаба
Модульная архитектура
Этот MCP-сервер использует чистую, модульную архитектуру, что облегчает его расширение и обслуживание:
src/tools/- Индивидуальные реализации инструментов в отдельных файлахregisterAllTools()- Централизованная система регистрации инструментов- Расширяемый дизайн - Добавлять новые инструменты, создавая файлы в
tools/и регистрируя их
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
README
Показан фрагмент оригинального README. Открыть оригинал.
Cloudflare Remote PostgreSQL Database MCP Server + GitHub OAuth
This is a Model Context Protocol (MCP) server that enables you to chat with your PostgreSQL database, deployable as a remote MCP server with GitHub OAuth through Cloudflare. This is production ready MCP.
Key Features
- 🗄️ Database Integration with Lifespan: Direct PostgreSQL database connection for all MCP tool calls
- 🛠️ Modular, Single Purpose Tools: Following best practices around MCP tools and their descriptions
- 🔐 Role-Based Access: GitHub username-based permissions for database write operations
- 📊 Schema Discovery: Automatic table and column information retrieval
- 🛡️ SQL Injection Protection: Built-in validation and sanitization
- 📈 Monitoring: Optional Sentry integration for production monitoring
- ☁️ Cloud Native: Powered by Cloudflare Workers for global scale
Modular Architecture
This MCP server uses a clean, modular architecture that makes it easy to extend and maintain:
src/tools/- Individual tool implementations in separate filesregisterAllTools()- Centralized tool registration system- Extensible Design - Add new tools by creating files in
tools/and registering them
This architecture allows you to easily add new database operations, external API integrations, or any other MCP tools while keeping the codebase organized and maintainable.
Transport Protocols
This MCP server supports both modern and legacy transport protocols:
/mcp- Streamable HTTP (recommended): Uses a single endpoint with bidirectional communication, automatic connection upgrades, and better resilience for network interruptions/sse- Server-Sent Events (legacy): Uses separate endpoints for requests/responses, maintained for backward compatibility
For new implementations, use the /mcp endpoint as it provides better performance and reliability.
How It Works
The MCP server provides three main tools for database interaction:
listTables- Get database schema and table information (all authenticated users)queryDatabase- Execute read-only SQL queries (all authenticated users)executeDatabase- Execute write operations like INSERT/UPDATE/DELETE (privileged users only)
Authentication Flow: Users authenticate via GitHub OAuth → Server validates permissions → Tools become available based on user’s GitHub username.
Security Model:
- All authenticated GitHub users can read data
- Only specific GitHub usernames can write/modify data
- SQL injection protection and query validation built-in
Simple Example First
Установка
npx mcp-remote https://mcp-github-oauth.<your-subdomain>.workers.dev/mcp