Skip to main content
Glama
Jorge-240

Universal Database MCP

by Jorge-240

Universal Database MCP

Remote MCP for Google ADK and other MCP clients. Allows you to dynamically connect MySQL, MariaDB, and PostgreSQL via a URL and manage databases, tables, and records.

1. Requirements

  • Python 3.13 recommended.

  • A MySQL/MariaDB/PostgreSQL database accessible from the machine where the MCP runs.

  • For Render: the database must accept connections from the Internet or from the authorized network.

Related MCP server: Read-only Database MCP

2. Run Locally

Windows PowerShell:

py -3.13 -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
Copy-Item .env.example .env

Edit .env and change MCP_API_KEY to a long secret.

Run:

uvicorn server:app --host 0.0.0.0 --port 8000 --reload

Health:

http://127.0.0.1:8000/health

MCP:

http://127.0.0.1:8000/mcp

3. Test with MCP Inspector

In another terminal:

npx -y @modelcontextprotocol/inspector

Connect to:

http://127.0.0.1:8000/mcp

In the client, add the header:

Authorization: Bearer TU_MCP_API_KEY

4. First Connection

With the crear_conexion tool, send for example:

mysql+pymysql://usuario:password@host:3306/Tareas_sena

The server returns a connection_id. Use that ID in all the other tools.

5. Important Notes About Local MySQL

An MCP deployed on Render cannot use 127.0.0.1 or localhost to reach the MySQL on your PC. From Render, localhost means Render's own server.

For a local DB, you need to run a local connector that acts as a secure bridge. This first version sets up the remote API; the Local Connector is a second piece of the project.

6. Google ADK

Configure:

$env:MCP_URL="https://TU-SERVICIO.onrender.com/mcp"
$env:MCP_API_KEY="TU_TOKEN"

And use examples/adk_agent.py as a base.

7. Render

You can connect this repo to Render as a Web Service.

Build:

pip install -r requirements.txt

Start:

uvicorn server:app --host 0.0.0.0 --port $PORT

Variables:

MCP_API_KEY=<tu-secreto>
MCP_REQUIRE_AUTH=true
PYTHON_VERSION=3.13.5

The endpoint will be:

https://TU-SERVICIO.onrender.com/mcp

8. Security

This version uses a static bearer token to protect the remote endpoint. Database URLs are kept only in process memory and are shown redacted in responses.

The DB credentials actually determine which actions are possible. ejecutar_sql_admin can execute arbitrary SQL with that account's permissions and therefore requires confirmar=true.

For production with multiple users/agents, it is recommended to replace the global token with OAuth 2.1/JWT and isolate connections by user identity.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Enables connecting to and querying multiple database types (PostgreSQL, MySQL, SQLite) through a unified interface. Supports managing multiple concurrent database connections with connection pooling and SQL query execution through MCP tools.
    5
    19
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables read-only access to PostgreSQL and MySQL/MariaDB databases through MCP tools for listing tables, previewing data, and running SELECT queries with a built-in UI for managing database configurations.
    83
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables MCP-compatible clients to interact with PostgreSQL databases with multi-database support and connection pooling.
    13
    1
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables remote database access (RDBMS and MongoDB) through MCP tools, supporting read/write queries, schema management, and more.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Jorge-240/universal-database-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server