MCP in Cursor: mcp.json, OAuth and keysMCP servers: what they are and how to connect one

MCP in Cursor: mcp.json, OAuth and keys

The short version: Cursor reads MCP servers from ~/.cursor/mcp.json (all projects) and .cursor/mcp.json (one project). A remote server needs nothing but a url field, and Cursor will offer to sign in over OAuth. If a browser sign-in is awkward, a key goes into headers through an environment variable.

Two files, two scopes

FileWhere it appliesWhat belongs there
~/.cursor/mcp.jsonEvery projectSearch and documentation — whatever you always want
.cursor/mcp.jsonThis repository onlyProject-specific tools; the file can be committed for the team — but without keys
Per Cursor's documentation on 17 September 2026.

You can open the list of servers in Cursor's settings, in the MCP section: it shows which servers are connected, how many tools each has, and a toggle to switch a server off for a while. If you are still getting to know the protocol, start with the overview of MCP servers.

Path 1. A URL and OAuth sign-in

The shortest route is to write down the addresses only. Tick the tools below and a ready mcp.json assembles itself.

No keys: paste the URL into your client and sign in — Claude, Cursor and any other OAuth client.

1

Settings → MCP in Cursor

2

Add the config to ~/.cursor/mcp.json

3

Save and sign in via OAuth


Build your server

Check the tools — URLs and config update themselves.


Connector URLs

Image Generation (Nano Banana)

https://twelver.ru/api/mcp/v1/image-generation

Web Search

https://twelver.ru/api/mcp/v1/web-search
{
  "mcpServers": {
    "twelver-image-generation": {
      "url": "https://twelver.ru/api/mcp/v1/image-generation"
    },
    "twelver-web-search": {
      "url": "https://twelver.ru/api/mcp/v1/web-search"
    }
  }
}

The same mcp.json works in LM Studio, Windsurf, Cline, VS Code and any client that reads an mcp.json.

Save the file and a sign-in button appears next to the server in settings. Click it, sign in to your Twelver account in the browser, and the server goes active. OAuth needs a registered account.

Path 2. A key in a header

On shared machines, in containers, and whenever the browser sign-in will not go through, a key is easier. Get one with the button below, no registration:

A key for Cursor

Get an sk-… key right here on the page

Pick any model series — the model in Cursor stays its own; the MCP server only needs the key. It is substituted into the line below.

Press it and get your base_url and API key.

No sign-up, no card.

Free. Your key appears right here.

Template — this will not work as is~/.zshrc or ~/.bashrcThe highlighted parts are stand-ins. The button above issues them in seconds, no sign-up.
export TWELVER_API_KEY="sk-<your-key>"

Then refer to the variable from mcp.json — Cursor expands it at launch, and the key never reaches the repository:

{
  "mcpServers": {
    "twelver-web-search": {
      "url": "https://twelver.app/api/mcp/v1/web-search",
      "headers": {
        "Authorization": "Bearer ${env:TWELVER_API_KEY}"
      }
    },
    "twelver-image": {
      "url": "https://twelver.app/api/mcp/v1/image-generation",
      "headers": {
        "Authorization": "Bearer ${env:TWELVER_API_KEY}"
      }
    }
  }
}

Cursor on macOS, launched from the Dock, may not see variables from ~/.zshrc. If the server answers 401, start Cursor from the terminal with cursor . so it inherits the shell environment.

Call approval

By default Cursor asks for permission before every MCP tool call and shows you the parameters. That is sensible for tools that change something or spend your balance. For search and page reading you can drop the prompt by adding the tool to the auto-run allowlist — the agent then works without pauses.

What to ask the agent for

  • "Read the current docs on migrating to the new version of the library and draft a plan of edits" — web-search and web-crawl instead of an answer from the model's stale memory.
  • "Generate three hero images for the landing page at 16:9 and put the first one into the markup" — text-to-image returns links to the files. More on generation in image and video generation over MCP.

If it does not work

SymptomCauseWhat to do
The server shows an error indicatorBroken JSON, or a wrong addressCheck the file is valid and that the url was copied in full
401 with a keyCursor cannot see the environment variableLaunch Cursor from the terminal, or check the variable is actually set
There is no sign-in buttonThe config carries a key in headers — the server accepted it, no sign-in neededThat is normal; remove headers if you would rather sign in through the browser
The agent does not use the toolsThe server is switched off, or the request does not need a toolCheck the toggle and ask explicitly: "search the web for…"

Wiring the same thing up in other clients? Instructions for Claude and LM Studio. The server builder page for Cursor is Twelver MCP servers for Cursor.

Frequently asked questions

How do I connect MCP to Cursor?
Add the server to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project). A remote server needs a url; sign-in is either OAuth via the button in settings, or a key in headers. Save the file and the server appears in the MCP section of Cursor's settings.
Where is mcp.json in Cursor?
The global one is in your home directory: ~/.cursor/mcp.json. The project one is at the root of the repository: .cursor/mcp.json. If the file does not exist, create it by hand.
How do I pass a key to an MCP server in Cursor without writing it into the file?
Through environment-variable interpolation: "Authorization": "Bearer ${env:VARIABLE_NAME}" in the headers field. Cursor substitutes the value at launch.
Can I turn off MCP call approval in Cursor?
Yes, per tool: add them to the auto-run allowlist. It is reasonable to do that for reading and search, and to keep approval on for tools that change something or spend money.
Which MCP servers should I connect in Cursor?
For most work, search with page reading, access to GitHub and a browser for checking the UI are enough; designers also get value from Figma. A shortlist with the reasoning is in the best MCP servers.

Try it yourself

Everything in this guide runs inside Twelver

One chat for text, images, video, music and voice — no separate services or subscriptions.

Open Twelver chat
Rate your experience