Skip to main content
Glama
Shreyansh-awasthi

Universal Safe Database MCP Toolbox

Universal Safe Database MCP Toolbox

A secure, universal, and privacy-first Model Context Protocol (MCP) server that empowers AI models to securely analyze SQLite datasets and view local text documents without risking data leaks, unauthorized alterations, or prompt injection exploits.

Core Features

  • Read-Only Enforcement: Strict internal whitelist filters block dangerous SQL statements (DROP, DELETE, UPDATE, INSERT) instantly, shielding datasets from destructive mutations.

  • Dynamic Schema Discovery: Automatic multi-step scanning discovers table architecture dynamically, eliminating model hallucinations.

  • Automated Row Pagination: Enforces a rigid ceiling of 50 rows per page to prevent high token expenses and memory overhead on large production tables.

  • Local Privacy Isolation: Operates 100% locally via standard input/output (stdio). Your raw database files never travel to cloud networks or outside environments.

  • Query Timeout Bounds: Integrated 3-second runtime safety abort thresholds shield host CPU memory assets against recursive recursive table join locking loops.

Related MCP server: shop-sql-mcp

Repository Layout

πŸ“ secure-database-mcp/
  └── πŸ“ Universal_safe_db/
        β”œβ”€β”€ mcp_server.py      # Core Python server logic
        β”œβ”€β”€ requirements.txt   # Application dependencies
        └── README.md          # Project documentation

Setup & Testing

1. Installation

Install project requirements via your local prompt environment:

pip install -r requirements.txt

2. Launch Local Debug Inspector

You can test and run your tool visually inside a free local web pane in your browser using the official MCP Inspector. Run the following command, passing your target database file at the end:

npx @modelcontextprotocol/inspector@latest python mcp_server.py /path/to/your/dataset.db

3. Registering with Cursor IDE

To leverage this toolbox for free inside Cursor, navigate to Settings -> Features -> MCP, click Add New MCP Server, and configure:

  • Name: universal-database-toolbox

  • Type: stdio

  • Command: python

  • Args: "/absolute/path/to/Universal_safe_db/mcp_server.py" "/absolute/path/to/your/dataset.db"

Available Tools

  • list_directory_databases: Scans local paths to auto-discover active SQLite extensions.

  • inspect_dataset_schema: Discovers available tables and structured definitions dynamically.

  • fetch_data_safely: Executes read-only paginated data queries securely.

  • read_file_safely: Reads local text logs or configuration document files cleanly.

License

MIT License. Open-source contribution framework.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants to explore and query SQLite databases through read-only tools, with defense-in-depth sandboxing preventing any data modifications.
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Provides AI agents read-only analytical access to a SQLite database over stdio, with tools for listing tables, describing schemas, and running paginated SQL queries.
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents to safely query and explore SQLite databases through read-only, guard-protected tools that block writes, sensitive table access, and runaway queries.
    1
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Enables read-only document retrieval and SQLite exploration through tools over stdio, enforcing a safety gate before SQL execution.
    3
    MIT