Back to Guides

How to Add an MCP Server to Cursor (2026)

Aleks Koha7 min read

Cursor is a strong AI code editor with the usual stock limitation: its agent knows your repo, but it can't touch anything outside it — no database, no deploy target, no remote service. MCP (Model Context Protocol) is how you extend it. Connect a server and Cursor's agent gains tools it can call while it works: query this database, deploy this build, run this job.

There are two ways to add one, and neither takes long: a Settings UI for point-and-click, and a small mcp.json file for people who'd rather see the config. This guide covers both, using the Matagi MCP server as the remote-server example, then shows what a genuinely capable server changes about how you use Cursor.


What MCP Gives Cursor

An MCP server exposes tools — functions the model can call. Once connected, Cursor discovers those tools automatically and its agent decides when to use them based on your instructions. The value depends entirely on what the server offers: a docs server makes Cursor better at reading, a database server lets it query, an infrastructure server lets it provision and deploy.

Servers come in two shapes. Local (STDIO) servers run as a process on your machine. Remote (Streamable HTTP) servers live at a URL — nothing to install, nothing to keep alive, and they work the same from any machine you sign in on. For anything infrastructure-shaped, remote is the better default.


Method 1: The Settings UI

The fastest path, no file editing required.

Step 1 — Open MCP settings. In Cursor, open Settings (the gear, or Cmd/Ctrl + Shift + J) and go to Tools & Integrations → MCP (labeled "MCP Tools" in some builds).

Step 2 — Add a new server. Click New MCP Server (or Add). Give it a name — matagi — choose the HTTP/URL option, and paste the server URL:

https://mcp.matagi.ai/mcp

Step 3 — Authenticate. Save it. For a server that uses OAuth, Cursor opens a browser sign-in and stores the credentials for you — no API key to create or paste. Sign in with your work email and approve access; if you're new to Matagi, a workspace is created with trial credit.

Even faster: many servers now publish an "Add to Cursor" button on their docs. Clicking it opens the add-server dialog with the name, transport, and URL already filled in, then triggers the same OAuth flow.


Method 2: The mcp.json File

If you prefer config in a file — or want to commit it to a project so your team shares the same setup — Cursor reads MCP servers from mcp.json. Use ~/.cursor/mcp.json for a global server (available in every project) or .cursor/mcp.json inside a project for a project-scoped one.

For a remote server, the entry is just a name and a URL:

{
  "mcpServers": {
    "matagi": {
      "url": "https://mcp.matagi.ai/mcp"
    }
  }
}

Save the file and Cursor picks up the server. On first use it runs the browser OAuth flow to authenticate — because Matagi supports dynamic client registration, you don't add a client ID or secret. (Servers that hand you static OAuth credentials let you add an auth object with a client ID; you won't need that here.)

That's the whole config. No API keys in the file, which also means no secrets to leak if the file is committed.


Remote vs Local Servers

If you've seen mcp.json examples with a command and args, those describe local servers — Cursor launches a process on your machine and talks to it over STDIO. That's fine for tools that operate on local files, but it means something has to be installed and kept up to date.

A remote server like Matagi needs only the url. There's nothing to install, the server is maintained for you, and the same endpoint works from Cursor, Claude, Codex, or any other MCP client — the connection and the workspace behind it follow you between editors.


Worked Example: What a Good MCP Server Adds

What you connect matters more than how. Most MCP servers make Cursor better at reading — docs, issues, schemas. The bigger unlock is a server that lets Cursor finish the job.

Here's the gap: Cursor can write a complete application and then stall, because shipping it needs servers, a database, credentials, and wiring that live outside the editor. You become the DevOps intern for your own AI.

With the Matagi server connected, that last mile becomes tool calls. Ask Cursor to "build a waitlist API with a Postgres database behind it and deploy it," and its agent can provision the database (isolated, per-workspace), deploy the function, register a schedule if the job recurs, and hand back a working URL. External services go through Matagi's proxy, so API keys and OAuth tokens are injected server-side and never appear in the generated code — so they never land in your repo either. Review what the agent built before pointing real traffic at it — verify, don't trust.


Troubleshooting

The server shows but tools don't appear. Toggle the server off and on in MCP settings, or reload the window. Cursor fetches the tool list when the server connects.

A green dot but "no tools enabled." Open the server in MCP settings and make sure its tools are enabled; Cursor lets you switch individual tools on and off.

OAuth didn't trigger. Make the agent attempt a tool call, or remove and re-add the server. The sign-in flow fires on first use.

Edited mcp.json but nothing changed. Check it's valid JSON and in the right place — ~/.cursor/mcp.json (global) or .cursor/mcp.json (project root). A trailing comma will silently break it.

Local-server instructions won't connect. If a guide gives you a command/args block for something that's actually a hosted service, you want the url form instead — that's the remote path.


FAQs

Does Cursor support remote MCP servers? Yes. Remote servers over Streamable HTTP are supported and are the recommended choice for anything beyond local experimentation — you add them by URL.

Do I need an API key for Cursor MCP? Not for a server that uses OAuth. Cursor runs a browser sign-in and stores the credentials; with dynamic client registration (as Matagi uses) there's nothing to paste at all.

Where does Cursor store MCP config? In mcp.json~/.cursor/mcp.json for global servers, .cursor/mcp.json in a project for project-scoped ones. The Settings UI writes to the same place.

Can I use the same MCP server in Cursor and Claude or Codex? Yes — that's the point of remote MCP. The same endpoint and workspace work across clients, so switching editors keeps your tools and resources.

Is it safe to give Cursor's agent infrastructure tools? Matagi scopes everything to your workspace, keeps credentials in a server-side proxy (never in code or model context), and logs every action with an audit trail. Keep destructive tools gated and review output — verify, don't trust.



Give Cursor's agent hands: connect the Matagi MCP server — add https://mcp.matagi.ai/mcp in Settings or mcp.json, sign in once, and shipping real infrastructure becomes something Cursor can do from the editor.

cursor mcpcursor mcp servermcp serversmcp setupai coding tools

Build your first AI agent free

Describe what you want done in plain English. Matagi provisions the infrastructure, wires the integrations, and deploys it.

Get started