neverinfamous

db-mcp

Community neverinfamous
Updated

Secure Database MCP Server featuring a V8 Isolate Code Mode sandbox that unifies 181+ tools, delivering 70-90% token savings. Built for enterprise with HTTP/SSE transports, OAuth 2.1, dynamic filtering, granular RBAC, audit logging, deterministic error handling, Prometheus metrics, and encryption at rest for maximum observability and safety.

db-mcp

โš ๏ธ UNDER DEVELOPMENT - This project is actively being developed and is not yet ready for production use.

License: MITCodeQL

A multi-database Model Context Protocol (MCP) server written in TypeScript, featuring OAuth 2.0 authentication, tool filtering, and granular access control.

Features

  • ๐Ÿ” OAuth 2.0 Authentication - Secure access with token-based authentication
  • ๐Ÿ›ก๏ธ Tool Filtering - Control which database operations are exposed
  • ๐Ÿ‘ฅ Access Control - Limit users to read-only operations or specific databases
  • ๐Ÿ—„๏ธ Multi-Database Support - Connect to multiple database types simultaneously
  • โšก Code Mode Architecture - Built using the MCP SDK for maximum flexibility

Architecture

This server is built in Code Mode using the official MCP TypeScript SDK, rather than using stdio-based configuration. This architectural choice enables:

Capability Benefit
Dynamic Tool Registration Register/unregister database tools at runtime based on user permissions
OAuth 2.0 Integration Implement authentication middleware before tool execution
Per-Request Context Access user identity, scopes, and database restrictions per request
Tool Filtering Programmatically control which tools are available to each user
Multi-Tenancy Support multiple users with different database access levels
// Code Mode allows programmatic server control
import { Server } from '@modelcontextprotocol/sdk/server';

const server = new Server({
  name: 'db-mcp',
  version: '1.0.0'
});

// Dynamic tool registration based on user permissions
server.setRequestHandler(ListToolsRequestSchema, async (request) => {
  const userScopes = await validateOAuthToken(request);
  return { tools: getToolsForScopes(userScopes) };
});

Supported Databases

Database Status Priority
SQLite ๐Ÿ”„ Planned High
MySQL ๐Ÿ”„ Planned High
PostgreSQL ๐Ÿ”„ Planned High
MongoDB ๐Ÿ”„ Planned High
Redis ๐Ÿ”„ Planned High
SQL Server ๐Ÿ”„ Planned Low

Installation

# Coming soon
npm install db-mcp

Usage

# Coming soon

OAuth 2.0 Access Control

The server supports granular access control through OAuth 2.0 scopes:

Scope Description
read Read-only access to all databases
write Read and write access to all databases
admin Full administrative access

Planned Features

  • Database-level restrictions - Limit users to specific databases
  • Table-level restrictions - Limit users to specific tables within databases
  • Operation-level filtering - Allow/deny specific SQL operations

Roadmap

  • Core MCP server implementation
  • SQLite adapter
  • MySQL adapter
  • PostgreSQL adapter
  • MongoDB adapter
  • Redis adapter
  • OAuth 2.0 integration
  • Tool filtering system
  • Access control layer
  • SQL Server adapter

Contributing

Contributions are welcome! Please read our Contributing Guidelines before submitting a pull request.

Security

For security concerns, please see our Security Policy.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Code of Conduct

Please read our Code of Conduct before participating in this project.

MCP Server ยท Populars

MCP Server ยท New

    Sam-AEC

    AEC Model Bridge

    Independent Revit MCP ( Model Context Protocol integration for Revit software ).

    Community Sam-AEC
    TheAlgorithms

    The Algorithms - Dart

    All Algorithms implemented in Dart

    Community TheAlgorithms
    memi-design

    memi

    Memi is the read-only design engineering audit and skill layer for coding agents.

    Community memi-design
    rwestergren

    cronometer-api-mcp

    MCP server for Cronometer nutrition tracking via the mobile REST API

    Community rwestergren
    dinglebear-ai

    Unraid

    Query, monitor, and manage Unraid servers via GraphQL API through MCP tools. Supports system info, Docker, VMs, array/parity, notifications, plugins, rclone, and live telemetry.

    Community dinglebear-ai