# Connect a remote MCP server to Claude, ChatGPT, Cursor and Codex

> Connect the remote MCP server to Claude, ChatGPT, Cursor, and Codex over HTTP with OAuth to build, deploy, and manage apps with nothing installed.

**You connect a remote Model Context Protocol (MCP) server by pointing your client to the endpoint `https://thelastapi.dev/mcp` and completing browser authorization.** Claude Code, Codex, Cursor, Claude, and ChatGPT discover every available tool over HTTP using OAuth 2.1 with PKCE, requiring no local packages or manual runtime environments. Once connected, your agent can provision serverless Postgres databases, deploy sites, accept card payments, send transactional email, and query web data.

This guide covers how to set up the remote MCP endpoint across all major coding assistants and web chats, how authentication works, and how to control what your agent is allowed to touch.

## How remote MCP works without local installs

Local MCP setups usually run a command-line script over standard input and output (`stdio`). That approach works well on a developer workstation, but it breaks down in browser chats, mobile interfaces, or environments where installing Node 20+ and global npm packages is inconvenient.

The remote MCP server at `https://thelastapi.dev/mcp` runs over HTTP. Instead of managing background daemon processes, your client makes HTTP requests to a hosted endpoint.

1. **Discovery and authentication**: The first time your client attempts to call a tool, it initiates an OAuth 2.1 flow using PKCE. It directs you to an **Authorize** page in your browser.
2. **Key generation**: When you click Authorize, the platform generates a dedicated API key named after the client (such as "Claude Code"), visible in your API keys dashboard.
3. **Session handling**: Tokens refresh automatically in the background while keeping the access tier you granted. Revoking the key in the dashboard immediately disconnects the client.
4. **Headless support**: For CI or automated pipelines where a browser cannot open, you can pass your API key directly via an authorization header: `--header "Authorization: Bearer $VIBIZ_API_KEY"`.

For background on MCP architecture and tool calling, read [what is MCP, and how do you give Claude Code real tools?](https://thelastapi.dev/blog/what-is-mcp-claude-code-tools).

## How to connect Claude Code and Codex

You can configure coding agents manually or let the CLI add them in one command.

If you have the CLI available, run:

```bash
vibiz mcp add --clients "Claude Code,Codex"
```

This merges the server definition into your client configuration without replacing existing servers.

### Claude Code manual setup

To add the remote server directly using the Claude CLI:

```bash
claude mcp add --transport http vibiz https://thelastapi.dev/mcp
```

On its first tool invocation, Claude Code prompts you to open the browser sign-in link. After you approve the connection, the client stores its token and begins executing tools.

If you prefer project-level configuration, you can commit an `.mcp.json` file in your project root using the local fallback:

```json
{
  "mcpServers": {
    "vibiz": {
      "command": "npx",
      "args": ["-y", "@vibiz/cli", "mcp"],
      "env": { "VIBIZ_API_KEY": "${VIBIZ_API_KEY}" }
    }
  }
}
```

### Codex manual setup

To connect Codex to the remote server, add the URL and sign in:

```bash
codex mcp add vibiz --url https://thelastapi.dev/mcp
codex mcp login vibiz
```

If you use non-interactive mode (`codex exec`), Codex refuses tools it cannot prompt you to approve by default. To allow execution, pass the approval flag:

```bash
codex exec -c mcp_servers.vibiz.default_tools_approval_mode="approve" "Build a landing page"
```

## How to configure Cursor

Cursor connects to the remote MCP server through its user or project configuration files.

Add the remote endpoint to `.cursor/mcp.json` in your repository, or add it globally to `~/.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "vibiz": {
      "url": "https://thelastapi.dev/mcp"
    }
  }
}
```

Alternatively, you can run `vibiz mcp add --clients "Cursor"` to have the configuration merged automatically. When Cursor invokes its first tool, your browser opens to the authorization screen. Once approved, tools like `vibiz_project_status`, `vibiz_database`, and `vibiz_docs` become available inside Cursor Composer and chat.

To enhance your coding agent's workflow, you can combine MCP tools with installable instructions explained in our guide to [agent skills (SKILL.md) for Claude Code, Codex and Cursor](https://thelastapi.dev/blog/agent-skills-skill-md).

## How to connect chat apps: Claude and ChatGPT

You do not need an open terminal or IDE to run tools. Both Claude (claude.ai, desktop, and mobile) and ChatGPT support the remote server as a custom connector.

### Connecting Claude

Custom connectors work across Free (one custom connector), Pro, Max, Team, and Enterprise plans. On Team and Enterprise accounts, an workspace Owner must add it.

1. Go to **Settings ▸ Connectors ▸ Add custom connector**.
2. Set the name to `Vibiz`.
3. Enter the URL: `https://thelastapi.dev/mcp`.
4. Click **Add**, then click **Connect**.
5. Log in with your thelastapi account and click **Authorize**.

### Connecting ChatGPT

Connecting ChatGPT requires a plan that supports custom connectors:

1. Enable **Developer mode** under **Settings ▸ Apps ▸ Advanced settings**.
2. Create a new app using `https://thelastapi.dev/mcp`.
3. Select OAuth sign-in and complete the authorization prompt.

### What chat apps can do

From a web conversation, your agent can provision infrastructure, write code, and publish sites:

- **Create and deploy**: An agent runs `vibiz_create_project`, then deploys live files using `vibiz_deploy { project_id, files }`. The project is immediately reachable at `<slug>.vibiz.app`. See [host a landing page that ChatGPT or Claude wrote](https://thelastapi.dev/blog/host-landing-page-made-by-ai).
- **Edit live code**: The agent calls `vibiz_code` to read active files, applies updates, and deploys only the changed files. `vibiz_rollback` reverts to an earlier deployment if needed.
- **Provide secrets safely**: When a third-party token is needed, the agent runs `vibiz_request_secret`. This returns a direct console link where you input the value. The secret never passes through the chat context.

*Note on chat limits*: A single chat deployment supports up to 300 files, 3 MiB per individual file, and 4 MiB in total payload size. Larger projects should be managed through your terminal using the CLI or a local agent.

## Choosing between Full access and Limited keys

When approving a connection, you choose the scope of the key granted to the agent:

| Scope | Default? | Capabilities | Excluded actions |
| --- | --- | --- | --- |
| **Full access** | Yes | Projects, deploys, web data, email, metered AI, live payments, refunds, production env, domains, deletions | None |
| **Limited** | No | Create projects, deploy, run development database, test payments, email drafts, dev env | Production secrets, live money movement, deleting domains, creating API keys |

If a Limited key attempts an owner-restricted operation, the API halts the request and returns a `403 forbidden` error with `details.reason: "owner_only"`. The error response includes `details.grant_url`, pointing to a dashboard page where you can grant that specific permission (such as `database.production:read` or `payments.live:write`) without handing over full control.

Read more about environment boundaries in [keys and environments](https://thelastapi.dev/docs/keys), or explore bundling these services together in [one API key for an AI agent: hosting, database, email, payments and models](https://thelastapi.dev/blog/one-api-key-for-ai-agent).

## Tools available on the remote server

The remote MCP server provides the same capabilities as the local server, with minor differences around local file system access:

| Tool | Purpose |
| --- | --- |
| `vibiz_docs` | Reference guides for payments, webhooks, auth, connectors, and database schema |
| `vibiz_usage` | Track usage metrics and check current daily spend limits |
| `vibiz_billing` | View account credit balance and retrieve top-up checkout links |
| `vibiz_create_project` | Provision hosting, database, authentication, and analytics resources |
| `vibiz_project_status` | Check the provisioning state of infrastructure resources |
| `vibiz_deploy` | Deploy an application payload (`files: [{ path, content }]`) directly |
| `vibiz_code` | Read or inspect live deployed files from any version |
| `vibiz_database` | Query tables or execute read-only SQL statements against development data |
| `vibiz_payments` | Create checkout links, manage prices, and inspect subscriptions |
| `vibiz_run_action` | Run web scraping, crawling, SERP lookups, and ad library searches |
| `vibiz_send_email` | Send messages through your project's configured sending domain |
| `vibiz_request_secret` | Generate an out-of-band URL for secure secret input |

Because the remote server runs in the cloud, tools cannot read local paths on your machine. When calling `vibiz_deploy` remotely, pass explicit file contents (`files: [{ path, content }]`). If you pass a local machine folder path to `vibiz_deploy` or `vibiz_speech_transcribe`, the tool responds with the matching CLI command to execute locally (`npx @vibiz/cli deploy --project <id>`).

Full tool specifications and options are documented in the [agents documentation](https://thelastapi.dev/docs/agents).

## Next step

To hook your agent up automatically in one step, open Claude Code, Codex, or Cursor and paste:

```text
Set up thelastapi for me: follow https://thelastapi.dev/get-started.md
```

The agent runs the setup playbook, guides your sign-in, registers the MCP server, and installs agent skills. If you do not have an active account yet, create one at [thelastapi.dev/start](https://thelastapi.dev/start).

## Frequently asked questions

### What is the URL for the remote MCP server?

The remote MCP server endpoint is `https://thelastapi.dev/mcp`. It communicates over HTTP and uses OAuth 2.1 with PKCE for client authentication.

### How does authentication work if my agent runs in a headless environment?

In environments where an interactive browser cannot open, bypass OAuth by passing a pre-generated API key via an HTTP header: `--header "Authorization: Bearer $VIBIZ_API_KEY"`.

### What happens if an agent with a Limited key tries to issue a refund or read production secrets?

The server rejects the call with a `403 forbidden` status and `details.reason: "owner_only"`. The response includes a `details.grant_url` link where you can manually approve that specific permission.

### Can the remote MCP server access files stored locally on my laptop?

No, the remote server cannot read your local file system. Deployments over remote MCP accept file arrays directly (`files: [{ path, content }]`), or prompt you to run `npx @vibiz/cli deploy` via the terminal for directory uploads.

---

Published 2026-11-15 · https://thelastapi.dev/blog/connect-remote-mcp-server
