Do you want your MySQL‑backed MCP servers to grant access only at the moment a request arrives? Just-in-time access provides that capability by issuing temporary privileges that expire as soon as the operation completes.
Most teams today bake a static username and password into the MCP server configuration or rely on a long‑lived IAM credential that never changes. The credential is checked into source control, shared across environments, and used by every instance of the service. When a developer or an automated job needs to run a query, the request flows directly to MySQL with no intervening gate. The database sees a single identity that has unrestricted read and write rights, and there is no record of who issued which statement, what data was returned, or whether the operation should have been approved.
This approach violates the principle of least privilege and makes it impossible to answer audit questions such as “who read the credit‑card column at 02:15 UTC?” or “did anyone run a DROP TABLE on the production schema?” The lack of a real access boundary also means that a compromised MCP server can immediately exfiltrate data without triggering any alert.
What organizations really need is just‑in‑time access: a mechanism that grants a database connection only for the duration of a specific request, evaluates the request against policy, and then revokes the privilege immediately afterward. The ideal solution would sit between the MCP server and MySQL, inspect each wire‑level command, and enforce policies such as approval workflows, column masking, or command blocking. However, even with that requirement in place the request still reaches MySQL directly, and without a dedicated gateway there is no place to enforce the policy, no audit trail, and no way to mask sensitive fields.
Implementing just-in-time access for MySQL
hoop.dev fulfills the missing piece by acting as a Layer 7, identity‑aware proxy that sits on the network path between the MCP server and the MySQL instance. The gateway verifies the caller’s OIDC or SAML token, extracts group membership, and then applies a policy that can:
- grant a temporary session for the specific request,
- require a human approver for high‑risk statements such as DDL or data‑export commands,
- mask columns that contain personally identifiable information before they are sent back to the client, and
- record the full query and response for replay and audit.
Because hoop.dev speaks the native MySQL wire protocol, the MCP server continues to use its ordinary MySQL client library. The only change is that the connection endpoint points at the gateway instead of the database host. The gateway holds the actual database credential; the MCP server does not have visibility into the password or IAM key. When a request arrives, hoop.dev checks the caller’s identity, consults the policy, and either allows the statement, routes it to an approval queue, or blocks it outright. After the statement finishes, the temporary grant is revoked, ensuring the privilege exists for no longer than the request itself.
Deploying the gateway follows the standard getting‑started guide. A Docker Compose file starts the gateway and a side‑car agent that lives inside the same network segment as MySQL. The administrator registers the MySQL target, supplies the static database user that the gateway will use, and defines a just‑in‑time policy that ties specific MCP service accounts to allowed query patterns. Once the configuration is in place, every MySQL interaction from the MCP server is forced through hoop.dev, turning the gateway into the sole enforcement point.
