---
title: Using Hexclave with AI
description: Teach your coding agent how to use Hexclave — via web fetch, an installable skill, or the Hexclave MCP server.
sidebarTitle: Using Hexclave with AI
---

import { hexclaveAgentRemindersText } from "/snippets/hexclave-agent-reminders.jsx";

<Visibility for="agents">
{hexclaveAgentRemindersText}
</Visibility>

<Note>
  This page is for giving your own coding agent (Claude Code, Cursor, Codex, opencode, …) ongoing knowledge of Hexclave so it writes Hexclave code correctly.

  If you would like to use Hexclave to power your own CLI, see the [CLI Authentication](/guides/apps/authentication/cli-authentication) page.
</Note>

There are three ways to give a coding agent working knowledge of Hexclave. They differ only in how the instructions reach the agent — the knowledge is the same.

<CardGroup cols={3}>
  <Card title="Web Fetch" icon="wand-magic-sparkles" href="#option-1-web-fetch-recommended">
    Paste a one-line prompt — your agent fetches the live skill on demand.
  </Card>
  <Card title="Skill" icon="sparkles" href="#option-2-skill">
    Install the Hexclave `SKILL.md` file so your agent loads it automatically.
  </Card>
  <Card title="MCP" icon="plug" href="#option-3-mcp">
    Connect your agent to the Hexclave MCP server for live docs and `ask_hexclave` search.
  </Card>
</CardGroup>


## Option 1: Web fetch (recommended)

Most coding agents now support web fetch out of the box, so you can simply tell your agent to use Hexclave's skill from the internet.

To do so, paste the prompt below into your coding agent:

````markdown title="One-shot prompt"
Fetch https://skill.hexclave.com and follow it for this task.
````

The fetched `SKILL.md` indexes the entire Hexclave docs sidebar and tells the agent to pull fresh content for whichever surface you're touching (auth, orgs/teams, payments, emails, analytics, the CLI). It is purely a reference — paste it whenever you want the agent to use Hexclave knowledge.


## Option 2: Skill

Install the skill once so your agent loads it automatically every time Hexclave is relevant — no copy-paste required.

<Tabs>
  <Tab title="Cli install">
    The fastest way to install the Hexclave skill for a Claude Code-style agent or similar:

    ```sh title="Terminal"
    npx -y skills add hexclave/hexclave --skill stack-auth
    ```

    This detects your agent and installs the skill in the correct location (per-project or global) automatically. From then on, your agent picks it up whenever the conversation touches Hexclave.
  </Tab>

  <Tab title="Copy-paste prompt">
    If your agent can't run the `npx` command above, paste the prompt below into the chat. The agent will fetch `SKILL.md` and drop it into the right location for your agent — per-project if a project-scoped agent folder exists, global otherwise.

    ````markdown title="Skill install prompt"
    Install the Hexclave skill (`SKILL.md`) for me so you load it automatically on future Hexclave tasks. The canonical file lives at:

    https://raw.githubusercontent.com/hexclave/hexclave/dev/skills/hexclave/SKILL.md

    These are the same install locations the `skills` CLI (https://github.com/vercel-labs/skills) uses — match them exactly so the file is picked up the same way.

    Do this in one shot using smart defaults; only stop to ask a single multiple-choice question at the end if I want to change anything.

    1. **Detect the agent.** Identify which coding agent is running you (Claude Code, Codex, Cursor, opencode, Windsurf, Roo, Kilo, Amp, Antigravity, Cline, Continue, Crush, Augment, etc.). If you genuinely can't tell, default to Claude Code.

    2. **Pick the default scope.** Look for an existing agent folder in the current project root: `.claude/`, `.agents/`, `.cursor/`, `.codex/`, `.opencode/`, `.windsurf/`, `.roo/`, `.kilocode/`, `.augment/`, `.continue/`, `.crush/`, etc.
       - If any such folder exists → default to **project** scope.
       - Otherwise → default to **global** scope.

    3. **Resolve the install directory.** Write `SKILL.md` to `<skills-dir>/stack-auth/SKILL.md`, where `<skills-dir>` comes from this table (mirrors `vercel-labs/skills/src/agents.ts`):

       | Agent | Project `<skills-dir>` | Global `<skills-dir>` |
       | --- | --- | --- |
       | Claude Code | `.claude/skills` | `~/.claude/skills` (or `$CLAUDE_CONFIG_DIR/skills`) |
       | Codex | `.agents/skills` | `~/.codex/skills` (or `$CODEX_HOME/skills`) |
       | Cursor | `.agents/skills` | `~/.cursor/skills` |
       | opencode | `.agents/skills` | `~/.config/opencode/skills` (XDG) |
       | Windsurf | `.windsurf/skills` | `~/.codeium/windsurf/skills` |
       | Amp | `.agents/skills` | `~/.config/agents/skills` (XDG) |
       | Antigravity | `.agents/skills` | `~/.gemini/antigravity/skills` |
       | Cline | `.agents/skills` | `~/.agents/skills` |
       | Roo Code | `.roo/skills` | `~/.roo/skills` |
       | Kilo Code | `.kilocode/skills` | `~/.kilocode/skills` |
       | Augment | `.augment/skills` | `~/.augment/skills` |
       | Continue | `.continue/skills` | `~/.continue/skills` |
       | Crush | `.crush/skills` | `~/.config/crush/skills` |

       For any agent not listed, follow its documented skills directory or fall back to `.agents/skills` (project) / `~/.<agent>/skills` (global).

    4. **Install.** Download `SKILL.md` once to a stable cache location — `~/.cache/stack-auth/SKILL.md` (or `$XDG_CACHE_HOME/stack-auth/SKILL.md`) — then create a **symlink** at `<skills-dir>/stack-auth/SKILL.md` pointing to that cached file. Create missing parent directories. If the target path already exists, replace it (overwrite the symlink, or back up and replace a regular file). Symlinking means future re-installs at additional scopes/agents reuse the same source file, and re-running the prompt after an update to the cached file picks up automatically. If the platform doesn't support symlinks (e.g. Windows without dev mode), fall back to copying the file verbatim.

    5. **Confirm and offer alternatives.** Print the absolute symlink path and the cache target it points to. Then ask me a single multiple-choice question covering anything I might want to change, e.g.:

       ```
       Installed Hexclave skill at <path> → <cache path>. Want to change anything?
       a) Keep it — done
       b) Also symlink at the opposite scope (<other path>)
       c) Install for a different agent instead
       d) Symlink into additional agents too
       ```

       Only act on whichever letter I pick. Don't pre-ask before the first install. Additional installs just create more symlinks pointing at the same cached `SKILL.md`.

    Installing the file is the only goal of this prompt — do not act on the skill's contents yet.
    ````
  </Tab>
</Tabs>

## Option 3: MCP

The Hexclave MCP server (`https://mcp.hexclave.com/mcp`) gives your agent live access to Hexclave docs and skill via prompts, resources and an `ask_hexclave` tool that searches the docs with citations. Install it once per agent — it stays available across every project.

<Tabs>
  <Tab title="One-click install">
    <CardGroup cols={2}>
      <Card title="Add to Cursor" icon="square-arrow-up-right" href="cursor://anysphere.cursor-deeplink/mcp/install?name=stack-auth&config=eyJ1cmwiOiJodHRwczovL21jcC5zdGFjay1hdXRoLmNvbS9tY3AifQ==">
        Opens Cursor and adds `stack-auth` to your MCP config.
      </Card>
      <Card title="Add to VS Code" icon="square-arrow-up-right" href="https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522type%2522%253A%2522http%2522%252C%2522name%2522%253A%2522stack-auth%2522%252C%2522url%2522%253A%2522https%253A%252F%252Fmcp.hexclave.com%252Fmcp%2522%257D">
        Opens VS Code and adds `stack-auth` to your MCP config.
      </Card>
    </CardGroup>

    For the up-to-date list of one-click install buttons for every client (Cursor, VS Code, Claude Desktop, Windsurf, ChatGPT, Gemini, …), visit [`mcp.hexclave.com`](https://mcp.hexclave.com) in your browser.
  </Tab>

  <Tab title="Config files">
    <Tabs>
      <Tab title="Cursor">
        Add to `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (project):

        ```json title="mcp.json"
        {
          "mcpServers": {
            "stack-auth": {
              "url": "https://mcp.hexclave.com/mcp"
            }
          }
        }
        ```
      </Tab>

      <Tab title="Claude Code">
        ```sh title="Terminal"
        claude mcp add --transport http stack-auth https://mcp.hexclave.com/mcp
        ```
      </Tab>

      <Tab title="VS Code">
        ```sh title="Terminal"
        code --add-mcp '{"type":"http","name":"stack-auth","url":"https://mcp.hexclave.com/mcp"}'
        ```
      </Tab>

      <Tab title="Codex">
        ```sh title="Terminal"
        codex mcp add stack-auth --url https://mcp.hexclave.com/mcp
        ```

        Or add to `~/.codex/config.toml`:

        ```toml title="config.toml"
        [mcp_servers.stack-auth]
        url = "https://mcp.hexclave.com/mcp"
        ```
      </Tab>

      <Tab title="Windsurf">
        ```json title="mcp.json"
        {
          "mcpServers": {
            "stack-auth": {
              "serverUrl": "https://mcp.hexclave.com/mcp"
            }
          }
        }
        ```
      </Tab>

      <Tab title="Gemini CLI">
        Add to `~/.gemini/settings.json`:

        ```json title="settings.json"
        {
          "mcpServers": {
            "stack-auth": {
              "httpUrl": "https://mcp.hexclave.com/mcp",
              "headers": {
                "Accept": "application/json, text/event-stream"
              }
            }
          }
        }
        ```
      </Tab>
    </Tabs>

    For Claude Desktop, ChatGPT, and copy-paste markdown blocks you can drop into your project README, visit [`mcp.hexclave.com`](https://mcp.hexclave.com).
  </Tab>

  <Tab title="Ask your agent">
    If your agent can edit its own config, paste this prompt:

    ```markdown title="MCP install prompt"
    Install the Hexclave MCP server for me. The server URL is https://mcp.hexclave.com/mcp (HTTP transport).

    Detect which coding agent I'm using and add the server to the correct config file:
    - Claude Code → run `claude mcp add --transport http stack-auth https://mcp.hexclave.com/mcp`
    - Cursor → `~/.cursor/mcp.json`
    - VS Code → run `code --add-mcp '{"type":"http","name":"stack-auth","url":"https://mcp.hexclave.com/mcp"}'`
    - Codex → `~/.codex/config.toml`
    - opencode → `~/.config/opencode/opencode.json`
    - Gemini CLI → `~/.gemini/settings.json`

    If this repo already has a project-scoped MCP config (`.cursor/mcp.json`, `.vscode/mcp.json`, `.claude.json`, `.codex/config.toml`, etc.), install it there instead of the global location.

    After installing, confirm by listing the registered MCP servers.
    ```
  </Tab>
</Tabs>

## Project vs. global scope

The install prompts above follow the same rule for picking project-vs-global scope:

| Detected in project root | Skill / MCP install scope |
| --- | --- |
| `.claude/`, `.cursor/`, `.vscode/mcp.json`, `.codex/`, `.opencode/` | **Project** (inside the existing folder) |
| None of the above | **Global** (user-level config for the detected agent) |

This keeps shared repos clean (project-scoped config lives next to the code) and keeps your personal projects ergonomic (one global install, available everywhere).
