# Connect from Claude Code (CLI)

Connect the ZenCreator MCP server to the Claude Code CLI. ZenCreator's MCP is a **hosted, remote server secured with OAuth 2.1** — you add one URL and log in once in your browser. There are no API keys to paste, nothing to install, and no local process to run. Claude Code stores the token and refreshes it automatically.

- MCP endpoint: `https://mcp.zncr.pro/mcp`
- Prerequisite: a ZenCreator account at <https://app.zencreator.pro> (you log in with it during OAuth).

## 1. Add the server

```bash
claude mcp add --transport http zencreator https://mcp.zncr.pro/mcp
```

This registers a server named `zencreator` using the HTTP transport pointed at the remote endpoint.

### Choose a scope

By default the server is added at the **local** scope (this project only). Use a flag to widen it:

| Scope | Flag | Effect |
| --- | --- | --- |
| local | *(default)* | Available in the current project only. |
| user | `--scope user` | Available across all your projects. |
| project | `--scope project` | Shared with the project via a committed `.mcp.json`. |

Example, available everywhere:

```bash
claude mcp add --transport http --scope user zencreator https://mcp.zncr.pro/mcp
```

### JSON form

To wire it up by hand (for example, `--scope project` writes this into `.mcp.json` at the project root):

```json
{
  "mcpServers": {
    "zencreator": {
      "type": "http",
      "url": "https://mcp.zncr.pro/mcp"
    }
  }
}
```

## 2. Authenticate (OAuth)

Adding the server does not log you in. Until you authenticate, the server shows as **Needs authentication**.

1. Start Claude Code:
   ```bash
   claude
   ```
2. Run the `/mcp` slash command.
3. Pick the `zencreator` server, then choose **Authenticate**.
4. Your browser opens to log in at ZenCreator. Approve the consent screen, which grants the scopes `mcp.read` and `mcp.generate`.
5. The token is stored by Claude Code and **refreshes automatically** — you should not need to log in again.

The first connect can be slow while the client runs OAuth discovery and the login round-trip. To re-authenticate later (for example, after revoking access), run `/mcp` again and choose **Authenticate**.

## 3. Verify

Check registration and auth status from the shell:

```bash
claude mcp list
```

This shows the `zencreator` server and reports **Needs authentication** until you have logged in.

Then confirm the tools actually work by asking your agent to call one. In a `claude` session, try:

> Use ZenCreator to call `zencreator_get_me` and show my credit balance.

or

> List the ZenCreator generation tools with `zencreator_list_tools`.

If `zencreator_get_me` returns your profile and credit balance, the connection is live. The `zencreator_*` tools are now available to your agent for generation, assets, templates, and account tasks.

## Manage the connection

- **Status:** `claude mcp list`
- **Re-authenticate:** run `/mcp` inside `claude`, pick `zencreator`, choose **Authenticate**.
- **Remove:**
  ```bash
  claude mcp remove zencreator
  ```

## Troubleshooting

- **`claude mcp list` says "Needs authentication"** — you have added the server but not logged in. Run `/mcp` and authenticate.
- **First call hangs or feels slow** — the first connect runs OAuth discovery plus the browser login; subsequent calls are fast.
- **No ZenCreator account** — sign up at <https://app.zencreator.pro> first; you log in with it during OAuth.

See [Troubleshooting](../troubleshooting.md) for more.

## Next steps

- [Quickstart](../quickstart.md) — your first generation, end to end.
- [Documentation home](../index.md) — overview of the server and every page.
- [Troubleshooting](../troubleshooting.md) — common connection and auth issues.
