SafeSelect MCP logo

SafeSelect MCP

Read-only PostgreSQL and MongoDB access for coding agents through local MCP stdio.

Install SafeSelect MCP

Run the project’s own setup commands, in order.

Setup steps from the project

SafeSelect MCP installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    brew install antonillos/tap/safeselect
    
  2. 2. Add to your MCP client
    safeselect agent install codex
    

Overview

SafeSelect MCP provides read-only access to PostgreSQL and MongoDB for coding agents over MCP. It discovers tables, collections, indexes, and schema information before allowing targeted reads, while applying local policies, result limits, and timeouts. Connections can be imported from DBeaver, Docker Compose, or MongoDB Compass, including SSH-backed setups, with passwords stored in macOS Keychain or environment variables. Reach for it when an agent needs database context for debugging or query investigation without exposing database write tools.

Use cases

  • Inspect database schema while debugging an application issue
  • Discover PostgreSQL tables and indexes before a targeted read
  • Review MongoDB collections and sample documents for schema inference
  • Import an SSH-backed DBeaver connection for local agent investigation

Key features

  • Read-only PostgreSQL access
  • Read-only MongoDB access
  • Policy-controlled reads with limits and timeouts
  • DBeaver, Docker Compose, and MongoDB Compass imports
  • Local MCP stdio connectivity
  • Keychain or environment-based password storage

Security & health

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

ActiveLast checked

Recent health check succeeded.

15/15 checks healthy over the last 79d

Adoption & maintenance

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

Last commit11d agoMost recent push to the default branch.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How SafeSelect MCP works

What SafeSelect MCP does

SafeSelect MCP gives coding agents a constrained, read-only view of PostgreSQL and MongoDB databases through MCP. Its database tools are intended for debugging, schema inspection, query investigation, and targeted data reads. PostgreSQL support includes catalog-oriented discovery such as listing tables and describing table metadata. MongoDB support includes listing databases and collections, with schema inference available by sampling documents.

The server keeps database access local: agents connect through MCP stdio rather than to an MCP network listener. Its read-only tool boundary remains in place even if the configured database account has write privileges. That boundary applies to SafeSelect's database tools only; an agent's shell, other MCP servers, and separately exposed credentials are outside it.

How it works

SafeSelect validates requests against project policy before sending them to the database. Policies can define project-specific access rules, row limits, and timeouts. Reads are bounded, and query text is hashed for audit records. Ordinary policy violations return errors, while serious security attempts and internal validation or audit failures stop the server.

The security test suites use disposable PostgreSQL and MongoDB fixtures. They exercise SQL writes, stacked statements, side-effecting functions, MongoDB write stages, server-side JavaScript, malformed MCP requests, and access boundaries, then compare rejected-operation results with a database baseline.

Setup and configuration

A Java 17 or newer runtime is required for database commands. On macOS, install the command-line application with Homebrew:

bash
brew install antonillos/tap/safeselect

Connections can be imported from several existing sources:

  • safeselect import-dbeaver ~/Downloads/dbeaver-export.zip
  • safeselect import-compose
  • safeselect import-compass --path "$HOME/.config/MongoDB Compass"

Passwords can remain in macOS Keychain or environment variables instead of project files or agent conversations. Imported DBeaver connections can include SSH-backed configurations. Interactive import supports cancellation and saves the batch only after final confirmation.

Use safeselect check to verify connectivity; this may open SSH tunnels and contact the database. Install the MCP configuration for a client with safeselect agent install <client>, then inspect it with safeselect agent status. The --environment <name> option selects a database environment, and --local requests project scope where supported. safeselect doctor --environment <name> provides the next diagnostic step when setup fails.

Tools and capabilities

  • Exposes read-only PostgreSQL database access.
  • Exposes read-only MongoDB database access.
  • Discovers tables, collections, indexes, and database metadata.
  • Supports targeted row and document reads with bounded results.
  • Applies access policies, read limits, and timeouts before execution.
  • Imports connections from DBeaver, Docker Compose, and MongoDB Compass.

Limitations and notes

SafeSelect does not make an agent's other capabilities read-only. Shell commands, other MCP servers, and direct database credentials remain outside its database boundary. Least-privilege database accounts are recommended, along with development data or a sanitized replica.

MongoDB schema inference samples documents, so using that feature reads data. Connectivity checks and diagnostics also contact the configured database. The local stdio design means SafeSelect does not provide an MCP network listener.

Built-in agent installation supports OpenAI Codex, OpenCode, Claude Code, Cursor, Windsurf, GitHub Copilot, and Gemini CLI. Codex and OpenCode also receive four portable workflow skills. After updating SafeSelect, run safeselect agent upgrade <client> and reload the client.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

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

Frequently Asked Questions about SafeSelect MCP

SafeSelect MCP is an MCP server that connects coding agents to PostgreSQL and MongoDB with read-only database tools. It supports metadata discovery for tables, collections, indexes, and schemas, plus bounded targeted reads. Local policies, result limits, and timeouts control requests, while connections run through MCP stdio.

Install it on macOS with Homebrew using `brew install antonillos/tap/safeselect`. Linux users can follow the project’s installation path for binaries, asdf, Java setup, or source builds. Database commands require Java 17 or newer.

Import an existing connection with the matching SafeSelect command for DBeaver, Docker Compose, or MongoDB Compass. Then run `safeselect check` and install the MCP configuration with `safeselect agent install <client>`. DBeaver imports can include SSH-backed connections.

Yes, Cursor is one of the supported agents. Run `safeselect agent install cursor`, review the resulting status with `safeselect agent status`, and restart or approve the MCP server in Cursor if prompted.

No, SafeSelect exposes read-only database tools for PostgreSQL and MongoDB. It validates requests against local policy and tests rejection of database write operations, but shell access, other MCP servers, and direct credentials remain outside this boundary.

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 PreviewSafeSelect MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/safeselect-mcp?style=directory)](https://allmcps.com/mcp/safeselect-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/safeselect-mcp"><img src="https://allmcps.com/api/badge/safeselect-mcp?style=directory" alt="SafeSelect MCP on AllMCPs" /></a>