Universal Database MCP
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 不能使用 127.0.0.1 或 localhost 来连接你电脑上的 MySQL。在 Render 中,localhost 指的是 Render 服务器本身。
对于本地数据库,你需要运行一个本地连接器作为安全桥梁。当前这个第一版已经准备好了远程 API;Local Connector 是项目的第二个组件。
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. 安全性
此版本使用静态 bearer token 来保护远程端点。数据库 URL 仅保存在进程内存中,并在响应中以脱敏形式显示。
数据库凭据实际上决定了可以执行哪些操作。ejecutar_sql_admin 可以使用该账户的权限执行任意 SQL,因此要求 confirmar=true。
对于多用户/多智能体的生产环境,建议用 OAuth 2.1/JWT 取代全局 token,并按用户身份隔离连接。
This server cannot be installed
Maintenance
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
Read-only PostgreSQL, MySQL, SQL Server access via MCP — 24 dialect-aware hosted tools.
One MCP URL for all your connectors — scoped writes, enforced constraints, and a full audit trail.
Hosted MCP server for AI-driven data ops. Create apps, manage schemas, and CRUD structured data.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables 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.519MIT
- AlicenseNot gradedqualityDmaintenanceEnables 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.83MIT
- AlicenseNot gradedqualityAmaintenanceEnables MCP-compatible clients to interact with PostgreSQL databases with multi-database support and connection pooling.131MIT
- FlicenseNot gradedqualityCmaintenanceEnables remote database access (RDBMS and MongoDB) through MCP tools, supporting read/write queries, schema management, and more.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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