# Setup

Connect Cursor, Claude Code, Codex, ChatGPT, Claude, VS Code or any MCP client to the hosted Zernio MCP server with OAuth or an API key, or run the server locally.

import { Tab, Tabs } from 'fumadocs-ui/components/tabs';

Connect Cursor, Claude Code, Codex, ChatGPT, Claude, VS Code or any MCP client to `https://mcp.zernio.com/mcp` with OAuth or an API key.

## Authentication

The server is hosted, so there is nothing to install. The [MCP page](/mcp) has a first tool call over plain HTTP.

The hosted server accepts two credentials:

- **OAuth**: your MCP client opens a browser and you sign in with your Zernio account. There is no key to copy, and you can revoke a client from your dashboard at any time.
- **API key**: pass an [API key](https://zernio.com/dashboard/api-keys) in the `Authorization: Bearer` header. Use this for clients without OAuth support and for autonomous agents.

A client that supports OAuth needs only the server URL. The server advertises its authorization flow and the client walks you through sign-in on first use.

The server implements:

- The MCP authorization spec
- OAuth 2.1 with PKCE
- Discovery metadata
- Open dynamic client registration (RFC 7591), so any MCP client can register itself without pre-approval

<Callout type="warn">
Config files are not shell scripts. Wherever a sample on this page shows `$ZERNIO_API_KEY`, paste the key itself if your client does not expand it.
</Callout>

Some clients (Claude Desktop on Windows among them) do not expand environment variables into a config value or into `npx` args. That leaves the header empty and produces a misleading 404 or OAuth-discovery error.

## Connect your client

<Tabs items={['Cursor', 'Claude Code', 'Codex', 'ChatGPT', 'Claude', 'VS Code', 'Other']}>
<Tab value="Cursor">

[Install in Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=zernio&config=eyJ1cmwiOiJodHRwczovL21jcC56ZXJuaW8uY29tL21jcCJ9)

The install link opens Cursor and adds the server. To add it by hand instead, put this in `~/.cursor/mcp.json` (or a project's `.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "zernio": {
      "url": "https://mcp.zernio.com/mcp"
    }
  }
}
```

Cursor prompts you to sign in with your Zernio account. To use an API key instead, pass it as a header:

```json
{
  "mcpServers": {
    "zernio": {
      "url": "https://mcp.zernio.com/mcp",
      "headers": {
        "Authorization": "Bearer $ZERNIO_API_KEY"
      }
    }
  }
}
```

The Cursor [documentation](https://docs.cursor.com/context/model-context-protocol) covers the file format.

</Tab>
<Tab value="Claude Code">

Add the server:

```bash
claude mcp add --transport http zernio https://mcp.zernio.com/mcp
```

Then sign in with your Zernio account:

```bash
claude /mcp
```

To use an API key instead of OAuth, pass it when adding the server:

```bash
claude mcp add --transport http zernio https://mcp.zernio.com/mcp \
  --header "Authorization: Bearer $ZERNIO_API_KEY"
```

The [Zernio plugin](https://github.com/zernio-dev/zernio-claude-plugin) bundles the MCP server with skills and slash commands, and prompts once for an API key that it stores in your system keychain:

```
/plugin marketplace add zernio-dev/zernio-claude-plugin
/plugin install zernio@zernio
```

The Claude Code [documentation](https://docs.anthropic.com/en/docs/claude-code/mcp) covers MCP servers in general.

</Tab>
<Tab value="Codex">

Add the server:

```bash
codex mcp add zernio --url https://mcp.zernio.com/mcp
```

Then sign in with your Zernio account:

```bash
codex mcp login zernio
```

This writes the following to `~/.codex/config.toml`:

```toml
[mcp_servers.zernio]
url = "https://mcp.zernio.com/mcp"
```

To use an API key instead of OAuth, reference it from an environment variable:

```toml
[mcp_servers.zernio]
url = "https://mcp.zernio.com/mcp"
bearer_token_env_var = "ZERNIO_API_KEY"
```

The Codex [documentation](https://developers.openai.com/codex/mcp) covers the file format.

</Tab>
<Tab value="ChatGPT">

MCP servers are available on ChatGPT Pro, Plus, Business, Enterprise and Education accounts.

Follow the [OpenAI documentation](https://platform.openai.com/docs/guides/developer-mode) to enable developer mode, then create a custom connector with:

- **Server URL:** `https://mcp.zernio.com/mcp`
- **Authentication:** OAuth

ChatGPT redirects you to sign in with your Zernio account, and the connector activates.

</Tab>
<Tab value="Claude">

[Add to Claude](https://claude.ai/customize/connectors?modal=add-custom-connector&connectorName=Zernio&connectorUrl=https%3A%2F%2Fmcp.zernio.com%2Fmcp)

The link opens Claude with the connector filled in. To add it by hand instead, in Claude (web, desktop or mobile) open Settings, then Connectors, then Add custom connector:

- **Name:** Zernio
- **URL:** `https://mcp.zernio.com/mcp`

Click **Add**. Claude redirects you to sign in with your Zernio account, then the connector activates. No API key is needed.

Claude Desktop's `claude_desktop_config.json` only supports local stdio servers. Use the connector for the hosted server, or the config-file bridge in the **Other** tab.

</Tab>
<Tab value="VS Code">

[Install in VS Code](https://vscode.dev/redirect/mcp/install?name=zernio&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fmcp.zernio.com%2Fmcp%22%7D)

The install link opens VS Code and adds the server. To add it by hand instead, put this in the project's `.vscode/mcp.json`:

```json
{
  "servers": {
    "zernio": {
      "type": "http",
      "url": "https://mcp.zernio.com/mcp"
    }
  }
}
```

The VS Code [documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) covers the file format.

</Tab>
<Tab value="Other">

Zernio is published to the [MCP Registry](https://registry.modelcontextprotocol.io) as `com.zernio/zernio`.

Use the server URL `https://mcp.zernio.com/mcp` and OAuth when your client supports it.

If your client does not support OAuth, pass an API key in the `Authorization` header. A client might accept this shape:

```json
{
  "zernio": {
    "url": "https://mcp.zernio.com/mcp",
    "headers": {
      "Authorization": "Bearer $ZERNIO_API_KEY"
    }
  }
}
```

#### stdio-only clients

If your client only supports local stdio servers (`command` plus `args`), bridge to the hosted server with [`mcp-remote`](https://www.npmjs.com/package/mcp-remote):

```json
{
  "mcpServers": {
    "zernio": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote@latest",
        "https://mcp.zernio.com/mcp",
        "--header",
        "Authorization: Bearer $ZERNIO_API_KEY"
      ]
    }
  }
}
```

Omit the two `--header` entries to authenticate with OAuth instead. `mcp-remote` opens a browser window for sign-in.

</Tab>
</Tabs>

Confirm the connection the same way in any client: ask the assistant to list your connected Zernio accounts.

A working server answers from the `accounts_list` tool with one line per account (`- instagram: acmecorp (ID: 66b2e19d8c3f5a7e9d0b1c2d)`). With no accounts yet, it answers `No accounts connected`.

Anything else is one of the failures below.

## Building autonomous agents

An agent passes an API key as the bearer credential straight to the hosted server. The server speaks Streamable HTTP, so any MCP SDK or plain HTTP works.

The [MCP page](/mcp#autonomous-agents) has a complete `tools/call` request with its response.

Do not embed API keys in code. Provide them to the agent through a secrets vault or an environment variable.

Create a dedicated key per agent on [API keys](https://zernio.com/dashboard/api-keys) so you can revoke it independently.

## Run the server locally

The MCP server ships inside the [Python SDK](https://github.com/zernio-dev/zernio-python). You can also run it as a local stdio process:

- For clients without HTTP support
- For air-gapped setups
- To pin a version

The local server authenticates with an API key from the `ZERNIO_API_KEY` environment variable. OAuth is only available on the hosted server.

<Tabs items={['uvx (no install)', 'pip']}>
<Tab value="uvx (no install)">

With [uv](https://docs.astral.sh/uv/) installed, configure your client to run the server through `uvx`, with no install step:

```json
{
  "mcpServers": {
    "zernio": {
      "command": "uvx",
      "args": ["--from", "zernio-sdk[mcp]", "zernio-mcp"],
      "env": {
        "ZERNIO_API_KEY": "$ZERNIO_API_KEY"
      }
    }
  }
}
```

To install uv:

```bash
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows (PowerShell)
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
```

</Tab>
<Tab value="pip">

Install the SDK with the MCP extra:

```bash
pip install "zernio-sdk[mcp]"
```

This puts the `zernio-mcp` command on your PATH. Configure your client:

```json
{
  "mcpServers": {
    "zernio": {
      "command": "zernio-mcp",
      "env": {
        "ZERNIO_API_KEY": "$ZERNIO_API_KEY"
      }
    }
  }
}
```

If your client cannot find the command, use the absolute path (`which zernio-mcp` prints it) or the uvx method.

</Tab>
</Tabs>

The package also includes `zernio-mcp-http`, which serves the same Streamable HTTP transport as the hosted server if you want to self-host it.

See the [HTTP deployment guide](https://github.com/zernio-dev/zernio-python/blob/main/docs/HTTP_DEPLOYMENT.md).

## If it fails

### `401 Unauthorized`

The server rejected the credential.

**With an API key**, check it on [API keys](https://zernio.com/dashboard/api-keys). It must be active and copied without extra spaces.

**With OAuth**, remove and re-add the server so the client runs the sign-in flow again.

### `Couldn't register with Zernio's sign-in service`

Your client failed OAuth dynamic client registration.

Registration is open to any MCP client (any https, loopback or app-scheme callback), so this is usually transient. Remove the server or connector and add it again to restart the flow.

If it persists, check [status.zernio.com](https://status.zernio.com) or fall back to an API key in the `Authorization` header.

### Claude connector says `Couldn't reach the MCP server`

Remove the connector and add it again. Claude caches a failed authorization attempt, so a stale failure persists until you re-add it.

### `No accounts connected`

Connect an account at [zernio.com](https://zernio.com) before you post. The [connecting accounts guide](/guides/connecting-accounts) covers every platform.

### Changes not taking effect

After editing your client's MCP configuration, restart the client completely.

### `Command not found: uvx` (local setup only)

Check that uv is installed and on your PATH:

```bash
uvx --version
curl -LsSf https://astral.sh/uv/install.sh | sh
```

Restart your terminal or add uv to your PATH after installing.

## Related

- [MCP](/mcp): a first tool call over plain HTTP and how the server behaves.
- [Tools](/mcp/tools): the core tool parameters and the `tools/list` catalog.
- [API keys](https://zernio.com/dashboard/api-keys)
- [Python SDK](https://github.com/zernio-dev/zernio-python): the package the server ships in.
- [Status page](https://status.zernio.com)