pub async fn run(
source: ServerSource,
name: Option<String>,
output_dir: Option<PathBuf>,
dry_run: bool,
output_format: OutputFormat,
) -> Result<ExitCode>Expand description
Runs the generate command.
Generates progressive loading TypeScript files from an MCP server.
This command performs the following steps:
- Builds
ServerConfigfrom CLI arguments or loads from ~/.claude/mcp.json - Introspects the MCP server to discover tools
- Generates TypeScript files (one per tool) using progressive loading pattern
- Exports VFS to
~/.claude/servers/{server-id}/directory
§Arguments
source- Resolved server-selection source: either a~/.claude/mcp.jsonname or CLI transport flags with timeout overrides. Timeout overrides only exist on theFlagsarm — aConfigsource always uses themcp.jsonentry’s ownconnectTimeoutSecs/discoverTimeoutSecs, so there is no “ignored override” state to document.name- Custom server name for directory (default:server_id)output_dir- Custom output directory (default: ~/.claude/servers/)dry_run- When true, preview files without writing to diskoutput_format- Output format (json, text, pretty)
§Errors
Returns an error if:
- Server configuration is invalid
- Server not found in mcp.json (when using –from-config)
- Server connection fails
- Tool introspection fails
- Code generation fails
- File export fails (skipped in dry-run mode)