# How to connect Cursor to a server

Cursor talks to a server through MCP. You can run your own MCP server on a VPS and add its address to Cursor, or connect a service whose MCP server already exists. Here is what each way takes.

## Tell your AI

1. Connect BitHut to your AI (Claude, ChatGPT or Codex): add the address `https://api.bithut.app/mcp`. How: https://bithut.app/connect.md
2. Then tell it:

```
Show my BitHut projects
```

## The short answer

Cursor's agent works with a server through MCP (Model Context Protocol): a program called an MCP server offers the agent tools, such as "show the logs" or "restart the app", and the agent calls them while it works on your code.

There are two ways to give Cursor such a server:

1. **Your own MCP server on your VPS.** You install it, give it a public HTTPS address, protect it with a sign-in and add that address to Cursor.
2. **A service that already runs an MCP server.** You add its address and sign in. BitHut works this way: there is nothing to install, and Cursor's agent puts your projects online through it.

A note on names. Cursor's documentation now opens at docs.grok.com, where the product is called Grok Build: links to cursor.com/docs redirect there. The file names and the install links on those pages still say `cursor`, so everything below applies to the Cursor editor you have. We read the pages on 5 December 2026.

## Where Cursor keeps its servers

Cursor reads MCP servers from two files ([MCP docs](https://docs.grok.com/build/agents-window/mcp)):

- `~/.cursor/mcp.json` for every project on your computer;
- `.cursor/mcp.json` inside a project, for that project only.

A remote server is one entry under `mcpServers` with its address:

```json
{
  "mcpServers": {
    "my-server": { "url": "https://mcp.example.com/mcp" }
  }
}
```

If the server wants a key in a header, add `"headers": {"Authorization": "Bearer …"}` next to `url`. Cursor speaks stdio, SSE and Streamable HTTP. Cloud agents don't read `~/.cursor/mcp.json`: they use servers set up on cursor.com/agents and your team's servers.

You can also skip the file: a service can publish an install link of the form `cursor://anysphere.cursor-deeplink/mcp/install?name=…&config=…`, where `config` is the same JSON in base64. A click opens Cursor, and Cursor offers to install the server ([install links](https://docs.grok.com/build/agents-window/mcp/install-links)).

## Your own MCP server on a VPS

### What you need

- **An MCP server program.** Either one a service publishes, or one you (or your AI) write for your own tasks.
- **A public HTTPS address**, for example `https://mcp.example.com/mcp`: a domain, a certificate and a proxy in front of the program. Cursor on your laptop can reach a server in your own network, but cloud agents and your teammates can't.
- **A sign-in.** Cursor supports OAuth with PKCE and finds the sign-in from your server's metadata. It registers itself on your server (Dynamic Client Registration), or you put a fixed client ID in an `auth` object in `mcp.json`. The callback addresses for a fixed client are `http://localhost:8787/callback` for the desktop app and `https://www.cursor.com/agents/mcp/oauth/callback` for the web ([MCP docs](https://docs.grok.com/build/agents-window/mcp)). A simpler option is a long random key in a header, but then anyone who sees the file has the key.
- **Upkeep.** The program has to run day and night, restart after a crash or a reboot, and get updates. If the VPS is down, the agent loses its tools.
- **A firewall** that leaves HTTPS open and closes everything you don't need.

### Add it to Cursor

1. Put the server into `~/.cursor/mcp.json` (all projects) or `.cursor/mcp.json` (one project), as shown above, and save the file.
2. Open **Customize** in the sidebar: the server is listed there and can be switched on and off.
3. If the server uses OAuth, Cursor opens your browser to sign in on first use.
4. Ask the agent to do something the server offers and check that it calls the tool.

### Keep it safe

By default Cursor asks before it calls an MCP tool, and you can expand the call to see its arguments. MCP tools follow the same run modes as terminal commands: in Auto-review, tools on your allow list run at once and the rest pass a check; an empty allow list allows every tool of that server ([MCP docs](https://docs.grok.com/build/agents-window/mcp)). For your own VPS, our advice:

- **Never give an AI the root password** or a tool that runs any command as root. Give the MCP server its own user with access only to what it needs.
- **Keep keys out of `.cursor/mcp.json` in a repository**: anyone with the repository gets them.
- **Offer only the tools you need,** and keep the allow list short.
- **Read the call** before you approve anything that changes or deletes data.

## The BitHut way: nothing to host

If what you want from "Cursor on a server" is to put a site, a bot or a script online, you don't need a VPS of your own. BitHut already runs an MCP server at `https://api.bithut.app/mcp`, with the automatic client registration Cursor expects. On the [Connect page](/connect#cursor) press **Add BitHut to Cursor**, then **Install**, sign in to BitHut and press **Allow**. If the button doesn't open Cursor, the same page has a sentence you paste to Cursor's agent instead.

Then you just talk to the agent:

- "Put this project online on BitHut": it uploads the code, BitHut builds and checks it, and the agent gets the address.
- "Why did my bot stop?": the agent reads the logs and the error and fixes the code.
- "Roll back to yesterday's version": the agent asks you to confirm, then does it.

Keys are stored apart from the code, sites start private behind a password page, and the price is fixed for the account: from $5 a month, see [pricing](/pricing). The first 14 days are free.

To be clear: we have not yet run BitHut with Cursor end to end ourselves. Other AIs and their steps are on the same [Connect page](/connect).

## When something doesn't work

- **The server doesn't connect.** Open the Output panel (Ctrl+Shift+U, on a Mac ⇧⌘U) and pick **MCP Logs** in the list: connection, sign-in and crash errors are there ([MCP docs](https://docs.grok.com/build/agents-window/mcp)).
- **The server is missing from Customize.** Check that the JSON is valid and that the entry sits under `mcpServers`.
- **A cloud agent doesn't see the server.** Cloud agents don't read `~/.cursor/mcp.json`; add the server on cursor.com/agents.
- **The sign-in expired.** If your server gives no refresh token, Cursor asks you to sign in again when the token runs out.
- **A tool call failed.** The chat shows the error; retry it or read the logs. Other servers keep working.
- **The install link opens nothing.** Use the file instead, or paste the sentence from the [Connect page](/connect#cursor) to the agent.
- **BitHut is connected but the agent doesn't answer about projects.** Ask it: "Show my BitHut projects." If it lists them, the connection works.
