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
-
Open Claude Code settings
In VS Code, open Command Palette and run:
Claude Code: Open SettingsOr edit directly:
{/* prettier-ignore */}
- ~/.claude/
- settings.json
-
Add Moira MCP server
Add to your
settings.jsonwith URL:https://moira-mcp.com/mcp -
Restart Claude Code
Reload the window or restart VS Code to apply changes.
-
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 workflowsYou should see your workflows listed.
Using Moira in Claude Code
Starting a Workflow
Start the "development-flow" workflow in MoiraClaude will:
- Call
startwithaction: "prepare"and the workflow ID - Call
startwithaction: "execute"and the returned Start attempt ID - Receive the Process ID, Step attempt ID, and first directive
- Execute the directive
- Submit results via
step - Continue until workflow completes
Continuing a Session
If a session was interrupted, continue with:
Continue my Moira workflow with process ID abc-123Getting Help
Show Moira documentation for nodesClaude 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` workflow2. Follow each step directive3. Submit results before moving to next stepAdd workflow process IDs to your CLAUDE.md for easy resumption after session interruption.
Available Tools
The core workflow lifecycle uses these tools:
| Tool | Description |
|---|---|
list | List available workflows |
start | Prepare or execute a replay-safe workflow start |
step | Submit result, get next directive |
help | Get documentation |
settings | User settings management |
session | Session and execution info |
See the MCP tools reference for the complete current catalog, input schemas, actions, and examples.
Troubleshooting
Connection Issues
- Verify MCP server URL is correct
- Check network connectivity
- Ensure authentication is valid
- Check Claude Code logs for errors
Workflow Not Starting
- Verify workflow ID exists:
list - Check workflow visibility permissions
- Ensure you have access to the workflow
Session Lost
If process ID is lost:
- Check
session({ action: "executions" })for active executions - Resume with the correct process ID
- Consider adding process ID to CLAUDE.md for persistence
Best Practices
- Save Process IDs - Store in CLAUDE.md for session continuity
- Follow Directives - Execute exactly what the directive says
- Meet Completion Conditions - Verify before submitting
- Check Help - Use
helpwhen unsure
Related
- Quick Start - General setup guide
- MCP Clients - Other client integrations