How to Configure JetBrains AI MySQL MCP Server

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a jetbrains ai mysql mcp server by linking the local tool to your database. You register the Model Context Protocol binary in your IDE settings and supply database keys. Many teams start by giving the local server process a broad database user account. This approach gets the coding assistant working fast during early tests. Still, broad permissions let the model run any query or change live tables without a check. A single bad prompt can drop a table or pull private customer records i

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

You set up a jetbrains ai mysql mcp server by linking the local tool to your database. You register the Model Context Protocol binary in your IDE settings and supply database keys. Many teams start by giving the local server process a broad database user account. This approach gets the coding assistant working fast during early tests. Still, broad permissions let the model run any query or change live tables without a check. A single bad prompt can drop a table or pull private customer records into the chat.

How the jetbrains ai mysql mcp server works

The Model Context Protocol links your IDE coding assistant to outside data sources. The IDE runs the MCP server as a local background process on the developer machine. When a developer asks a question about the schema, the assistant checks its registered tools. It picks the MySQL tool and sends a structured request to the local server process. That local process reads the database host, user, and password from local settings files.

Next, the server opens a standard MySQL session using those saved static keys. It translates the tool request from the assistant into a raw SQL statement. The database checks the user role tied to that session and runs the SQL query. The local server receives the rows back from the database engine. It formats the data into text and sends the result back to the IDE chat window. The assistant reads the returned rows and writes an answer for the developer.

Why you should restrict the database role

Database admins should create a dedicated MySQL user just for the coding assistant. You should never reuse a root account or an app service account for IDE tools. Grant this dedicated user read permissions only on the specific schemas the developer needs. If the assistant only helps write queries, it only needs to read table structures and sample rows. It does not need permission to drop tables, change schemas, or delete rows.

You can also limit which tables the assistant account can read inside a shared database. Revoke select permissions on tables that hold user passwords, billing records, or tax data. MySQL also lets you set resource limits on the dedicated user account. You can cap the number of queries per hour and limit active connections. This stops a runaway loop in the assistant from overloading your database server.

MySQL Access Governance + Kubernetes API Server Access: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native MySQL permissions leave open

Setting up a read-only MySQL user is a great first step for safety. It blocks the assistant from changing data or dropping tables by mistake. Still, native database roles only check who logs in and which tables they can read. They do not inspect what individual queries do in flight during an active session.

Once a table is open to the user role, the assistant can read every column inside it by default. If an orders table includes emails, phone numbers, or card numbers, those fields return in plain text. The local MCP server passes those raw fields straight into the IDE context window. From there, private customer data gets sent to the remote model provider. Also, storing static database keys in local IDE files creates a risk on every laptop. If a developer machine is lost, an attacker can take those saved database passwords. Standard database logs also tie every query to the shared assistant user, not the human developer.

Check MySQL queries and results on the wire

MySQL grants control who logs in. They do not check single queries or mask sensitive columns once a session starts. With hoop.dev, you run an open-source proxy, a sidecar for your MySQL. It runs next to MySQL, RDS, or Aurora and reads the MySQL wire protocol.

Multi-statement batches and prepared queries are split and checked one by one by hoop.dev guardrails. When a rule refuses a query, MySQL returns a native error packet with your message. On the response path, hoop.dev data masking rewrites string values in returned rows that match your rules. Every query and decision is logged per resource. See the MIT-licensed project on GitHub.

Frequently asked questions

Can I use a read-only MySQL user for the MCP server?

Yes, a read-only user is the safest native way to set up the tool. It lets the assistant inspect schemas and run select queries while blocking writes and table drops.

Where do database passwords live in a standard local setup?

In a standard setup, database keys sit in plain text inside local IDE settings files. Any local process or user on that workstation can read those saved credentials.

Does a read-only MySQL role stop private data from reaching the model?

No, a read-only role still returns all columns from allowed tables in plain text by default. You need dynamic data masking to rewrite emails, phone numbers, or card numbers in query results.

The query runs. The emails stay hidden.