claude-flow — Claude Code MCP server: what it does, how to install
Connect Claude Code to claude-flow tools for agent coordination and shared task context. The MCP setup uses ANTHROPIC_API_KEY.
claude mcp add --env ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> --env CLAUDE_FLOW_MODE=<CLAUDE_FLOW_MODE> --env CLAUDE_FLOW_MEMORY_PATH=<CLAUDE_FLOW_MEMORY_PATH> --env CLAUDE_FLOW_MAX_AGENTS=<CLAUDE_FLOW_MAX_AGENTS> --env CLAUDE_FLOW_PORT=<CLAUDE_FLOW_PORT> --transport stdio claude-flow -- npx -y claude-flowWhat claude-flow does
claude-flow adds an agent-management layer around Claude Code and Codex. Its MCP server exposes tools for coordinating agents and working with memory across sessions. You can connect it locally with npx.
The Claude Code setup command takes ANTHROPIC_API_KEY, GITHUB_TOKEN, and FLOW_NEXUS_API_KEY. Without the required key values, that configured command cannot start the server as intended. The project also describes agent swarms and communication across machines; those capabilities depend on the chosen mode and configuration.
What it helps with
- connect claude-flow tools to Claude Code over MCP
- coordinate several agents on a task
- carry context between sessions
- enable agents on separate machines to communicate
Example prompts for the agent
- Coordinate several agents to complete this task.
- Use claude-flow memory to continue with context from the previous session.
- Set up communication between agents on separate machines.
How to install claude-flow
Platform CLI
claude mcp add --env ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> --env CLAUDE_FLOW_MODE=<CLAUDE_FLOW_MODE> --env CLAUDE_FLOW_MEMORY_PATH=<CLAUDE_FLOW_MEMORY_PATH> --env CLAUDE_FLOW_MAX_AGENTS=<CLAUDE_FLOW_MAX_AGENTS> --env CLAUDE_FLOW_PORT=<CLAUDE_FLOW_PORT> --transport stdio claude-flow -- npx -y claude-flowReplace <…> with your own values. 2 more environment variables are in the server README
Platform CLI
codex mcp add claude-flow --env ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> --env CLAUDE_FLOW_MODE=<CLAUDE_FLOW_MODE> --env CLAUDE_FLOW_MEMORY_PATH=<CLAUDE_FLOW_MEMORY_PATH> --env CLAUDE_FLOW_MAX_AGENTS=<CLAUDE_FLOW_MAX_AGENTS> --env CLAUDE_FLOW_PORT=<CLAUDE_FLOW_PORT> -- npx -y claude-flowReplace <…> with your own values. 2 more environment variables are in the server README
Config file
{
"mcpServers": {
"claude-flow": {
"command": "npx",
"args": [
"-y",
"claude-flow"
],
"env": {
"ANTHROPIC_API_KEY": "<ANTHROPIC_API_KEY>",
"CLAUDE_FLOW_MODE": "<CLAUDE_FLOW_MODE>",
"CLAUDE_FLOW_MEMORY_PATH": "<CLAUDE_FLOW_MEMORY_PATH>",
"CLAUDE_FLOW_MAX_AGENTS": "<CLAUDE_FLOW_MAX_AGENTS>",
"CLAUDE_FLOW_PORT": "<CLAUDE_FLOW_PORT>"
}
}
}
}Replace <…> with your own values. 2 more environment variables are in the server README
Config file
{
"servers": {
"claude-flow": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"claude-flow"
],
"env": {
"ANTHROPIC_API_KEY": "<ANTHROPIC_API_KEY>",
"CLAUDE_FLOW_MODE": "<CLAUDE_FLOW_MODE>",
"CLAUDE_FLOW_MEMORY_PATH": "<CLAUDE_FLOW_MEMORY_PATH>",
"CLAUDE_FLOW_MAX_AGENTS": "<CLAUDE_FLOW_MAX_AGENTS>",
"CLAUDE_FLOW_PORT": "<CLAUDE_FLOW_PORT>"
}
}
}
}Replace <…> with your own values. 2 more environment variables are in the server README
Platform CLI
gemini mcp add -e ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> -e CLAUDE_FLOW_MODE=<CLAUDE_FLOW_MODE> -e CLAUDE_FLOW_MEMORY_PATH=<CLAUDE_FLOW_MEMORY_PATH> -e CLAUDE_FLOW_MAX_AGENTS=<CLAUDE_FLOW_MAX_AGENTS> -e CLAUDE_FLOW_PORT=<CLAUDE_FLOW_PORT> claude-flow npx -y claude-flowReplace <…> with your own values. 2 more environment variables are in the server README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about claude-flow
How do I install claude-flow in Claude Code?
Run `claude mcp add claude-flow -e ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> -e GITHUB_TOKEN=<GITHUB_TOKEN> -e FLOW_NEXUS_API_KEY=<FLOW_NEXUS_API_KEY> -- npx -y claude-flow`. Replace the placeholders with your key values.
What does claude-flow do?
It connects Claude Code and Codex to tools for agent coordination and memory across sessions.
Which keys does the Claude Code setup use?
The setup command uses ANTHROPIC_API_KEY, GITHUB_TOKEN, and FLOW_NEXUS_API_KEY.