Guide coding-agents/
Grok Build MCP config: mcp.json, project vs global, and OAuth
Where Grok Build reads MCP servers, how a server entry is shaped, how OAuth sign-in and tool allowlists work, and what team and enterprise admins can control.
Short answer
Grok Build, the desktop app formerly called Cursor, reads MCP servers from an mcpServers object in two JSON files: .cursor/mcp.json in a project and ~/.cursor/mcp.json in your home folder. It merges both, and the project entry wins when the same server name appears in each. Local servers use command and args; remote servers use url and optional headers. Grok Build asks before each MCP tool call unless an allowlist or run mode covers it.
Checked against: Grok Build MCP docs, MCP help, permissions.json reference, run modes, model and integration management and MCP install links, December 6, 2026.
Run by us: no. Commands are copied from Grok Build’s docs.
Where does Grok Build read MCP servers from?
Grok Build reads two mcp.json files, merges them, and lets the project file win when both define the same server name.
| Scope | File | Use it for |
|---|---|---|
| Project | .cursor/mcp.json in the project folder |
Servers the whole team should get. The docs say to commit it to git |
| Global | ~/.cursor/mcp.json in your home folder |
Personal servers in every project you open |
As of December 6, 2026, the help page states: “If the same server name appears in both, the project-level config takes priority.” After editing either file by hand, save it and restart Grok Build.
Not every surface reads both files. Hosted Cloud Agents don’t read ~/.cursor/mcp.json; they use servers configured at cursor.com/agents plus your team’s servers. The Grok Build Terminal UI keeps its own list in config.toml, managed with grok mcp add, and also reads .cursor/mcp.json for compatibility.
Why do the config paths still say .cursor?
The product was renamed, but its config folder and several URLs kept the old prefix.
A grok.com announcement dated November 30, 2026 says the desktop app is now Grok Build. The old MCP docs URL now returns a 308 redirect to docs.grok.com/build/agents-window/mcp. The current docs still use .cursor/mcp.json, .cursor/permissions.json, cursor:// install links and cursor.com OAuth callbacks, so copy those strings exactly. The docs call the editor surface the Agents Window; this guide covers that surface.
How do I add a local (stdio) server?
Add an entry under mcpServers with the command Grok Build should start.
{
"mcpServers": {
"server-name": {
"command": "npx",
"args": ["-y", "mcp-server"],
"env": {
"API_KEY": "value"
}
}
}
}
| Field | Required | Notes |
|---|---|---|
type |
Yes | "stdio" |
command |
Yes | Must be on your system path or be a full path, such as "npx", "node", "python" or "docker" |
args |
No | Array of arguments passed to the command |
env |
No | Environment variables for the server |
envFile |
No | Path to an env file, such as "${workspaceFolder}/.env". Stdio servers only |
The field table marks type as required, but the docs’ own examples leave it out. A stdio server is a process on your machine, so treat its command like any code you run.
To install from the marketplace instead, open Customize in the sidebar, click MCPs, then click Add to Grok Build next to the server and complete any sign-in.
How do I add a remote server?
Give the entry a url instead of a command; Grok Build connects over SSE or Streamable HTTP.
{
"mcpServers": {
"server-name": {
"url": "http://localhost:3000/mcp",
"headers": {
"API_KEY": "value"
}
}
}
}
The docs’ transport table lists stdio with manual auth, and SSE and Streamable HTTP with OAuth. For the trade-offs, see stdio vs Streamable HTTP.
How do I keep secrets out of mcp.json?
Reference environment variables with ${env:NAME} instead of pasting values.
{
"mcpServers": {
"remote-server": {
"url": "https://api.example.com/mcp",
"headers": {
"Authorization": "Bearer ${env:MY_SERVICE_TOKEN}"
}
}
}
}
Grok Build resolves variables in command, args, env, url and headers, and in auth values. The supported forms are ${env:NAME}, ${userHome}, ${workspaceFolder}, ${workspaceFolderBasename}, ${pathSeparator} and ${/}.
envFile works only for stdio servers. For remote servers, set variables in your shell profile or system environment, make sure Grok Build can see them, and restart it.
How does OAuth sign-in work for remote servers?
Grok Build runs the authorization code flow with PKCE and handles sign-in itself.
It reads the server’s protected resource metadata (RFC 9728) to find the authorization server and resource indicator (RFC 8707). With dynamic client registration, it registers as a public client with no client secret.
If a provider issues a fixed client ID, requires an allowlisted redirect URL, or doesn’t support dynamic registration, add an auth object:
{
"mcpServers": {
"oauth-server": {
"url": "https://api.example.com/mcp",
"auth": {
"CLIENT_ID": "your-oauth-client-id",
"CLIENT_SECRET": "your-client-secret",
"scopes": ["read", "write"]
}
}
}
}
| Field | Required | Notes |
|---|---|---|
CLIENT_ID |
Yes | OAuth 2.0 client ID from the provider |
CLIENT_SECRET |
No | Only for confidential clients |
scopes |
No | If omitted, discovered from /.well-known/oauth-authorization-server |
Register both fixed redirect URLs if people sign in from the web and the desktop app:
https://www.cursor.com/agents/mcp/oauth/callback
http://localhost:8787/callback
The first serves web and Agents sign-ins; the second serves the desktop app. If the provider issues refresh tokens only for a scope such as offline_access, add it to auth.scopes, or you’ll sign in again each time the access token expires. The spec side is covered in MCP authorization step by step.
How do I let MCP tools run without approval?
Grok Build asks before every MCP tool call by default; an mcpAllowlist in permissions.json lets named tools skip the prompt.
{
"mcpAllowlist": [
"github:*",
"linear:list_issues"
]
}
Save it as ~/.cursor/permissions.json (every workspace) or <workspace>/.cursor/permissions.json (one repo). When both exist, their arrays are concatenated.
| Pattern | Matches |
|---|---|
my-server:my_tool |
One tool from one server |
my-server:* |
Every tool from that server |
*:my_tool |
That tool from any server |
my-server:list_* |
Tools whose names start with list_ |
The server part is the key from mcp.json, matched case-insensitively. Entries without a colon are ignored.
Three rules decide what applies:
- Team admin run-mode controls beat
permissions.json, which beats the in-app allowlist. - A key in
permissions.jsonreplaces the in-app allowlist for that type. An empty array means an empty allowlist, not a fallback. - The file only takes effect when a run mode is on: Auto-review, Allowlist or Run Everything, under Settings > Agents > Approvals & Execution.
MCP calls follow the same run mode as terminal commands. In Auto-review, the recommended default since Grok Build 3.6 (May 29, 2026), allowlisted MCP tools run at once and the rest go to a classifier. The reference labels allowlists “Not a security boundary.” The tool allow-list entry explains the general pattern.
To switch a whole server off without deleting it, use its toggle in Customize. Disabled servers don’t load or appear in chat.
What can team and enterprise admins control?
Team admins distribute servers; Enterprise admins decide which servers may run.
| Control | Who | What it does |
|---|---|---|
| Team MCP servers (Dashboard > Plugins & MCPs) | Team admin | Shared servers for Cloud Agents. Link one to a team marketplace so members install it from Customize |
| Run connectors only on members’ computers | Team admin | Keeps Team MCP servers off Cloud Agents |
| MCP allowlist (Team Settings > MCP Configuration) | Enterprise admin | Command entries for stdio servers, URL entries for remote ones, * wildcards, optional per-server tool lists |
| Network mode, per command entry | Enterprise admin | Allow all, Allowlist, Deny all or No sandbox |
| User MCP extensions | Enterprise admin | Lets users run servers outside admin patterns, with an optional network denylist |
Command entries match the full command string: command plus every args value, joined with spaces. A rule can cover the Local list (Agents Window and CLI), the Cloud list (Cloud Agents and Grok Bot), or both. The docs add that allowlisting “does not distribute or install the server.” Servers developers add outside these controls are shadow MCP servers.
How do I share a server as an install link?
Encode the server’s config into a cursor:// deeplink.
cursor://anysphere.cursor-deeplink/mcp/install?name=$NAME&config=$BASE64_ENCODED_CONFIG
Base64-encode the JSON with btoa(JSON.stringify(config)) in a browser or base64 -w0 on the command line, then URL-encode the result. For programmatic setup, the docs point to the extension API, vscode.cursor.mcp.registerServer().
What breaks, and how do I fix it?
Start with the logs: open the Output panel (Cmd+Shift+U on macOS, Ctrl+Shift+U on Windows and Linux) and choose MCP Logs.
| Symptom | Fix, per the docs |
|---|---|
| New server missing after a manual edit | Save mcp.json and restart Grok Build |
| Server starts without its credentials | Make shell-profile variables available to Grok Build, then restart |
envFile ignored |
Remote servers don’t support it; use ${env:NAME} |
| Provider rejects the redirect URL | Register both callback URLs, or set a static CLIENT_ID |
| Sign-in needed each time the token expires | Add offline_access, or the provider’s equivalent, to auth.scopes |
| Works locally, missing in Cloud Agents | Configure it at cursor.com/agents or as a Team MCP server. Cloud Agents keep separate sign-ins |
| Windows: logs say the server requires sandboxing | Windows doesn’t support that sandbox; ask an admin for a Command entry with No sandbox |
| Stale version of an npm server | Remove it in Customize, run npm cache clean --force, add it again |
When one server crashes or times out, the docs say the tool call is marked as failed and other servers keep working.
What to read next
Sources
Changelog
- First published.
Cite this page
Agents for Devs. "Grok Build MCP config: mcp.json, project vs global, and OAuth." Published Dec 6, 2026. https://agentsfordevs.com/guides/cursor-mcp - Page: https://agentsfordevs.com/guides/cursor-mcp
- Markdown version: https://agentsfordevs.com/guides/cursor-mcp.md
- Reuse: quote or summarize with a link to this page. Reuse terms
Cite one section
- Where does Grok Build read MCP servers from?
- Why do the config paths still say .cursor?
- How do I add a local (stdio) server?
- How do I add a remote server?
- How do I keep secrets out of mcp.json?
- How does OAuth sign-in work for remote servers?
- How do I let MCP tools run without approval?
- What can team and enterprise admins control?
- How do I share a server as an install link?
- What breaks, and how do I fix it?
- What to read next