How to Configure Windsurf SQL Server MCP Server

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a windsurf sql server mcp server by adding the database tool to your editor settings. Then you give the tool a database user login with limited read rights. Many engineering teams start by sharing a powerful admin login in local settings files. That shortcut gives the AI agent full control over every table in the database. If the agent makes a mistake, it can alter or delete production rows. How a windsurf sql server mcp server works in practice Cognition renamed Windsurf to Devin

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 sql server mcp server by adding the database tool to your editor settings. Then you give the tool a database user login with limited read rights. Many engineering teams start by sharing a powerful admin login in local settings files. That shortcut gives the AI agent full control over every table in the database. If the agent makes a mistake, it can alter or delete production rows.

How a windsurf sql server mcp server works in practice

Cognition renamed Windsurf to Devin Desktop in June 2026. The editor still uses the same core layout and features. Its agent can run terminal commands in a dedicated shell when a user approves. That shell loads the local user settings, aliases, and stored secret keys. The Cascade agent also talks to external tools through the Model Context Protocol. You list each tool and its login details in the local agent settings file.

When the agent needs schema details or table rows, it calls the database tool. The tool opens a session with Microsoft SQL Server using the login you saved. In SQL Server, a server login lives in the main system database. That login maps to a specific database user inside each target database. Teams can also create a contained database user with its own password. A contained user stays inside one database and does not need a main login. An admin must turn on the contained database setting on the server first.

In total, Microsoft SQL Server supports thirteen different types of database users. Once you create the user, you assign it to a fixed database role. You cannot change the built-in rules of these fixed database roles. Every role, including the default public group, includes the basic right to connect.

Choosing the right database roles for your AI agent

Most teams want their AI coding assistant to inspect schemas and read test data. SQL Server includes a fixed role made for reading data across a database. Members of this reader role can read all rows from all user tables by default. They can also read data from every user view in that database. If you assign the writer role, the agent can add or change table rows. It can also delete rows across any user table in the database.

Some teams assign the database owner role to avoid permission errors during setup. That choice creates a major risk for your shared data Systems. A database owner can change any server setting and run maintenance tasks. That role can even drop the entire database if a prompt goes wrong. To block write actions, admins can add the deny writer role to the user. That role stops the user from adding, changing, or deleting any table data. An admin can also use the deny reader role to block all table reads. Using that deny role hides both table rows and table metadata from the user.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Why native database roles leave operational gaps

Fixed database roles work well for broad access control at the database level. Still, a reader role still lets the agent read every single user table. Most databases hold sensitive customer details alongside standard app tables in the same schema. A basic reader role cannot tell a safe lookup table from a billing table. When the agent queries a customer table, the database returns raw emails and phone numbers. It will also return raw card numbers and national IDs in the query results.

Native roles only check who logs in and which broad role they hold. They do not inspect what each query asks for while it runs. Plus, storing plain passwords on developer laptops puts your database at risk. Because the agent loads shell variables, any command it runs can read local keys. Teams need a safer way to check queries in flight and protect private fields. Masking that rewrites matched fields in results keeps emails and card numbers safe.

Add runtime guardrails beside SQL Server

Role grants and network rules are needed setup for SQL Server. Still, an allowed user or agent tool can send a bad delete or read raw customer fields over a valid session. In practice, hoop.dev sits inline in the TDS protocol beside the database as a sidecar for your SQL Server. For every query an agent or human runs in production, hoop.dev decides whether to pass, mask, block, or escalate it for review.

With hoop.dev SQL Server controls, rules refuse banned statements before they run, hold risky queries for human review, and mask matched sensitive values in supported result columns in memory. Furthermore, hoop.dev holds SOC 2 Type II and generates evidence for HIPAA, PCI DSS, SOX, and GDPR audits. See the source on GitHub.

Frequently asked questions

Did Windsurf change its name to Devin Desktop?

Yes, Cognition renamed Windsurf to Devin Desktop in June 2026. The app keeps the same editor features, terminal access, and Cascade agent tools.

Should I give my AI agent the database owner role in SQL Server?

No, the database owner role can change settings and drop the entire database. Use a read-only role and add the deny writer role for safety.

Can a SQL Server reader role hide private fields like emails or card numbers?

No, the built-in reader role gives read access to all user tables and views. You need field masking that rewrites matched fields in results to hide private data.

The query runs. The emails stay hidden.