Windsurf MCP SQL Server

Published
Length
3 min read

Luis Felipe Dias

All posts

A windsurf mcp sql server setup lets your AI coding agent query databases directly. It links the IDE to your tables through the Model Context Protocol. Engineers use this link so the agent can inspect schemas and check live data. On June 2, 2026, Cognition renamed Windsurf to Devin Desktop with the same features. Its Cascade agent connects to MCP servers and runs terminal commands with user permission. When you connect it to a database, you need strong rules to protect data. How a windsurf mc

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.

A windsurf mcp sql server setup lets your AI coding agent query databases directly. It links the IDE to your tables through the Model Context Protocol.

Engineers use this link so the agent can inspect schemas and check live data. On June 2, 2026, Cognition renamed Windsurf to Devin Desktop with the same features. Its Cascade agent connects to MCP servers and runs terminal commands with user permission. When you connect it to a database, you need strong rules to protect data.

The agent runs on the developer machine and reads local settings to find tools. Its dedicated terminal loads the user shell setup on macOS and Linux. That means local aliases and stored keys are ready for the agent to use. When you add an MCP server for your database, the agent sends SQL queries.

On the database side, each login maps to a database user inside the target database. Admins often create a login in the master database for broad instance access. For one or a few databases, admins can enable contained database users with passwords. A contained user stays inside that database and does not need a master login.

Next, admins assign that database user to a fixed role to control its actions. Every role in the database, including the public role, holds basic connect rights. To give the agent read-only access, admins often pick the fixed data reader role. This setup lets the agent inspect schemas and test queries while you write code.

Security tradeoffs of static roles and local keys

Static database roles and local keys solve basic access, but they leave big gaps. First, storing database passwords on a laptop puts your data at risk. Because the agent loads the user shell, any script or command can read keys. If a developer leaves the team, you must rotate shared passwords right away.

Second, fixed database roles in SQL Server are too broad for AI agents. You cannot change the permissions assigned to a fixed database role. A member of the fixed data reader role can read all user tables. It can also read all views inside that database without any table filters.

Kubernetes API Server Access + SQL Query Filtering: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Even if you block writes with a deny role, read queries still expose secrets. The agent pulls full rows into its context window and sends them to models. Those rows often hold emails, phone numbers, card numbers, or national IDs. Without query checks, an agent can also run heavy joins that slow down production.

Admins can also make mistakes when they grant roles to speed up work. For example, the database owner role can change settings and even drop the database. Giving an AI agent broad rights makes a single bad prompt very dangerous. Also, shared SQL logins make it hard to see which person ran a query.

How to control AI database queries in real time

Safe AI database access requires more than a static read-only login on a laptop. Teams need a way to remove local database passwords from developer machines. Each engineer should log in with their own work identity before the agent runs. That way, the audit log ties every AI query to a real person.

You also need a layer that checks each statement before the database runs it. Instead of trusting a broad role, you can block risky commands on the fly. You can require a peer to approve write queries or schema changes first. Data masking can also rewrite emails, phone numbers, and card numbers in query results.

Govern SQL Server queries and responses in flight

Table grants decide which SQL Server objects a caller may touch. They do not check query intent or rewrite sensitive values in results across every client and agent. By design, hoop.dev sits inline in the TDS wire protocol next to SQL Server as a sidecar for your SQL Server. On every production batch from an engineer or AI agent, hoop.dev decides to pass, mask, block, or hold it for approval.

With hoop.dev guardrails and hoop.dev data masking, banned statements are refused or held for review, matched sensitive fields in supported result columns are masked in memory, and each decision is logged. Check out the code on GitHub.

Frequently asked questions

Is Windsurf the same tool as Devin Desktop?

Yes, Cognition announced on June 2, 2026 that Windsurf is becoming Devin Desktop. It keeps the same IDE features and uses the Cascade agent to run MCP tools.

Does the fixed data reader role hide sensitive columns from AI agents?

No, members of that fixed role can read all data from all user tables. You cannot change fixed role permissions, so emails and card numbers stay exposed in results.

How can we stop storing database passwords in local MCP settings?

Put a proxy in front of the database that uses your single sign-on provider. Developers log in with their work accounts, and the proxy handles the database credentials.

The query runs. The emails stay hidden.