Skip to content

Claude Code Integration

Claude Code is Anthropic’s official CLI and VS Code extension for Claude. This guide covers integrating Moira with Claude Code.

Prerequisites

  • Claude Code installed and configured
  • Moira server access (cloud or self-hosted)
  • Valid Moira account credentials

Configuration

  1. Open Claude Code settings

    In VS Code, open Command Palette and run:

    Claude Code: Open Settings

    Or edit directly:

    {/* prettier-ignore */}

  • ~/.claude/
    • settings.json
  1. Add Moira MCP server

    Add to your settings.json with URL: https://moira-mcp.com/mcp

  2. Restart Claude Code

    Reload the window or restart VS Code to apply changes.

  3. Authenticate

    When first using Moira tools, you’ll be prompted to authenticate. Follow the OAuth flow in your browser.

    Alternative: API Token

    If OAuth is not available, create an API token in Moira web UI (Settings → API Tokens) and add it to your MCP config as a Bearer token header. See MCP Clients → API Tokens for details.

Verify Connection

Test the connection by asking Claude:

List available Moira workflows

You should see your workflows listed.

Using Moira in Claude Code

Starting a Workflow

Start the "development-flow" workflow in Moira

Claude will:

  1. Call start with action: "prepare" and the workflow ID
  2. Call start with action: "execute" and the returned Start attempt ID
  3. Receive the Process ID, Step attempt ID, and first directive
  4. Execute the directive
  5. Submit results via step
  6. Continue until workflow completes

Continuing a Session

If a session was interrupted, continue with:

Continue my Moira workflow with process ID abc-123

Getting Help

Show Moira documentation for nodes

Claude will call help with the topic.

CLAUDE.md Integration

For project-specific workflows, add to your CLAUDE.md:

## Moira Workflows
This project uses Moira for development workflows.
### Available Workflows
- `dev-flow` - Main development workflow
- `review-flow` - Code review workflow
### Starting Development
To start a task, run the development workflow:
1. Prepare and execute a start for the `dev-flow` workflow
2. Follow each step directive
3. Submit results before moving to next step

Add workflow process IDs to your CLAUDE.md for easy resumption after session interruption.

Available Tools

The core workflow lifecycle uses these tools:

ToolDescription
listList available workflows
startPrepare or execute a replay-safe workflow start
stepSubmit result, get next directive
helpGet documentation
settingsUser settings management
sessionSession and execution info

See the MCP tools reference for the complete current catalog, input schemas, actions, and examples.

Troubleshooting

Connection Issues

  1. Verify MCP server URL is correct
  2. Check network connectivity
  3. Ensure authentication is valid
  4. Check Claude Code logs for errors

Workflow Not Starting

  1. Verify workflow ID exists: list
  2. Check workflow visibility permissions
  3. Ensure you have access to the workflow

Session Lost

If process ID is lost:

  1. Check session({ action: "executions" }) for active executions
  2. Resume with the correct process ID
  3. Consider adding process ID to CLAUDE.md for persistence

Best Practices

  1. Save Process IDs - Store in CLAUDE.md for session continuity
  2. Follow Directives - Execute exactly what the directive says
  3. Meet Completion Conditions - Verify before submitting
  4. Check Help - Use help when unsure