All posts

Production access control for MCP servers on MySQL

How can you enforce production access control for MySQL‑backed MCP servers without exposing credentials or losing visibility? In many organisations, engineers and automated agents reach a MySQL instance directly using a shared username and password that lives in configuration files or secret stores. The connection is opened over the native MySQL wire protocol, and the client talks straight to the database. Because the request bypasses any enforcement point, there is no real‑time audit of which

Free White Paper

MySQL Access Governance + Customer Support Access to Production: The Complete Guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free. No spam. Unsubscribe anytime.

How can you enforce production access control for MySQL‑backed MCP servers without exposing credentials or losing visibility?

In many organisations, engineers and automated agents reach a MySQL instance directly using a shared username and password that lives in configuration files or secret stores. The connection is opened over the native MySQL wire protocol, and the client talks straight to the database. Because the request bypasses any enforcement point, there is no real‑time audit of which statements were run, no ability to block dangerous commands, and no way to mask sensitive columns that might be returned to a downstream service.

Moving to non‑human identities, service accounts, OIDC tokens, or short‑lived IAM credentials, adds a layer of least‑privilege authentication. The gateway can verify that the caller is authorized to obtain a database credential, and the credential itself can be scoped to a specific role. However, the request still travels directly to MySQL. The database sees the raw SQL, the connection is not recorded, and any accidental data leakage or rogue query runs unchecked.

What is missing is a control surface that sits on the data path, inspects each statement, and applies production access control policies before the query reaches the server. That control surface must be able to enforce just‑in‑time approvals, mask fields in query results, and retain a complete record of every session for later review.

Why production access control matters for MySQL MCP servers

MySQL often stores customer‑identifying information, financial figures, or configuration data that should never be exposed to an untrusted component. In a production environment, a single stray UPDATE or SELECT can corrupt data, leak personal information, or trigger downstream failures. Enforcing production access control means that every read or write operation is vetted against a policy that reflects the business’s risk appetite.

The missing guardrails in a typical setup

Without a gateway, the following gaps are common:

  • Static credentials are reused across teams, increasing the blast radius of a leak.
  • There is no per‑statement audit; compliance teams cannot prove who ran which query.
  • Sensitive columns such as credit‑card numbers are returned in clear text to any caller that can connect.
  • Dangerous commands like DROP DATABASE or massive DELETE statements can be executed without any human review.

These gaps persist even after you adopt short‑lived service identities, because the enforcement point remains inside the database process.

Continue reading? Get the full guide.

MySQL Access Governance + Customer Support Access to Production: Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

Introducing an access gateway

hoop.dev provides a Layer 7 gateway that sits between the caller and the MySQL server. The gateway terminates the native MySQL wire protocol, inspects each packet, and applies policies before forwarding the request to the backend. Because the gateway is the only path to the database, it becomes the authoritative place for production access control.

How hoop.dev enforces production access control

hoop.dev validates the caller’s OIDC or SAML token, extracts group membership, and maps that identity to a least‑privilege database role. Once the identity is verified, hoop.dev records the session, applies inline masking to any column that matches a sensitivity rule, and checks each statement against an approval workflow. If a statement exceeds a risk threshold, such as a DROP, ALTER, or a massive UPDATE, hoop.dev routes the request for human approval before it reaches MySQL.

Key enforcement capabilities

  • Just‑in‑time approvals: hoop.dev pauses high‑risk statements and requires an authorized reviewer to approve them in real time.
  • Inline data masking: Sensitive fields are redacted in the response stream, ensuring downstream services never see raw values.
  • Command‑level audit: Every SQL statement, along with the authenticated identity, is logged and stored for replay.
  • Session recording: hoop.dev captures the full bidirectional traffic so you can replay a session exactly as it occurred.
  • Guardrails for destructive commands: hoop.dev blocks statements that match a blacklist unless explicitly approved.

Getting started with production access control for MySQL

To try this approach, deploy the hoop.dev gateway using the Docker Compose quick‑start. The compose file pulls the gateway image, configures OIDC authentication, and starts a network‑resident agent that can reach your MySQL instance. Register the MySQL connection in the gateway UI, supply the host, port, and a credential that the gateway will protect, and define the masking and approval policies that match your production risk model.

Detailed step‑by‑step guidance is available in the getting‑started guide. The guide walks you through provisioning the gateway, linking it to your identity provider, and creating the MySQL connection profile. For deeper insight into masking rules, approval workflows, and audit‑log retrieval, explore the learn section of the documentation.

When you are ready to explore the source code, contribute, or customize the gateway, the repository is hosted on GitHub at https://github.com/hoophq/hoop.

FAQ

Q: Does hoop.dev replace existing MySQL users?
A: No. hoop.dev authenticates callers before it obtains a database credential from its own store. The underlying MySQL user remains unchanged; hoop.dev simply mediates access.

Q: Can I still use my existing monitoring tools?
A: Yes. hoop.dev forwards traffic after policy checks, so standard MySQL metrics and monitoring continue to work. The additional audit logs are available through hoop.dev’s own logging endpoints.

Q: How does hoop.dev handle high‑throughput workloads?
A: The gateway operates at the protocol layer and is designed to scale horizontally. You can run multiple gateway instances behind a load balancer to handle production traffic while preserving the same enforcement guarantees.

Open source

Save the open-source gateway for agent data access

Hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.

Star and save the repo →More posts