Skip to content

[Feature]: Import MCP servers from Claude Code in autohand import claude #675

Open

Description

@igorcosta

Problem Statement

autohand import claude does not import MCP servers. Developers moving from Claude Code usually depend on their MCP servers, so after importing they have to add each one again by hand.

The Gemini, Cursor, OpenCode, Kimi and Augment importers already import MCP. The Claude importer skips the mcp category on purpose:

// src/import/importers/ClaudeImporter.ts
default:
  // MCP import is not supported here.
  break;

To reproduce with autohand-cli 0.9.8:

  1. Put an MCP server under mcpServers in ~/.claude.json.
  2. Run autohand import claude --all.
  3. The summary lists hooks, sessions, settings and memory. MCP is missing, with no warning, even though --help lists mcp as a category.

Proposed Solution

Add MCP import to ClaudeImporter, following the pattern of the other importers (for example, extractMcpServers in GeminiImporter):

  • Sources:
    • user scope: mcpServers in ~/.claude.json
    • local scope: per-project projects[<path>].mcpServers in ~/.claude.json
    • project scope: .mcp.json in the workspace
  • Transports: map stdio (command, args, env) and remote servers (type: "http" / "sse", url, headers) to Autohand's MCP config.
  • Scan: report mcp in scan() with a count.
  • Safety: imported servers should go through workspace trust and be saved disabled until the user reviews them, the same way imported hooks are.
  • Secrets: env values and headers can contain secrets. Copy them as-is into local config only, never print them, and never sync them.
  • Duplicates: skip a server that already exists with the same name and report it as skipped: already exists.
  • Summary: add an mcp: N imported line.

Alternatives Considered

Re-adding servers by hand with /mcp install or by editing config. It works, but it is slow, and it is where people moving from Claude Code tend to give up.

Feature Category

Core CLI functionality

How important is this feature to you?

Would significantly improve my workflow

Additional Context

Related import gaps that came up in the same test (could be separate issues):

  • ~/.claude/agents and ~/.claude/commands are not imported.
  • Folder skills (skills/<name>/SKILL.md) are not counted in the import summary. They do load at runtime from ~/.claude/skills.
  • autohand import claude --dry-run writes data and reports "imported", because the global --dry-run flag swallows it.

Acceptance criteria:

  • autohand import claude imports MCP servers from all three scopes above.
  • Imported servers are disabled until reviewed, and secrets are never printed.
  • Tests cover stdio, http/sse, duplicates and a malformed ~/.claude.json.
  • The import docs list MCP as supported for Claude Code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions