mcp-bd-readonly
Provides read-only access to a MySQL database (the back database), enabling inventory and invoicing queries such as listing tables, describing schemas, running SELECT queries, and financial reporting.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-bd-readonlyShow me pending payments and the total outstanding amount."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-bd-readonly
Servidor MCP (Model Context Protocol) de solo lectura sobre una base de datos MySQL (esquema back). Expone herramientas para consultas de inventario/facturación sin ningún acceso de escritura.
Módulo autocontenido: este servidor es solo MySQL (back). No depende de zero-teams-mcp (Teams/Graph) ni de ningún otro MCP. En configs de cliente se registra de forma independiente; activar/desactivar otros MCPs no lo afecta.
Seguridad: combinación de barreras
Parser en MCP (
security.py) — toda query pasa porenforce_read_only()enQueryExecutor.run()antes de abrir conexión. Vetainsert|update|delete|drop|truncate|alter|replace|create|grant|revoke|renameen cualquier statement (incluye statements encadenados con;y precedidos por comentarios). SoloSELECT / SHOW / DESCRIBE / DESC / EXPLAIN / WITH.Driver sin multi-statement (
pymysql) —CLIENT.MULTI_STATEMENTSdesactivado por defecto: siquieraSELECT 1; SELECT 2es rechazado por el driver (1064) antes de llegar a MySQL. UnSELECT 1; DROP TABLE xademás lo veta el parser.Usuario MySQL dedicado de solo lectura — con GRANT SELECT únicamente sobre
back.*, conecta por TCP127.0.0.1:3306(vía túnel SSH al host configurado enTUNNEL_HOST). CualquierUPDATE/INSERT/DELETEfalla incluso si el parser se evadiera:ERROR 1142 (42000): UPDATE command denied to user '...'@'localhost'. Verificado contra la BD real.
Si el parser falla, MySQL niega; si MySQL falla, el parser niega. Sin usuario de escritura configurado.
Related MCP server: mcp-sqlserver-readonly
Requisitos
Python 3.10+ (venv en
.venv)Acceso SSH al host remoto de MySQL (alias
db-hosten~/.ssh/config, configurable conSSH_HOST/TUNNEL_HOST)~/.zt-readonly.env(modo 600) con las credenciales:MYSQL_HOST=127.0.0.1 MYSQL_PORT=13306 MYSQL_DB=back MYSQL_USER=back_readonly MYSQL_PASSWORD=... DATA_DIR=./data TUNNEL_HOST=db-hostNo se invalida si el archivo no existe; las variables de entorno
MYSQL_*/DATA_DIR/TUNNEL_HOSTganan sobre el archivo. En Windows el archivo cae en%USERPROFILE%\.zt-readonly.env.
Soporte Windows: el código es portable (pathlib + pymysql + os.environ, sin rutas Unix). Diferencias: entry point en .venv\Scripts\mcp-bd-readonly.exe, túnel con scripts/tunnel.ps1. Instrucción completa para Claude en SETUP-WINDOWS.md.
Uso
Preparar SSH (solo una vez, antes del primer túnel). Si no existe la clave
~/.ssh/id_ed25519ni el hostdb-hosten~/.ssh/config, genera ambos automáticamente — solo pide tu email:bash scripts/setup-ssh.shConfigura los valores reales con
SSH_HOST/SSH_HOSTNAME/SSH_KEY/SSH_USER(o defaults en~/.ssh/config). Al final imprime la clave pública para añadirla al servidor (1 paso manual). Verificado:ssh db-host 'echo OK'.Ejecutar el servidor MCP (stdio). El túnel SSH se gestiona solo: si
127.0.0.1:13306no responde, el MCP lanzassh -N -L 13306:127.0.0.1:3306 db-hostcomo subproceso y lo cierra al terminar:.venv/bin/mcp-bd-readonly # macOS/Linux .venv\Scripts\mcp-bd-readonly.exe # WindowsPara arranque manual previo del túnel (opcional, si quieres voz propia sobre la conexión):
scripts/tunnel.sh # macOS/Linuxscripts\tunnel.ps1 # Windows
El host SSH a usar por el auto-túnel se configura con TUNNEL_HOST (default: host en ~/.zt-readonly.env o db-host).
Herramientas
Núcleo (Tabularis):
list_databases— bases visibleslist_tables(schema?)— tablas de un schema (defaultback)describe_table(table)— columnas de una tablarun_query(query, limit=100)— SELECT/SHOW/DESCRIBE libre con límite. Query correctas verificadas contra BD real:SELECT(con JOIN, WHERE, GROUP BY, subqueries,UNION),WITH(CTE),SHOW TABLES,DESCRIBE/DESC,EXPLAIN SELECT, y consultas precedidas por comentarios--.EXPLAIN UPDATEpasa el parser pero lo niega MySQL (1142, barrera #3). ElLIMITse inyecta en SQL solo paraSELECT/WITHde un statement; paraSHOW/DESCRIBEtrunca en Python tras traer filas.
Finanzas:
facturas_venta(fecha_desde, fecha_hasta, cliente?)— facturas y total del periodo (Decimal exacto + formato es-ES1.234,56 €)resumen_iva(trimestre, anio)— base/IVA/total del trimestreremesas_pendientes(max_n=50)— efectos de pago sin pagar, porfecha_vencimientoASC (límitemax_n) + total de pendientes.fecha_vencimientopuede sernullen BD real (efectos sin vencimiento).cuadre_factura(factura_id)— comprueba que la suma de líneas == total de cabecera. Factura inexistente →ok:false,exists:false.
Auditoría:
conciliar_remesas()— total emitido vs acreditado (fecha_pagado IS NOT NULL)saldos_cliente(cliente_id)— facturado vs cobrado (víavista_efectos_pago) y pendienteexcepciones(fecha_desde, fecha_hasta, umbral)— facturas sobre umbral clasificadas por materialidadinforme_financiero(fecha_desde, fecha_hasta)— informe Markdown + CSV (;)
Aritmética
Todo el dinero es Decimal (nunca float). Sumas exactas con quantize(0.01, ROUND_HALF_UP); strings es-ES separador de miles . y decimal ,.
Auditoría de acceso
Cada llamada a tool registra una línea JSON en data_dir/audit.jsonl (DATA_DIR). No contiene credenciales.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
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
- dataOAuthco.thinair
Read-only PostgreSQL, MySQL, SQL Server access via MCP — 24 dialect-aware hosted tools.
Read-only MCP access to a documented IT fleet: state, changes, posture. 15 tools.
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
Read-only MCP access to sessions, funnels, campaigns, errors, live visitors, and anomalies.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables safe interaction with MySQL databases through SELECT queries, table structure inspection, and database schema exploration. Provides read-only access to query data and examine database metadata.1-
- AlicenseNot gradedqualityDmaintenanceRead-only SQL Server MCP server enabling safe database queries, table listing, and schema inspection with built-in security protections.MIT
- FlicenseNot gradedqualityDmaintenanceProvides read-only access to MySQL databases, enabling schema exploration, table inspection, and safe SELECT query execution via MCP.1-
- FlicenseAqualityAmaintenanceSecurity-hardened, read-only MySQL MCP server that enables safe, read-only access to MySQL databases for running SELECT queries, exploring schemas, and sampling data via MCP clients.9-
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/noemartinezoptima/mcp-bd-readonly'
If you have feedback or need assistance with the MCP directory API, please join our Discord server