Skip to main content
Glama
MCP Database Server

MCP Database Server

by Zyrex24

MCP Database Server

A Model Context Protocol (MCP) server that provides secure database access through GitHub OAuth authentication. This server enables AI assistants to interact with PostgreSQL databases with role-based permissions.

Server URL

Production Server: https://my-mcp-server.azxdawre.workers.dev/mcp

Related MCP server: Postgres Scout MCP

Features

  • πŸ—„οΈ PostgreSQL Integration: Direct database connection for all MCP tool calls

  • πŸ” GitHub OAuth Authentication: Secure user authentication via GitHub

  • πŸ›‘οΈ Role-Based Access Control: Username-based permissions for database operations

  • πŸ“Š Schema Discovery: Automatic table and column information retrieval

  • πŸ›‘οΈ SQL Injection Protection: Built-in validation and sanitization

  • ☁️ Cloudflare Workers: Global scale and performance

Available Tools

1. listTables (All Authenticated Users)

Discover database schema, tables, columns, and relationships.

2. queryDatabase (All Authenticated Users)

Execute read-only SQL queries (SELECT statements only).

3. executeDatabase (Privileged Users Only)

Execute write operations (INSERT, UPDATE, DELETE, DDL) - restricted to authorized GitHub usernames.

How to Use

With Claude Desktop

Add this configuration to your Claude Desktop settings (Settings -> Developer -> Edit Config):

{
  "mcpServers": {
    "database": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://my-mcp-server.azxdawre.workers.dev/mcp"
      ]
    }
  }
}

With MCP Inspector

Test the server using the MCP Inspector:

npx @modelcontextprotocol/inspector@latest

Enter the server URL: https://my-mcp-server.azxdawre.workers.dev/mcp

Authentication Flow

  1. Connect to the MCP server

  2. Authenticate via GitHub OAuth when prompted

  3. Tools become available based on your GitHub username permissions

  4. Start querying your database through AI assistants

Security Model

  • Read Access: All authenticated GitHub users can query data

  • Write Access: Only specific GitHub usernames can modify data

  • SQL Protection: All queries validated to prevent injection attacks

  • User Tracking: All operations logged with GitHub user context

Example Usage

Once connected, you can ask your AI assistant:

  • "What tables are available in the database?" β†’ Uses listTables

  • "Show me all users created this month" β†’ Uses queryDatabase

  • "Add a new product with name 'Widget' and price 29.99" β†’ Uses executeDatabase (if authorized)

Transport Protocols

  • /mcp - Modern streamable HTTP transport (recommended)

  • /sse - Legacy Server-Sent Events transport (backward compatibility)


Powered by Cloudflare Workers with PostgreSQL integration and GitHub OAuth

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to interact with PostgreSQL databases using natural language queries, providing secure read-only access to database schemas and SQL translation capabilities.
      6
      ISC
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to safely explore, analyze, and maintain PostgreSQL databases with read-only mode by default, SQL injection prevention, query performance analysis, and optional write operations.
      67 npm
      Apache 2.0
    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Provides AI assistants with safe, controlled access to PostgreSQL databases with read-only defaults, granular permissions, query safety features, and schema introspection capabilities.
      1
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables you to chat with your PostgreSQL database via natural language, with GitHub OAuth authentication and role-based access control for secure read/write operations.
      MIT