Claude Code Setup
Connect Claude Code to Agiflow using MCP for seamless project management, scaffolding, and architecture validation. Choose from two connection methods based on your workflow.
Prerequisites
Claude Code installed
Download from claude.com/claude-code
Agiflow account and project
Create a free account at agiflow.io
Choose Your Connection Method
Method 1: Agent-CLI (Recommended)
Connect to a locally running agent-cli daemon for advanced session management, model routing, and task tracking. Enables autonomous execution from Agiflow platform in Docker.
Method 2: HTTP MCP
Direct HTTP connection to Agiflow API. Configure via JSON file with OAuth2 or API key authentication.
Method 1: Agent-CLI (Recommended)
Connect to a locally running agent-cli daemon for advanced session management, model routing, and autonomous task execution from Agiflow platform in Docker.
Install Agent-CLI
Install the @agiflowai/agent-cli package globally:
npm install -g @agiflowai/agent-cliConnect and Authenticate
Authenticate with Agiflow using the device code flow:
agent-cli daemon~/.agiflow/ for future use.Use Dashboard Chat
Once authenticated, the agent daemon automatically launches Claude Code when you interact with tasks through the Agiflow Dashboard chat interface.
Method 2: HTTP MCP
Connect Claude Code to Agiflow using HTTP MCP for seamless project management and code generation.
Get Your Configuration
From your Agiflow dashboard, navigate to your project and click the Actions menu, then select Project MCP.
In the MCP setup dialog, select HTTP MCP as the setup method. You can use either OAuth2 or API key for MCP authorization.
You'll see two sections: environment variables and MCP configuration JSON.
Set Environment Variables (API key only)
Copy the export commands from the setup dialog and add them to your shell profile:
# Add to ~/.bashrc, ~/.zshrc, or ~/.profile
export AGIFLOW_MCP_API_KEY="your-generated-api-key"source ~/.zshrc (or your shell config file) to load the variables, or restart your terminal.Configure Claude Code MCP Settings
Create or edit the MCP configuration file in your project root:
.mcp.json (project root)Add MCP Server Configuration
Copy the JSON configuration from the Agiflow setup dialog and paste it into the mcpServers object:
{
"mcpServers": {
"agiflow-project-mcp": {
"type": "http",
"url": "https://agiflow.io/api/v1/organizations/YOUR_ORG_ID/projects/YOUR_PROJECT_ID/mcp",
"headers": {
"X-API-KEY": "${AGIFLOW_MCP_API_KEY}"
}
}
}
}$${VARIABLE}). Claude Code will replace these with the actual values from your shell environment.Restart Claude Code
Completely restart Claude Code (quit and reopen) to load the new MCP server configuration and environment variables.
Verify Connection
After setup with any method, verify the connection by checking available MCP tools:
- Open Claude Code's MCP panel (View → MCP Servers)
- Look for "agiflow-project-mcp" with a green connection indicator
- Verify available tools include: create-task, list-tasks, create-work-unit, etc.
Frequently Asked Questions
Why is my Claude Code MCP connection failing or showing a red indicator?
- Verify your API key is correct and hasn't expired
- Check the MCP URL matches your organization and project IDs
- Ensure you have an active internet connection
- For agent-cli: verify the daemon is running (
agent-cli status) - Try refreshing the MCP server connection
Why are MCP tools not appearing in Claude Code?
- Restart Claude Code completely (quit and reopen)
- Check the .mcp.json file has valid JSON syntax
- Verify the server isn't disabled in MCP settings
- For agent-cli: check daemon logs (
agent-cli logs)