Skip to main content
Glama
Jorge-240

Universal Database MCP

by Jorge-240

Universal Database MCP

Google ADK およびその他の MCP クライアント向けのリモート MCP。URL を使用して MySQL、MariaDB、PostgreSQL に動的に接続し、データベース、テーブル、レコードを管理できます。

1. 要件

  • Python 3.13 推奨。

  • MCP が実行されているマシンからアクセスできる MySQL/MariaDB/PostgreSQL データベース。

  • Render の場合: データベースはインターネットまたは承認されたネットワークからの接続を受け入れる必要があります。

Related MCP server: Read-only Database MCP

2. ローカルでの実行

Windows PowerShell:

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

.env を編集し、MCP_API_KEY を長い秘密の値に変更します。

実行:

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

ヘルスチェック:

http://127.0.0.1:8000/health

MCP:

http://127.0.0.1:8000/mcp

3. MCP Inspector でテストする

別のターミナルで:

npx -y @modelcontextprotocol/inspector

接続先:

http://127.0.0.1:8000/mcp

クライアントでヘッダーを追加します:

Authorization: Bearer TU_MCP_API_KEY

4. 最初の接続

crear_conexion ツールを使用して、たとえば次のように送信します:

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

サーバーは connection_id を返します。その ID を他のすべてのツールで使用します。

5. ローカル MySQL に関する重要事項

Render にデプロイされた MCP は、PC の MySQL に到達するために 127.0.0.1 または localhost を使用できません。Render から見ると、localhost は Render サーバー自身を指します。

ローカル データベースの場合は、安全なブリッジとして機能するローカル コネクタを実行する必要があります。この最初のバージョンではリモート API が準備されており、Local Connector はプロジェクトの 2 つ目のコンポーネントです。

6. Google ADK

設定:

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

そして、examples/adk_agent.py をベースとして使用します。

7. Render

このリポジトリを Web Service として Render に接続できます。

ビルド:

pip install -r requirements.txt

開始:

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

変数:

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

エンドポイントは次のようになります:

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

8. セキュリティ

このバージョンでは、リモート エンドポイントを保護するために静的ベアラー トークンを使用します。データベース URL はプロセスのメモリ内にのみ保持され、レスポンスではマスクされて表示されます。

データベースの資格情報が、実際に可能なアクションを決定します。ejecutar_sql_admin はそのアカウントの権限で任意の SQL を実行できるため、confirmar=true が必要です。

複数のユーザー/エージェントによる本番運用では、グローバル トークンを OAuth 2.1/JWT に置き換え、ユーザー ID ごとに接続を分離することを推奨します。

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