import { Callout, Steps, Tabs } from "nextra/components";
import {
  McpUrl,
  CursorDeeplinkButton,
  CursorMcpConfig,
  ClaudeCodeCommand,
  CursorTabLabel,
  ClaudeCodeTabLabel,
  OtherAgentsTabLabel,
} from "@/components/McpSetup";
import Keywords from "@/components/Keywords";

# Using Coding Agents

Hatchet is designed to work well with AI coding agents. This page covers how to give your agent access to Hatchet documentation and step-by-step skills for common CLI operations.

<Callout type="info">
  **Prerequisite:** The `hatchet skills install` and `hatchet docs install`
  commands require the Hatchet CLI. See the [CLI reference](/cli) for
  installation instructions.
</Callout>

## Agent Skills

Agent skills are reference documents that teach AI coding agents how to use the Hatchet CLI — triggering workflows, starting workers, debugging runs, and more.

Run the following command in your project root to install the skill package:

```bash copy
hatchet skills install
```

This creates a `skills/hatchet-cli/` directory with step-by-step reference files and appends a section to your project's `AGENTS.md` (and `CLAUDE.md`) pointing agents to the right file for each task.

**Install to a custom directory:**

```bash copy
hatchet skills install --dir ./my-project
```

After installation, commit the `skills/` directory and `AGENTS.md` to version control so all agents working in the repo benefit automatically.

### Available references

| Reference                         | When to use                                           |
| --------------------------------- | ----------------------------------------------------- |
| `references/setup-cli.md`         | Installing the CLI, creating or listing profiles      |
| `references/start-worker.md`      | Starting a dev worker for local development           |
| `references/trigger-and-watch.md` | Triggering a workflow and polling for completion      |
| `references/debug-run.md`         | Diagnosing a failed, stuck, or unexpected run         |
| `references/replay-run.md`        | Re-running a previous workflow with same or new input |

## MCP Server

Hatchet documentation is available as an **MCP (Model Context Protocol) server**, so AI coding assistants like Cursor and Claude Code can search and reference Hatchet docs directly.

MCP endpoint: <McpUrl />

<Tabs items={[<CursorTabLabel />, <ClaudeCodeTabLabel />, <OtherAgentsTabLabel />]}>
  <Tabs.Tab>

    <Tabs items={['Hatchet CLI', 'One-Click Install', 'Manual Config']}>
      <Tabs.Tab>

        ```bash copy
        hatchet docs install cursor
        ```

        This creates a `.cursor/rules/hatchet-docs.mdc` file and prints the one-click deeplink.

      </Tabs.Tab>
      <Tabs.Tab>

        Install the Hatchet docs MCP server in Cursor with one click:

        <CursorDeeplinkButton />

      </Tabs.Tab>
      <Tabs.Tab>

        <Steps>

        ### Open Cursor Settings

        Go to **Cursor Settings** → **MCP** → **Add new MCP server**.

        ### Add the server configuration

        <CursorMcpConfig />

        ### Use in chat

        Reference Hatchet docs in any Cursor chat with `@hatchet-docs` or ask questions and the agent will automatically search the docs.

        </Steps>

      </Tabs.Tab>
    </Tabs>

  </Tabs.Tab>
  <Tabs.Tab>

    <Tabs items={['Hatchet CLI', 'Command']}>
      <Tabs.Tab>

        ```bash copy
        hatchet docs install claude-code
        ```

        If `claude` is on your PATH, this runs the command automatically. Otherwise it prints it for you to copy.

      </Tabs.Tab>
      <Tabs.Tab>

        Run this command in your terminal:

        <ClaudeCodeCommand />

      </Tabs.Tab>
    </Tabs>

  </Tabs.Tab>
  <Tabs.Tab>

    For any AI tool that supports [llms.txt](https://llmstxt.org/), Hatchet docs are available at:

    | Resource | URL |
    |----------|-----|
    | **llms.txt** (index) | [docs.hatchet.run/llms.txt](https://docs.hatchet.run/llms.txt) |
    | **llms-full.txt** (all docs) | [docs.hatchet.run/llms-full.txt](https://docs.hatchet.run/llms-full.txt) |
    | **Per-page markdown** | `docs.hatchet.run/llms/{section}/{page}.md` |
    | **MCP endpoint** | <McpUrl /> |

    Every documentation page also includes a `<link rel="alternate" type="text/markdown">` header
    pointing to its markdown version, and a "View as Markdown" link at the top of the page.

  </Tabs.Tab>
</Tabs>

## llms.txt

For any AI tool that supports [llms.txt](https://llmstxt.org/), Hatchet docs are available at:

| Resource                     | URL                                                                      |
| ---------------------------- | ------------------------------------------------------------------------ |
| **llms.txt** (index)         | [docs.hatchet.run/llms.txt](https://docs.hatchet.run/llms.txt)           |
| **llms-full.txt** (all docs) | [docs.hatchet.run/llms-full.txt](https://docs.hatchet.run/llms-full.txt) |
| **Per-page markdown**        | `docs.hatchet.run/llms/{section}/{page}.md`                              |
| **MCP endpoint**             | <McpUrl />                                                               |

Every documentation page also includes a `<link rel="alternate" type="text/markdown">` header
pointing to its markdown version, and a "View as Markdown" link at the top of the page.

<Keywords keywords="mcp, skills, cursor, claude code, llms.txt" />
