How to Configure Windsurf MariaDB MCP Server

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a windsurf mariadb mcp server by adding the database tool to your agent config file. Next, you give the server a MariaDB user role so the agent can run SQL queries. Many teams start by handing the agent a shared login from their local setup. This quick path gets queries working fast, but broad roles expose sensitive tables to mistakes. If the database role allows write actions, a bad prompt can change or drop real rows. How a windsurf mariadb mcp server works Cognition renamed Wind

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 windsurf mariadb mcp server by adding the database tool to your agent config file. Next, you give the server a MariaDB user role so the agent can run SQL queries. Many teams start by handing the agent a shared login from their local setup. This quick path gets queries working fast, but broad roles expose sensitive tables to mistakes. If the database role allows write actions, a bad prompt can change or drop real rows.

How a windsurf mariadb mcp server works

Cognition renamed Windsurf to Devin Desktop, though it keeps the same IDE and features. Inside the editor, the Cascade agent helps developers write code and talk to outside tools. Cascade can run terminal commands on its own when the user gives permission. It uses a dedicated shell that loads your local aliases and shell variables. It also talks to Model Context Protocol servers that you list in your local settings.

When you add a MariaDB tool to this list, the editor starts the server process. The server reads your database host, port, user name, and password from your local setup. When you ask Cascade a question about your schema, it picks a tool from the server. The server then turns that request into a SQL query and sends it to MariaDB. MariaDB checks the database role, runs the query, and sends the rows back to the editor.

Because the agent loads your shell setup, it can read database keys stored in your profile. Every query the agent makes runs with the exact rights of that MariaDB user account. The database cannot tell if a human typed the query or if the agent wrote it. To the database engine, every prompt looks like a standard client session from that local machine.

What native MariaDB roles solve and what they miss

MariaDB has built-in grants that control which users can log in and read specific tables. You can make a read-only database user so the agent can only run select queries. You can also limit that user to one schema so it stays out of billing tables. These native database grants are a solid first step for any team using AI coding agents.

Still, database login rules only check who starts the session at the table level. They do not inspect what individual queries do in flight or what data comes back. A read-only user can still pull thousands of customer emails, phone numbers, or card numbers. Once those rows return to the MCP server, they flow straight into the model context.

Kubernetes API Server Access + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Native roles also force an all-or-nothing choice when developers need to test schema changes. If you grant alter or delete rights for one task, the agent keeps those rights all day. There is no native way in MariaDB to pause a risky drop command for human approval. Also, database logs only show the shared account name, not which developer or prompt ran the query.

Managing database permissions for AI coding agents

To keep data safe, teams need controls that work at the query level during each session. Start by removing root passwords and wide admin accounts from developer shell files. Give the MCP tool a narrow database role that only touches the tables needed for coding.

Next, think about how sensitive fields flow back to the AI model during debugging. Even in staging databases, tables often hold real emails, phone numbers, and national IDs. Masking rules that rewrite matched fields in results help keep private values out of prompts. Teams also benefit from tying every database query back to an individual user identity for clear logs.

Add wire guardrails and masking beside MySQL

Database grants and TLS setup decide who can reach MySQL. Even so, an open session can run broad updates or read raw personal data from allowed tables. In practice, hoop.dev sits inline in the wire protocol beside the database as a sidecar for your MySQL. On every production query an agent or engineer sends, hoop.dev decides to pass, mask, block, or escalate it for human review.

With hoop.dev MySQL support, guardrails refuse bad queries before they run or hold risky calls for approval, while data masking rewrites matched sensitive values in result rows in memory. Furthermore, hoop.dev holds SOC 2 Type II and generates evidence for GDPR, HIPAA, and PCI DSS programs. Read the docs and source on GitHub.

Frequently asked questions

Did Windsurf change its name to Devin Desktop?

Yes, Cognition renamed Windsurf to Devin Desktop while keeping the same IDE and agent features. Old docs links now point to the Devin Desktop docs, where the Cascade agent is covered.

How does the agent read my MariaDB password?

The MCP server reads connection details from its config file or your local shell variables. Because the agent terminal loads your shell profile, any exported database keys are open to it.

Can a read-only MariaDB user stop data leaks to the AI model?

No, a read-only role only stops the agent from changing or deleting data in your tables. It still lets select queries return raw emails, phone numbers, and card numbers to the agent.

The query runs. The emails stay hidden.