MCF CLI Tool
A comprehensive command-line interface for MCF (My Claude Flow) with Claude Code integration, profile management, and project automation.
Features
- 🔧 Profile Management: Manage multiple Claude Code configurations
- 🚀 Seamless Claude Integration: Run Claude with profile-specific settings
- 📁 Project Management: Create and manage development workspaces
- 🔌 MCP Server Support: Manage Model Context Protocol servers
- 📦 Zero Dependencies: Single-file executable with no external dependencies
- 🛠️ Self-Installation: Install globally with
mcf install
Installation
Global Installation (Recommended)
npm install -g @pc-style/mcf-cli
npx @pc-style/mcf-cli install
Local Development
git clone https://github.com/pc-style/MCF.git
cd MCF/cli
npm install
npm link
Quick Start
mcf install
mcf config list
mcf config create my-workspace
mcf run --config my-workspace
mcf status
Usage
Profile Management
mcf config list
mcf config show <profile-name>
mcf config create <profile-name>
mcf config delete <profile-name>
mcf config clone <source-profile> <new-profile>
mcf config set-default <profile-name>
mcf config edit <profile-name>
mcf config validate <profile-name>
Claude Code Integration
mcf run
mcf run --config <profile-name>
mcf run --config <profile-name> --dangerous-skip
mcf run --config <profile-name> -- --help
mcf run --config <profile-name> -- --version
mcf run --config <profile-name> -- /serena:status
mcf run --config <profile-name> --no-interactive
mcf run --config <profile-name> --working-dir /path/to/project
Project Management
mcf project list
mcf project show <project-name>
mcf project create <project-name>
mcf project delete <project-name>
mcf project switch <project-name>
mcf project current
mcf project discover
mcf project stats
MCP Server Management
mcf mcp list
mcf mcp show <server-name>
mcf mcp start <server-name>
mcf mcp stop <server-name>
mcf mcp restart <server-name>
mcf mcp status <server-name>
mcf mcp health <server-name>
mcf mcp logs <server-name>
mcf mcp install <server-name>
mcf mcp remove <server-name>
mcf mcp config <server-name>
Legacy Commands
mcf install
mcf setup
mcf status
mcf templates
mcf templates list
mcf templates info <template-name>
mcf templates init <template-name>
Configuration Profiles
Profiles allow you to manage different Claude Code configurations:
{
"name": "work",
"config": {
"claude": {
"configDirectory": "/Users/username/work/.claude",
"model": "claude-3-5-sonnet-20241022",
"smallFastModel": "claude-3-5-haiku-20241022",
"flags": ["--dangerous-skip"],
"environment": {
"ANTHROPIC_BASE_URL": "https://api.anthropic.com",
"ANTHROPIC_AUTH_TOKEN": "your-token-here"
}
},
"mcp": {
"servers": ["serena", "filesystem"]
}
}
}
Environment Variables
MCF CLI automatically sets these environment variables when running Claude:
CLAUDE_CONFIG_DIR
- Profile-specific Claude configuration directory
ANTHROPIC_BASE_URL
- Anthropic API base URL
ANTHROPIC_AUTH_TOKEN
- Anthropic API token
ANTHROPIC_MODEL
- Claude model to use
ANTHROPIC_SMALL_FAST_MODEL
- Small fast model for quick tasks
NPX Usage
You can run MCF CLI without installation using npx:
npx @pc-style/mcf-cli install
npx @pc-style/mcf-cli config list
npx @pc-style/mcf-cli run --config default
npx @pc-style/mcf-cli <command> [args...]
Development Workflow
- Install MCF:
mcf install
- Create Profile:
mcf config create my-workspace
- Configure Profile:
mcf config edit my-workspace
- Run Claude:
mcf run --config my-workspace
- Manage Projects:
mcf project create my-project
- Check Status:
mcf status
(anytime)
Integration with MCF Ecosystem
This CLI tool is designed to work seamlessly with the existing MCF ecosystem:
- install.sh - Wrapped by
mcf install
- claude-mcf.sh - Wrapped by
mcf run
- template-engine.py - Wrapped by
mcf templates
- Serena MCP Server - Integrated via
mcf mcp
commands
Error Handling
The CLI provides comprehensive error handling:
- Profile Issues - Suggests configuration fixes
- Missing Dependencies - Provides installation commands
- Permission Problems - Offers troubleshooting steps
- Claude Errors - Shows detailed error messages
- MCP Server Issues - Provides health check suggestions
Requirements
- Node.js >= 14.0.0
- bash (for running installation scripts)
- Python 3 (for template engine)
- git (for cloning repositories)
- Claude Code (for
mcf run
commands)
Advanced Usage
Custom Profile Configuration
mcf config create custom-profile
mcf config edit custom-profile
MCP Server Integration
mcf mcp install serena
mcf mcp start serena
mcf mcp health serena
mcf run --config my-profile -- /serena:analyze
Batch Operations
for profile in dev staging prod; do
mcf config create $profile
done
mcf config list | xargs -I {} mcf config validate {}
Troubleshooting
Common Issues
"Command not found: mcf"
npm install -g @pc-style/mcf-cli
npx @pc-style/mcf-cli <command>
"Profile not found"
mcf config list
mcf config create <profile-name>
"Claude execution failed"
claude --version
mcf config validate <profile-name>
Contributing
Contributions welcome! Please see the main MCF repository for guidelines.
License
ISC - Same as MCF framework