Skip to main content
After completing this guide, your component catalog will be indexed and queryable by AI through the MCP server or the Storybook addon.

Before you begin

  • A running Storybook instance or a deployed Storybook URL
  • Node.js 18 or higher
  • An API key from the Loracle dashboard (Project Settings > API Keys)

Publish your Storybook

1

Install the CLI

npm install -g @loracle/cli
Or run it directly with npx:
npx @loracle/cli publish <url> --version <version>
2

Set your API key

export LORACLE_API_KEY="sk_live_..."
3

Run publish

loracle publish https://your-storybook.com --version 1.0.0
The CLI connects to your Storybook, extracts every component with its props and documentation, and uploads the catalog to Loracle.
FlagDescription
<url>URL of your running Storybook
--versionSemver string (e.g. 1.0.0). Each publish creates a versioned snapshot of your catalog.
--api-urlOverride the Loracle API endpoint. Optional.

CI/CD

Automate publishing on every release. The CLI uses Playwright internally to scrape your Storybook, so your CI environment needs a Chromium browser available.
Store your LORACLE_API_KEY as a CI secret. Never commit it to your repository.
The core steps are the same on every CI:
  1. Install your dependencies
  2. Install Chromium (npx playwright install --with-deps chromium)
  3. Build and serve your Storybook on a local port
  4. Wait for the server (npx wait-on http://localhost:6006)
  5. Run npx @loracle/cli publish <url> --version <version>
Add these steps to your workflow. ubuntu-latest requires an explicit Chromium install.
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
  with:
    node-version: 20

- run: npm ci
- run: npx playwright install --with-deps chromium

- name: Serve Storybook
  run: |
    npm run build-storybook
    npx http-server storybook-static -p 6006 &
    npx wait-on http://localhost:6006

- name: Publish to Loracle
  env:
    LORACLE_API_KEY: ${{ secrets.LORACLE_API_KEY }}
  run: npx @loracle/cli publish http://localhost:6006 --version <your-version>
Store LORACLE_API_KEY as a repository secret.

Next steps

MCP server

Connect your coding agent to the published catalog.

Storybook addon

Use AI to generate stories from inside Storybook.