Custom MCP Database logo

Custom MCP Database

Run alias-based SQL and MongoDB queries against PostgreSQL, MySQL, Oracle, and MongoDB while keeping credentials outside the model.

Install Custom MCP Database

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "custom-mcp-database": {
      "command": "uvx",
      "args": [
        "custom-mcp-database"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Automated check passed— started and listed 4 tools correctly (Today).

Overview

The custom-mcp-database MCP server connects AI agents to PostgreSQL, MySQL, MongoDB, and Oracle through locally configured aliases. It exposes tools for listing aliases, executing SQL or MongoDB filters, listing MongoDB collections, and checking the active security policy, while credentials remain in local configuration. Reach for it when an agent needs database access without receiving connection details, especially in read-only workflows.

Use cases

  • Query reporting databases by alias
  • Inspect MongoDB collections and filtered documents
  • Keep database credentials outside agent context
  • Run read-only database investigations
  • Check active database security controls

Key features

  • Alias-based connections
  • PostgreSQL, MySQL, MongoDB, and Oracle support
  • Read-only mode by default
  • SQL and MongoDB filter execution
  • Local credential references
  • Security policy reporting

Tools4

What Custom MCP Database lets your agent do. Expand a tool for its parameters.

Verified live~509 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 1d ago

Recent health check succeeded.

7/7 checks healthy over the last 39d

What it can do

From the 4 tools this server returned when we ran it; 4 declare their own safety hints.

Runs commands · 1Can delete or modify data · 1Makes network requests · 2Read-only tools · 3
Network at startup2 connections
Files written at startup14

Observed 2026-10-22 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 11d ago via OSV.dev · custom-mcp-database (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars3Stargazers on the source repository.
Last commit2mo agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed4Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Custom MCP Database works

What custom-mcp-database does

The custom-mcp-database MCP server lets an MCP client query PostgreSQL, MySQL, MongoDB, and Oracle connections by alias. A person creates and manages those aliases with the command-line interface; the model receives only the alias when it invokes a database operation. Connection hosts, usernames, and passwords are resolved inside the server process rather than passed as MCP arguments.

The default posture is read-only. SQL execution is limited to SELECT-class statements unless write and DDL controls are explicitly enabled. MongoDB operations use a JSON filter and collection name, with additional validation intended to block server-side JavaScript and empty filters.

How it works

The server runs over stdio and can be launched with uvx custom-mcp-database run. On first use, uvx fetches the package from PyPI. MCP clients send tool calls containing an alias and query-related parameters. The server loads the matching local connection configuration, connects to the selected database, applies its policy checks, and returns the result.

Aliases and connection settings are stored in a local SQLite file. The default path is ~/.config/custom-mcp-database/mcp_config.sqlite3; MCP_DB_CONFIG can change it. The file is created with mode 0600, but it is not encrypted. If a literal password or URI is saved, it is stored as plaintext JSON. Environment-variable and file references avoid putting those secrets directly in the configuration.

Setup and configuration

Install and configure connections from a terminal, not through the agent. The guided setup command is:

bash
uvx custom-mcp-database setup

The add-db command supports PostgreSQL, MySQL, MongoDB, and Oracle. Passwords or MongoDB URIs can be entered through hidden prompts, read from environment variables, or loaded from files. list-aliases confirms configured aliases, and remove-db deletes one.

Configure the MCP client with the stdio command uvx custom-mcp-database run. The README provides examples for Claude Code, Claude Desktop, Cursor, VS Code, Windsurf, and Gemini CLI. Other clients that support stdio can use the same command and arguments.

Tools and capabilities

The custom-mcp-database MCP server exposes four tools:

  • db_list_aliases lists configured aliases and their database types.
  • db_execute_query runs SQL or a MongoDB JSON filter.
  • db_list_collections lists MongoDB collections.
  • db_security_status reports the current security policy.

SQL calls are single statements, use parameterized binds, and do not automatically add a result limit. Results are capped by MCP_DB_MAX_ROWS, which defaults to 1,000. MongoDB results are capped at 10 by the operation's limit, and 24-character hexadecimal values can be converted to ObjectId values.

Limitations and notes

Writes are disabled by default. Enabling them requires MCP_DB_READONLY=0 and MCP_DB_ALLOW_WRITES=1; DDL additionally requires MCP_DB_ALLOW_DDL=1. Administrative MCP tools for adding and removing databases are not exposed by default. If enabled with MCP_DB_ALLOW_ADMIN_TOOLS=1, the add operation accepts secret references rather than literal secrets.

Application checks are defense-in-depth, not a replacement for least-privilege database accounts, TLS, or host protection. The local credential database is plaintext and should be protected with encrypted disk storage. Review the live policy with db_security_status or the CLI security-status command before connecting an agent to sensitive data.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Custom MCP Database

custom-mcp-database is an MCP server that connects AI agents to PostgreSQL, MySQL, MongoDB, and Oracle through local aliases. Its main tools list aliases, execute SQL or MongoDB filters, list MongoDB collections, and report security status. Credentials stay in local configuration and are not exposed as model-visible tool arguments.

Run `uvx custom-mcp-database run` in the MCP client's stdio configuration. The command requires `uv` and retrieves the package from PyPI on first run. The README includes configuration examples for Claude Code, Claude Desktop, Cursor, VS Code, Windsurf, and Gemini CLI.

Configure credentials from a terminal with `uvx custom-mcp-database setup` or `uvx custom-mcp-database add-db`. Passwords and URIs can be entered through hidden prompts or referenced through environment variables and files. The agent uses the resulting alias and does not install credentials.

Writes are disabled by default. To allow INSERT, UPDATE, or DELETE operations, set `MCP_DB_READONLY=0` and `MCP_DB_ALLOW_WRITES=1`; DDL also requires `MCP_DB_ALLOW_DDL=1`. The server supports checking the current policy with `db_security_status`.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewCustom MCP Database AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/custom-mcp-database?style=directory)](https://allmcps.com/mcp/custom-mcp-database)
HTML Embed
<a href="https://allmcps.com/mcp/custom-mcp-database"><img src="https://allmcps.com/api/badge/custom-mcp-database?style=directory" alt="Custom MCP Database on AllMCPs" /></a>