Skip to content

Claude agents cannot access any MCP servers due to --strict-mcp-config without --mcp-config #1111

Description

@Korkyzer

Summary

Multica-spawned Claude agents cannot access any MCP servers because the daemon launches claude with --strict-mcp-config but without an accompanying --mcp-config argument. This silently strips all user-scope MCPs (configured in ~/.claude.json or via claude mcp add) from the agent's tool inventory.

Reproduction

  1. Configure any MCP server in your local Claude Code: claude mcp add some-server --scope user -- npx some-mcp
  2. Verify it loads in a normal Claude Code session: claude mcp list shows it as connected
  3. Create a Multica issue and assign it to a Claude agent (any model)
  4. In the issue brief, ask the agent to call a tool from some-server or to list its available MCPs
  5. Observed: the agent reports the MCP tool is unavailable; claude mcp list from the agent's bash shows the MCPs as configured but they are not loaded into the running session

Root Cause

The daemon spawns the Claude provider via buildClaudeArgs in server/pkg/agent/claude.go (line 356-371):

func buildClaudeArgs(opts ExecOptions, logger *slog.Logger) []string {
    args := []string{
        "-p",
        "--output-format", "stream-json",
        "--input-format", "stream-json",
        "--verbose",
        "--strict-mcp-config",          // line 362
        "--permission-mode", "bypassPermissions",
    }
    // ...
}

Per the Claude CLI documentation:

--strict-mcp-config -- Only use MCP servers from --mcp-config, ignoring all other MCP configurations

Since no --mcp-config argument is ever passed (and ExecOptions in server/pkg/agent/agent.go:22-30 has no field for it), the result is: zero MCPs loaded. The agent only has access to native Claude Code built-in tools (Bash, Read, Write, WebSearch, etc.) and binaries on PATH.

Impact

  • All user-configured MCPs in ~/.claude.json are invisible to Multica Claude agents
  • The Multica MCP server itself cannot be used by Multica agents -- agents cannot create child issues, post comments, or interact with the platform from inside a task via MCP
  • Any workflow depending on MCP tools (Figma, GitHub, database access, etc.) is impossible at the agent level
  • This affects every Claude-provider agent in every Multica deployment

This issue is distinct from #674 (Codex MCP tools) -- the root cause here is specific to how the Claude provider is spawned and the semantics of --strict-mcp-config.

Related upstream issues

This pattern of MCPs not propagating to spawned subprocesses is a known friction point in the Claude Code ecosystem:

Multica is well-positioned to address this at its own layer rather than wait for upstream changes.

Proposed Solutions

Three options in order of preference:

Option A: per-agent mcp_config field (recommended)

Add an optional McpConfig field to ExecOptions. The daemon serializes it to a temp JSON file at spawn time and passes it via --mcp-config <path>:

// In server/pkg/agent/agent.go
type ExecOptions struct {
    Cwd             string
    Model           string
    SystemPrompt    string
    MaxTurns        int
    Timeout         time.Duration
    ResumeSessionID string
    CustomArgs      []string
    McpConfig       *MCPConfig // optional: if set, written to temp file and passed via --mcp-config
}

Example agent definition (YAML/TOML side):

name: claude-sonnet-figma
provider: claude
model_hint: sonnet
mcp_config:
  mcpServers:
    figma:
      type: stdio
      command: npx
      args: ["-y", "@figma/mcp-server"]
      env:
        FIGMA_ACCESS_TOKEN: "${FIGMA_ACCESS_TOKEN}"

Pros: granular per-agent control, secure (no automatic inheritance of sensitive MCPs), backward compatible (optional field).
Cons: users must declare MCPs explicitly; no automatic inheritance from ~/.claude.json.

Option B: optional --strict-mcp-config flag

Add a daemon-level config or per-agent flag to omit --strict-mcp-config, letting Claude inherit user-scope MCPs from ~/.claude.json automatically.

Pros: zero config burden for users who want all their MCPs available.
Cons: less secure (every agent sees every MCP including potentially sensitive ones).

Option C: workspace-level MCP config

Allow defining a default mcp_config at the workspace or runtime level, applied to all agents on that runtime.

Pros: middle ground, less repetition than Option A.
Cons: less granular.

Environment

  • Multica 0.2.0 (commit: df920e8, built: 2026-04-15)
  • Claude Code 2.1.110
  • macOS 26.2 (darwin/arm64)

Willingness to Contribute

Happy to help draft a PR for Option A if the maintainers consider this worthwhile. Would appreciate guidance on:

  • Where the agent definition schema is declared (for adding the mcp_config field on the config side)
  • Preferred temp file lifecycle (create on spawn, delete on exit?)
  • How McpConfig should interact with existing CustomArgs (e.g., if a user passes --mcp-config via custom_args, should it take precedence?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions