CLI Reference

Complete reference for mcp-agent command-line interface, including commands for local development, configuration management, and cloud deployment.

Installation

Install mcp-agent CLI:
# Using uv (recommended)
uv tool install mcp-agent

# Using pip
pip install mcp-agent

Global Options

Available for all commands:
OptionDescription
--verbose, -vEnable verbose output
--quiet, -qMinimize output
--format <type>Output format (text, json, yaml)
--color/--no-colorEnable/disable colored output
--versionShow version and exit
--help, -hShow help

Project Commands

mcp-agent init

Initialize a new mcp-agent project with templates and boilerplate.
mcp-agent init [OPTIONS]
Options:
OptionDescriptionDefault
--name <name>Project nameCurrent directory name
--template <type>Project templatebasic
--path <dir>Target directoryCurrent directory
--forceOverwrite existing filesfalse
Examples:
# Interactive initialization
mcp-agent init

# With specific template
mcp-agent init --template temporal --name research-agent

mcp-agent quickstart

Create example projects with pre-built patterns.
mcp-agent quickstart <TYPE> [OPTIONS]
Available types:
  • workflow - All workflow pattern examples
  • researcher - MCP researcher use case
  • elicitations - MCP elicitation patterns
  • state-transfer - Workflow router example
  • data-analysis - Financial analyzer use case
  • mcp-basic-agent - Basic MCP agent example
  • token-counter - Token counting example
  • agent-factory - Agent factory pattern
  • basic-agent-server - Basic agent server (asyncio)
Examples:
# Create workflow examples
mcp-agent quickstart workflow

# Create researcher example with force overwrite
mcp-agent quickstart researcher --force

mcp-agent go

Quick interactive agent for immediate testing.
mcp-agent go [OPTIONS]
Options:
OptionDescriptionDefault
--model <name>Model to useDefault model
--servers <list>MCP servers to connectNone

mcp-agent check

Check configuration and environment.
mcp-agent check [OPTIONS]
Validates:
  • Configuration file syntax
  • API key availability
  • MCP server connectivity
  • Temporal connection (if configured)

Configuration Commands

mcp-agent config

Manage mcp-agent configuration files.
mcp-agent config <COMMAND>
Commands:
CommandDescriptionExample
showDisplay configurationmcp-agent config show
checkValidate configurationmcp-agent config check
editOpen in editormcp-agent config edit
pathShow file pathsmcp-agent config path

mcp-agent keys

Manage API keys and secrets securely.
mcp-agent keys <COMMAND> [OPTIONS]
Commands:
CommandDescriptionExample
showDisplay keys (masked)mcp-agent keys show
set <provider>Set API keymcp-agent keys set openai
unset <provider>Remove API keymcp-agent keys unset openai
test <provider>Test connectivitymcp-agent keys test anthropic
Supported providers:
  • openai - OpenAI API
  • anthropic - Anthropic Claude
  • google - Google AI
  • azure - Azure OpenAI
  • bedrock - AWS Bedrock
  • cohere - Cohere
  • groq - Groq Cloud
  • together - Together AI
  • ollama - Local Ollama
Examples:
# Set key interactively
mcp-agent keys set openai

# Set key directly
mcp-agent keys set anthropic --key "sk-ant-..."

# Test connectivity
mcp-agent keys test openai

mcp-agent models

List and configure AI models.
mcp-agent models <COMMAND> [OPTIONS]
Commands:
CommandDescriptionExample
listList available modelsmcp-agent models list
set-default <model>Set default modelmcp-agent models set-default gpt-4o
Examples:
# List all models
mcp-agent models list

# Filter by provider
mcp-agent models list --provider anthropic

# Set default
mcp-agent models set-default claude-3-5-sonnet-20241022

Cloud Commands

Top-level Aliases

These commands are available at the top level for convenience:
  • mcp-agent deploy - Deploy to cloud (alias for cloud deploy)
  • mcp-agent login - Authenticate (alias for cloud auth login)
  • mcp-agent logout - Sign out (alias for cloud auth logout)
  • mcp-agent whoami - Show current identity (alias for cloud auth whoami)

mcp-agent login/logout/whoami

Authenticate with MCP Agent Cloud.
mcp-agent login    # Authenticate
mcp-agent whoami   # Show current user
mcp-agent logout   # Sign out

# Also available under cloud auth:
mcp-agent cloud auth login
mcp-agent cloud auth whoami
mcp-agent cloud auth logout

mcp-agent deploy

Deploy agent to MCP Agent Cloud.
mcp-agent deploy <APP_NAME> [OPTIONS]
# Also available as: mcp-agent cloud deploy <APP_NAME> [OPTIONS]
Arguments:
  • APP_NAME - Name of the MCP App to deploy (required)
Options:
OptionDescriptionDefault
--app-description, -dApp descriptionNone
--config-dir, -cConfig directoryCurrent directory
--no-secretsSkip secrets processingfalse
--non-interactiveFail if prompting neededfalse
--dry-runValidate without deployingfalse
--api-urlAPI base URLhttps://deployments.mcp-agent.com
--api-keyAPI keyFrom env or config
Examples:
# Simple deployment
mcp-agent deploy my-agent

# With description and custom config
mcp-agent deploy my-agent \
  --app-description "Research assistant" \
  --config-dir ./config

# Dry run
mcp-agent deploy my-agent --dry-run

mcp-agent cloud configure

Configure access to a deployed MCP app.
mcp-agent cloud configure --id <SERVER_URL> [OPTIONS]
Options:
OptionDescriptionDefault
--id, -iServer URL to configureRequired
--secrets-file, -sPath to secrets fileNone
--secrets-output-file, -oOutput for configured secretsmcp_agent.configured.secrets.yaml
--paramsShow required params and exitfalse
--dry-runValidate without storingfalse
Examples:
# Configure access to an app
mcp-agent cloud configure --id https://api.mcp-agent.cloud/servers/my-agent

# Show required parameters
mcp-agent cloud configure --id https://api.mcp-agent.cloud/servers/my-agent --params

# Use existing secrets file
mcp-agent cloud configure --id <url> --secrets-file ./my-secrets.yaml

mcp-agent cloud servers

Manage deployed servers.
mcp-agent cloud servers <COMMAND>
Commands:
CommandDescriptionExample
listList serversmcp-agent cloud servers list
describe <id>Show detailsmcp-agent cloud servers describe srv_123
delete <id>Delete servermcp-agent cloud servers delete srv_123
workflows <id>List workflows for servermcp-agent cloud servers workflows srv_123
Note: mcp-agent cloud apps is an alias for mcp-agent cloud servers.

mcp-agent cloud app

Manage a single MCP App.
mcp-agent cloud app <COMMAND>
Commands:
CommandDescriptionExample
delete <id>Delete appmcp-agent cloud app delete app_123
status <id>Get app statusmcp-agent cloud app status app_123
workflows <id>List app workflowsmcp-agent cloud app workflows app_123

mcp-agent cloud workflows

Manage workflow executions.
mcp-agent cloud workflows <COMMAND>
Commands:
CommandDescriptionExample
listList workflow definitionsmcp-agent cloud workflows list
runsList workflow runsmcp-agent cloud workflows runs
describe <id> <run>Get workflow statusmcp-agent cloud workflows describe srv_123 run_456
status <id> <run>Alias for describemcp-agent cloud workflows status srv_123 run_456
suspend <id> <run>Pause workflowmcp-agent cloud workflows suspend srv_123 run_456
resume <id> <run>Resume workflowmcp-agent cloud workflows resume srv_123 run_456
cancel <id> <run>Cancel workflowmcp-agent cloud workflows cancel srv_123 run_456

mcp-agent cloud logger

View and manage logs.
mcp-agent cloud logger <COMMAND>
Commands:
CommandDescriptionExample
tail <id>View logsmcp-agent cloud logger tail srv_123
configure <id>Setup loggingmcp-agent cloud logger configure srv_123
Options for tail:
  • --follow - Stream logs in real-time
  • --since <duration> - Time range (e.g., 1h, 30m)
  • --from <RFC3339> - Start time
  • --to <RFC3339> - End time
  • --grep <pattern> - Filter logs
  • --limit <n> - Maximum entries
  • --orderby <field> - Sort by field (time, severity, tokens)
  • --desc/--asc - Sort order
Examples:
# Stream logs
mcp-agent cloud logger tail srv_123 --follow

# Filter errors from last hour
mcp-agent cloud logger tail srv_123 --since 1h --grep "ERROR"

# View logs with custom sorting
mcp-agent cloud logger tail srv_123 --orderby severity --desc --limit 100

Environment Variables

Configure CLI behavior:
VariableDescriptionDefault
MCP_API_BASE_URLCloud API endpointhttps://deployments.mcp-agent.com
MCP_API_KEYAuthentication key-

Configuration Files

mcp-agent uses these configuration files:
FilePurposeLocation
mcp_agent.config.yamlProject configurationProject root
mcp_agent.secrets.yamlAPI keys and secretsProject root
credentials.jsonCloud credentials~/.config/mcp-agent/

File Discovery

The CLI searches for configuration files in this order:
  1. Current directory
  2. Parent directories (recursively)
  3. .mcp-agent subdirectory in each
  4. ~/.mcp-agent/ (home directory fallback)
Both mcp_agent.config.yaml and mcp-agent.config.yaml are accepted filenames (same for secrets).

Complete Examples

Local Development

# Initialize project
mcp-agent init --template temporal

# Configure API keys
mcp-agent keys set openai
mcp-agent keys set anthropic

# Check configuration
mcp-agent check

# Quick test
mcp-agent go --model gpt-4o

# Create examples
mcp-agent quickstart workflow

Cloud Deployment

# Authenticate
mcp-agent login

# Deploy to cloud
mcp-agent deploy production-agent

# Check deployment
mcp-agent cloud servers list

# Monitor logs - this is crucial for debugging!
mcp-agent cloud logger tail srv_abc123 --follow

# View workflows for a server
mcp-agent cloud servers workflows srv_abc123

# Check workflow status
mcp-agent cloud workflows describe srv_abc123 run_456

Debugging

# Check environment
mcp-agent check

# Test API keys
mcp-agent keys test openai

# Verbose deployment
mcp-agent deploy my-agent --verbose

# Check deployment logs with filtering
mcp-agent cloud logger tail srv_123 \
  --since 10m \
  --grep "ERROR|WARN" \
  --limit 50
  
# Dry run deployment
mcp-agent deploy my-agent --dry-run

See Also