Skip to content

MCP: Claude Code compatibility paths and JSON key are wrong (.mcp.json, ~/.claude.json, mcpServers) #414

Closed

Description

@ravshansbox

Summary

jcode's MCP "Claude Code compatibility" loading does not match Claude Code's actual conventions. Both the file paths and the JSON schema key are wrong, so jcode silently fails to pick up Claude Code MCP servers.

What jcode currently does

crates/jcode-base/src/mcp/protocol.rs:

  • McpConfig struct deserializes a top-level servers key.
  • load() reads:
    • Global: ~/.jcode/mcp.json
    • Project: ./.jcode/mcp.json
    • Compat fallback: ./.claude/mcp.json
  • import_from_external() (first-run only) reads ~/.claude/mcp.json and Codex ~/.codex/config.toml.

What Claude Code actually uses

  • Project scope: .mcp.json at the repo root (NOT .claude/mcp.json).
  • User / local scope: ~/.claude.json (NOT ~/.claude/mcp.json). Per-project entries live under projects.<abs_path>.mcpServers; a global set can live under top-level mcpServers.
  • JSON key: mcpServers (NOT servers), and each server may be stdio (command/args/env) or HTTP/SSE (type/url/headers).

Impact

  • jcode reads ~/.claude/mcp.json and ./.claude/mcp.json, which are not real Claude Code paths. A user with standard Claude Code MCP config gets nothing imported/loaded.
  • Even if a file is found, the servers vs mcpServers key mismatch means it deserializes to an empty server map.

Proposed change

  1. Accept mcpServers as the canonical key (keep servers as an alias via serde for backward compat).
  2. Add real Claude Code paths:
    • Project: ./.mcp.json (repo root).
    • User: ~/.claude.json (read top-level mcpServers and projects.<cwd>.mcpServers).
  3. Keep existing ~/.jcode/mcp.json / ./.jcode/mcp.json as the primary jcode paths.
  4. Update import_from_external() sources to match (read ~/.claude.json instead of ~/.claude/mcp.json).
  5. Support HTTP/SSE server entries (type/url) if not already, since Claude Code configs commonly use them.

Pointers

  • crates/jcode-base/src/mcp/protocol.rs
    • struct McpConfig (servers key)
    • McpConfig::load (paths)
    • McpConfig::import_from_external (first-run import sources)
  • Docs to update: README.md ("MCP config files" section)

Notes

Related to skill loading paths discussed in #413; both could grow .agents/ support too, but this issue is specifically about correctness of the Claude Code compatibility paths/schema.

Activity

  1. added
    bug
    priority: medium
    triage: reproducible
    autonomous: likely
    on Jun 29, 2026
  2. 1jehuang commented on Jun 29, 2026

    @1jehuang
    Owner

    Triage: reproducible, autonomous: likely. Fixed the Claude Code compat paths/schema: accept the canonical mcpServers key (alias of servers), load ./.mcp.json and ~/.claude.json (top-level + projects.<cwd>.mcpServers), recognize and skip HTTP/SSE (type/url) entries with a log line, and update first-run import + README. Fix in #417.

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

    autonomous: likelybugpriority: mediumtriage: reproducible

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions