> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pullstory.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Code

> Ask Claude Code "make a video explaining this feature" and it builds a pull story brief.

## What you get

Tell Claude Code, in plain English:

> *"Make a pull story explaining the auth flow in this repo."*

It will:

1. Identify the relevant files
2. Read the meaningful line ranges
3. Build a concise structured brief
4. Call the pull/story MCP tool
5. Paste the pull story URL back into your chat

All without leaving your terminal.

<Frame>
  <img src="https://pullstory.com/brand/claude-code-demo.gif" alt="Claude Code creating a pull story video" />
</Frame>

## Setup (2 minutes)

<Steps>
  <Step title="Get an API key">
    Visit [pullstory.com/dashboard/api-keys](https://pullstory.com/dashboard/api-keys) → **Create key**.
  </Step>

  <Step title="Add the pull/story MCP server">
    Create or edit `.mcp.json` in your project root:

    ```json .mcp.json theme={null}
    {
      "mcpServers": {
        "pullstory": {
          "command": "npx",
          "args": ["-y", "@pullstory/mcp@latest"],
          "env": {
            "PULLSTORY_API_KEY": "${PULLSTORY_API_KEY}"
          }
        }
      }
    }
    ```

    <Warning>
      Keep `PULLSTORY_API_KEY` in your shell or password manager. Do not commit a raw `ps_live_...` key in `.mcp.json`.
    </Warning>

    On native Windows, use `"command": "cmd"` and `"args": ["/c", "npx", "-y", "@pullstory/mcp@latest"]`.
  </Step>

  <Step title="Restart Claude Code">
    Close and reopen, or run `/mcp` to reload. You should see `pullstory` listed.
  </Step>

  <Step title="Try it">
    ```
    > Make a pull story explaining the auth flow in this repo
    ```

    Claude Code will read the relevant files, create a structured brief, call pull/story, and return the link.
  </Step>
</Steps>

## Available tools

Once the MCP is wired up, Claude Code has access to these tools:

<ResponseField name="create_pull_story" type="tool">
  Generate a pull story from a structured code brief. Returns the story URL.
</ResponseField>

<ResponseField name="get_pull_story" type="tool">
  Check the generation status of an existing pull story.
</ResponseField>

## Natural-language triggers

Any of these phrasings will typically trigger the tool:

* *"make a video explaining this feature"*
* *"create a pullstory for auth"*
* *"visualize this flow"*
* *"walk me through how this code works"*
* *"turn this branch into a pullstory"*

## Troubleshooting

<AccordionGroup>
  <Accordion title="Claude Code doesn't see the MCP server">
    Run `/mcp` inside Claude Code to list active servers. If `pullstory` is missing, check `.mcp.json` for JSON errors and restart.
  </Accordion>

  <Accordion title="'Unauthorized' error">
    Your `PULLSTORY_API_KEY` is wrong or revoked. Generate a new one at [pullstory.com/dashboard/api-keys](https://pullstory.com/dashboard/api-keys).
  </Accordion>

  <Accordion title="'Brief failed schema validation'">
    The generated brief is missing required fields or includes oversized excerpts. Ask Claude Code to use fewer files and tighter excerpts.
  </Accordion>
</AccordionGroup>

## Next

<CardGroup cols={2}>
  <Card title="MCP setup details" icon="plug" href="/integrations/mcp-setup">
    Works with Cursor, Windsurf, Claude Desktop too.
  </Card>

  <Card title="Full workflow cookbook" icon="book" href="/cookbooks/claude-code-make-pr">
    Step-by-step example with real output.
  </Card>
</CardGroup>
