How to use MCP with cursor: Setup in 3 steps

12 min read

Illustration for How to use MCP with cursor: Setup in 3 steps

How to use MCP with Cursor comes down to three steps: add the server to .cursor/mcp.json in your project or ~/.cursor/mcp.json for all projects, check in Cursor’s MCP settings that it shows as connected, then ask the agent to call one of its tools. By default, Cursor asks for approval before a tool runs. Cuiar can be that server and give Cursor a real browser.

An MCP server adds tools to Cursor’s agent, and the agent calls them from the chat.

This guide shows how to use MCP with Cursor: add a server, check it, approve tools safely, fix a server that fails and connect a browser server.

Key Takeaways

  • Cursor supports three transports: stdio, SSE and Streamable HTTP.
  • When a server fails, run agent mcp list, then agent mcp list-tools, from Cursor’s CLI.
  • Keep approval on for tools that click, type or sign in. Tools that only read the page are safer to run without a prompt.

What is MCP and what does it do in Cursor?

MCP, the Model Context Protocol, connects an AI client such as Cursor to external tools and data through servers. Cursor’s MCP docs say MCP “enables Cursor to connect to external tools and data sources.”

Illustration for What is MCP and what does it do in Cursor?

Cursor is the client, and each MCP server adds tools the agent can call, such as search, file access or a browser. Instead of pasting context into a chat, you let the agent ask the server for it.

MCP doesn’t host, deploy or control AI models. The model that answers you stays the one you picked in Cursor, and the server only adds what the agent can do.

A server can be small. Cursor’s docs say you can write MCP servers “in any language that can print to stdout or serve an HTTP endpoint,” such as Python, JavaScript or Go.

Cuiar is one such server. It gives Cursor’s agent a real browser, so it can open localhost or a page behind a login. The Cuiar setup page for AI agents lists the connection options.

How to use MCP with Cursor, step by step

You use MCP with Cursor by adding a server entry to an mcp.json file, checking that it connects, and sending a prompt that calls one of its tools. Cursor’s docs say you can “install and manage MCP servers from the Customize page or configure them in mcp.json”. The file route works for any server.

If the server you want is an official plugin, browse the Cursor Marketplace first. The docs list official plugins there, and you can install them from the Customize page without editing JSON. Community plugins and MCP servers are listed on cursor.directory.

  1. Choose the file. Create .cursor/mcp.json in your project root to use the server in one repo. Create ~/.cursor/mcp.json to use it in all projects.

  2. Paste the JSON. The file has a top-level mcpServers object. Each entry has a name, then command, args and env for a local (stdio) server, or url and headers for a remote one.

my-server, my-remote-server, my-package-name, example.com and MY_API_KEY are placeholders. Replace each with the real value from your server’s docs, or Cursor can’t start it.

{
  "mcpServers": {
    "my-server": {
      "command": "npx",
      "args": ["-y", "my-package-name", "--root", "${workspaceFolder}"],
      "env": { "MY_API_KEY": "${env:MY_API_KEY}" }
    },
    "my-remote-server": {
      "url": "https://example.com/mcp",
      "headers": { "Authorization": "Bearer ${env:MY_API_KEY}" }
    }
  }
}
  1. Keep secrets out of the file. Write ${env:NAME} and set that variable in your shell before you start Cursor. A variable you set after Cursor is open is not visible to it, so restart Cursor.

You can also use ${workspaceFolder} for the project path and ${userHome} for your home folder.

  1. Check the connection. Open Cursor’s settings and go to the Customize page, then find your server in the MCP list. A connected status and a list of its tools mean the server works. If the server asks you to sign in, finish the OAuth step in the browser window that opens.

  2. Call a tool. Open the agent chat and ask for something only the server can do, such as “Use my-server to list the tools you offer, then call the first one that only reads data.” Cursor shows the tool call in the chat, and you approve it when it asks.

For a server that gives Cursor a real browser, see the Cursor setup page for Cuiar.

Which MCP transport does Cursor use: stdio, SSE or Streamable HTTP?

Cursor uses all three: it starts a local process for stdio, or it connects to a URL for SSE or Streamable HTTP. Cursor’s docs say you can write MCP servers in any language that can print to stdout or serve an HTTP endpoint, which matches those two paths.

stdio SSE Streamable HTTP
Where it runs Local process Remote URL Remote URL
mcp.json fields command, args, env url, headers url, headers
How it signs in Variables in env OAuth or Bearer header OAuth or Bearer header
Pick it when The server runs on your machine The server offers only SSE You connect a new remote server

Remote servers sign in with OAuth or with a token in headers. For a token, set an Authorization header whose value starts with Bearer.

Cursor’s docs also have a section named “Static OAuth for remote servers”, for providers that don’t support dynamic client registration. There you give Cursor fixed client credentials instead.

The MCP specification defines both pieces. Its transports page describes Streamable HTTP, and its authorization page is based on OAuth 2.1.

Cuiar offers both kinds of server. Its MCP server at https://mcp.cuiar.com/mcp uses Streamable HTTP with OAuth 2.1 with PKCE, or an API key sent as a Bearer token. The same page lists a local stdio server, which you start with cuiar mcp.

For stdio, mcp.json gets "command": "cuiar" and "args": ["mcp"].

Pick stdio for a server that must run on your computer, such as cuiar mcp or a tool that reads local files. Pick SSE for an older remote server that offers no other transport. Pick Streamable HTTP for a hosted server shared by a team, signed in with OAuth or a key in a header.

How do you use MCP with Cursor to drive a real browser?

You use MCP with Cursor to drive a real browser by adding Cuiar as a server: Cursor is the client, and Cuiar is the server.

Cuiar’s download page gives the current status. The CLI works today on macOS and Linux, but the MCP browser tools control the Cuiar app, so the app must be open and signed in. The app is not released yet. Get an e-mail when the build is ready.

  1. Pick one connection and paste it into .cursor/mcp.json. The Cuiar MCP server page lists streamable HTTP with OAuth 2.1, an API key header, or a local stdio server for its 22 tools.

Remote with OAuth:

{ "mcpServers": { "cuiar": { "url": "https://mcp.cuiar.com/mcp" } } }

Remote with an API key that has the mcp scope:

{ "mcpServers": { "cuiar": {
  "url": "https://mcp.cuiar.com/mcp",
  "headers": { "Authorization": "Bearer ${env:CUIAR_API_KEY}" }
} } }

Local stdio:

{ "mcpServers": { "cuiar": { "command": "cuiar", "args": ["mcp"] } } }

For stdio, install the CLI with curl -fsSL https://cuiar.com/install.sh | sh, then run cuiar login.

  1. Keep Cursor’s tool approval on. Make Cursor ask before each tool call, so nothing is paid, posted or sent by accident.

  2. Send one-sentence prompts to Cursor’s agent. Each maps to a named tool:

  • “Open localhost:3000 in my dev workspace.” calls navigate.
  • “Take a snapshot and list the errors.” calls snapshot.
  • “Click the Sign in button.” calls click.
  • “Type the test e-mail in the first field.” calls type.
  • “Sign in with the vault.” calls sign_in.
  • “Take a screenshot of the broken layout.” calls screenshot.

One prompt can chain several tools: “Open localhost:3000 in my dev workspace, sign in with the vault, take a snapshot and report the errors.” The agent calls navigate, sign_in and snapshot, and adds screenshot if the layout looks wrong.

With sign_in, the vault does the typing. Cuiar’s security page says the vault types the login into the page, and that it fills a login only on that login’s site.

Cuiar’s pricing says “Tasks that your own Claude, Codex or other AI agent runs use no credits.” Work that Cursor’s own plan drives therefore uses no Cuiar credits. The run_task tool is the one that uses credits. Remote MCP is on the Free plan.

How does Cursor ask before an MCP tool runs, and how do you keep it safe?

Cursor asks for your approval before an MCP tool runs, and its Run Mode setting changes how often it asks. Cursor’s MCP docs describe both under “Tool approval” and “Run Mode”. Read each tool call before you accept it, so you know which address it opens or which text it types.

If you move Run Mode toward automatic runs, check which tools it covers before you start a task. Automatic runs suit tools that only read, and they don’t suit tools that act on a page.

The Cursor CLI has a stronger switch. Its MCP page documents the --approve-mcps flag, which approves MCP tools without asking. Use it only where you trust every server and the task, for example a throwaway test machine with a read-only job.

How does the approval split work with Cuiar?

When Cursor drives Cuiar, Cursor’s own approval settings apply. Keep Cursor’s approval on for the tools that act:

  1. click: it can submit a form or press a Pay button.
  2. type: it can fill a message box that you then send.
  3. sign_in: it signs in to an account.

snapshot and screenshot only read the page, so they are the safer tools to run without a prompt.

How do you keep secrets and page text safe?

Cursor’s docs have a “Security considerations” part for MCP servers. Two habits from it apply to every server:

  • Keep secrets in environment variables, not in mcp.json. A key that never enters the file can’t land in a commit.
  • Treat tool output as untrusted data. A web page can hold text that looks like an order, and the agent should not follow it.

Cuiar applies the same rule to page text. Its security page says text from a website goes to the model between markers with a random ID. The page cannot write or close those markers, so it can’t pass its own text off as part of your task.

How do you fix an MCP server that fails in Cursor?

You fix an MCP server that fails in Cursor by checking it in order, from the simplest cause to the most specific. Cursor’s CLI docs say that “MCP in the CLI uses the same configuration as the editor”, so a server you test in the terminal is the same server the editor uses.

  1. Read the server status. Open Cursor’s MCP settings, find the server and check that it is switched on. A server that is off does not start, whatever mcp.json says.

  2. Check mcp.json and the environment. Paste the file into a JSON validator, because one missing or extra comma breaks the whole file.

Then check that every env:NAME reference has a value in the environment Cursor starts from. A variable set in one terminal tab does not reach Cursor if you opened Cursor from the dock. Start Cursor from that shell, or set the variable for your user, and restart Cursor.

  1. Run agent mcp list. Cursor’s docs describe it as a way to “view all configured MCP servers and their current status”. If the server is missing here, the editor does not see it either, so look again at the file path.

  2. Run agent mcp list-tools with the server name. A list of tools means the server starts and answers. An empty result or a failure points to the server itself, not to your prompt.

  3. Run agent mcp login for a remote server that needs OAuth. Finish the sign-in in the browser window, then run step 4 again.

  4. Use agent mcp enable or agent mcp disable. Enable a server that is off. For a server that keeps failing, disable it, enable it again and check the status once more.

  5. Run the stdio command on its own. Copy the command and args from mcp.json into a terminal. If the command isn’t found or exits at once, fix that first. Common causes are a missing npx or Python on the PATH, or a wrong file path.

If the Cuiar tools fail

The Cuiar tools work only while the Cuiar app is open and signed in, because the MCP browser tools control the app. Open it, sign in, and call the tool again.

When you use the cuiar command in a terminal, the Cuiar MCP docs list its exit codes. Exit code 5 means the app is not open.

The app is not released yet. Get an e-mail when the build is ready at cuiar.com/download.

Frequently asked questions

How do I use MCP with Cursor?

Add a server to .cursor/mcp.json in your project, or to ~/.cursor/mcp.json for all projects, as Cursor’s MCP docs describe. Confirm in Cursor’s MCP settings that it is connected. Then ask the agent to use one of its tools, and read each tool call before you accept it.

Where does Cursor store its MCP config?

Cursor keeps MCP servers in an mcp.json file: .cursor/mcp.json for one project and ~/.cursor/mcp.json for all projects. You can also manage servers from the Customize page.

Does MCP cost anything or use credits?

Each server sets its own terms. According to Cuiar’s pricing, Cuiar’s remote MCP server is on the Free plan, and work that runs on Cursor’s own plan uses no Cuiar credits.

Can Cursor’s CLI use the same MCP servers as the editor?

Cursor’s CLI uses the same MCP configuration as the editor, so a server you set up once works in both. Run agent mcp list to see each configured server and its current status.

Does MCP decide which AI model Cursor uses?

MCP doesn’t pick or host the model. It connects Cursor to external tools and data sources, and you still choose the model in Cursor.

Next steps: connect your first MCP server in Cursor

To learn how to use MCP with Cursor, start with one server. Add more once the first one works.

Today

  1. Create .cursor/mcp.json in your project and add one server.
  2. Confirm it shows as connected in Cursor’s MCP settings.
  3. Run a first prompt that calls one of its tools, with approval on, and read each call before you accept it.

This week

  1. Move every secret out of the file into an environment variable.
  2. Run agent mcp list and agent mcp list-tools while the server works, so you know what healthy output looks like.
  3. Set Cursor’s tool approval so nothing is paid, posted or sent without your yes.

When the Cuiar build is ready

The app isn’t released yet, and cuiar.com/download offers an e-mail when it is ready. Then connect Cuiar and give Cursor a real browser for localhost and sign-in checks. The Cursor setup page has the config.

Start free.

Sources

Model Context Protocol (MCP) | Cursor Docs · Model Context Protocol (MCP) | Cursor Docs · MCP | Cursor Docs · Cuiar setup for AI agents · Cuiar MCP server: one URL for any MCP client · Download Cuiar · Cuiar security · Cuiar pricing. Every other source is linked where the article cites it.

  • mcp
  • cursor
  • model context protocol
  • mcp.json
  • ai agents
  • browser automation

Try Cuiar

Cuiar is a browser with an AI agent built in. The agent works in your tabs and signs in from your vault. It is free to start, with no card.

More from the blog