multica-ai/multica · error

one of --server-config, --server-config-stdin, or --server-c

Error message

one of --server-config, --server-config-stdin, or --server-config-file is required

What it means

Local validation in `multica workspace mcp add`: the MCP server entry must be supplied as a JSON object via exactly one of --server-config (inline JSON), --server-config-stdin, or --server-config-file. None of them was provided, so there is no config to register.

Source

Thrown at server/cmd/multica/cmd_workspace.go:648

func runWorkspaceMcpAdd(cmd *cobra.Command, args []string) error {
	serverName := strings.TrimSpace(args[0])
	if serverName == "" {
		return fmt.Errorf("server name must not be empty")
	}
	wsID, err := resolveWorkspaceArg(cmd, args[1:])
	if err != nil {
		return err
	}
	if wsID == "" {
		return fmt.Errorf("workspace ID is required: pass an id/slug/prefix as argument or set MULTICA_WORKSPACE_ID")
	}

	entry, ok, err := resolveMcpJSONObject(cmd, "server-config", false)
	if err != nil {
		return err
	}
	if !ok {
		return fmt.Errorf("one of --server-config, --server-config-stdin, or --server-config-file is required")
	}

	client, err := newAPIClient(cmd)
	if err != nil {
		return err
	}

	ctx, cancel := cli.APIContext(context.Background())
	defer cancel()

	var server workspaceMcpServer
	body := map[string]any{"name": serverName, "config": entry}
	if err := client.PostJSON(ctx, "/api/workspaces/"+wsID+"/mcp-servers", body, &server); err != nil {
		return fmt.Errorf("add workspace mcp server: %w", err)
	}

	return printWorkspaceMcpServers(cmd, []workspaceMcpServer{server})
}

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Provide inline JSON: `multica workspace mcp add name acme --server-config '{"transport":"stdio","command":"npx",...}'`
  2. Or pipe it: `cat server.json | multica workspace mcp add name acme --server-config-stdin`
  3. Or point at a file: `--server-config-file ./server.json`
  4. Single-quote inline JSON in shells to prevent interpolation

Example fix

# before
multica workspace mcp add github acme

# after
multica workspace mcp add github acme --server-config-file ./github-mcp.json
Defensive patterns

Strategy: validation

Validate before calling

entry, ok, err := resolveMcpJSONObject(cmd, "server-config", false)
if err != nil {
    return err
}
if !ok {
    return errors.New("one of --server-config, --server-config-stdin, or --server-config-file is required")
}

Prevention

When it happens

Trigger: Running `multica workspace mcp add name <ws>` without any --server-config* flag; passing a flag with an empty value so resolveMcpJSONObject reports ok=false.

Common situations: Assuming the CLI prompts for config interactively; misspelling the flag (--config instead of --server-config); quoting the JSON incorrectly so the shell swallows it; empty file passed to --server-config-file.

Related errors


AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15). Data as JSON: /api/errors/5eb5227ebacada11. Report an issue: GitHub.