How to Configure Windsurf CockroachDB MCP Server
You set up a windsurf cockroachdb mcp server by adding the server to your agent file. You also give the server a database login string so the agent can run queries. Teams often use a single shared admin login for this local setup. When roles are too broad, an AI agent can alter tables or read sensitive rows by mistake. How the windsurf cockroachdb mcp server setup works Cognition renamed Windsurf to Devin Desktop in June 2026. The product keeps the same editor and features under this new name
Kubernetes API Server Access + End-to-End Encryption: the complete guide
Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.
You set up a windsurf cockroachdb mcp server by adding the server to your agent file. You also give the server a database login string so the agent can run queries. Teams often use a single shared admin login for this local setup. When roles are too broad, an AI agent can alter tables or read sensitive rows by mistake.
How the windsurf cockroachdb mcp server setup works
Cognition renamed Windsurf to Devin Desktop in June 2026. The product keeps the same editor and features under this new name. Its legacy Cascade agent connects to Model Context Protocol servers that you list in your local setup. The agent also runs terminal commands on its own when you give it permission. It uses a dedicated shell that loads your local profile on macOS or Linux. This means your shell aliases and stored keys are ready for the agent to use.
To link the database, you run a local MCP server process for CockroachDB. The editor starts this server process in the background when you open a session. The server reads your database login details from your local shell profile or setup file. When you ask the agent a question about your schema, it calls the MCP tool. The MCP server then sends SQL queries straight to your CockroachDB cluster and returns the rows.
What native roles solve and what they leave open
CockroachDB gives you built-in SQL roles and grants to control who can log in. You can create a read-only database user for your local AI agent to use. You can also limit which databases or tables that specific user role can read. This native setup stops an agent from dropping tables if you only grant read rights. It solves the basic problem of who is allowed to open a database session.
Still, static database roles only check permissions at the table or view level. They do not inspect what individual queries do in flight during an active session. If an agent needs write rights to fix data, it can update any row in that table. A read-only role can still pull every email, phone number, or card number from a customer table. Also, storing raw database keys on developer laptops creates a risk if a machine gets lost. Native roles decide who logs in, not which specific rows or fields leave the database.
Kubernetes API Server Access + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Managing query risk for local coding agents
Engineering teams need a way to let agents query schemas without exposing raw secrets on laptops. When the agent loads your shell profile, any secret in that file is exposed to local tools. If you share one database user across a team, your audit logs only show that shared name. You cannot tell which person or which prompt ran a slow or risky query. Teams should separate identity checks and data filtering from the local editor setup.
Good database safety requires checking each SQL statement before the cluster runs it. It also requires rewriting sensitive fields like national IDs or card numbers in the query results. That way, the agent gets the schema context it needs to write code safely. At the same time, sensitive customer records stay protected and every query ties back to a real user.
Add runtime guardrails and masking beside your databases and APIs
Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits inline in the protocol beside the service as an open-source proxy, a sidecar for your database or API. On every production query an agent or human runs, hoop.dev decides whether to pass, mask, block, or escalate it for review.
Before a query runs, hoop.dev guardrails check the statement against your rules, an AI Analyzer you configure can score intent or hold risky calls for human approval, and hoop.dev data masking rewrites sensitive fields in responses in memory. Explore the MIT-licensed project on GitHub.
Frequently asked questions
Is Windsurf the same tool as Devin Desktop?
Yes, Cognition renamed Windsurf to Devin Desktop on June 2, 2026. The editor keeps the same features, and the legacy Cascade agent still runs your configured MCP servers.
How does the agent read my database credentials?
The agent runs in a dedicated shell that loads your local user profile on startup. It can read any database keys or variables that you store in your shell profile or MCP setup.
Can CockroachDB roles hide sensitive columns from an MCP server?
Standard table grants give access to the whole table unless you build and maintain separate SQL views. They do not rewrite matched fields like emails or phone numbers inside standard query results on the fly.
Related guides
In this post