Skip to content

feat: add Claude Code as a supported MCP client#172

Open
GilbertLS wants to merge 1 commit into
mainfrom
feat/DXAA-claude-code
Open

feat: add Claude Code as a supported MCP client#172
GilbertLS wants to merge 1 commit into
mainfrom
feat/DXAA-claude-code

Conversation

@GilbertLS
Copy link
Copy Markdown
Contributor

Changes

Adds Claude Code (the Anthropic CLI) as a sixth supported MCP client for the init command, alongside Claude Desktop, Cursor, Windsurf, VS Code, and Gemini.

  • New class ClaudeCodeClientManager (src/clients/claude-code.ts) extending BaseClientManager. It overrides configure() to prompt for a configuration scope, then delegates to the base merge logic since both scopes use the standard mcpServers key:
    • User scope~/.claude.json (available across all projects). Default when prompted.
    • Project scope.mcp.json at a user-specified project folder (shared via version control).
  • Registry (src/clients/index.ts): registered under the key 'claude-code' — the key must equal the ClientType string exactly, since init resolves managers via clients[clientType].
  • Type (src/clients/types.ts): added 'claude-code' to the ClientType union.
  • CLI (src/index.ts, src/commands/init.ts): added claude-code to the --client help text, an example invocation, and JSDoc.
  • Docs (README.md): new "Claude Code" section documenting init --client claude-code and the user-vs-project scope prompt.

Config format written matches what Claude Code expects for a stdio server (verified against the Claude Code MCP docs):

{
  "mcpServers": {
    "auth0": {
      "command": "npx",
      "args": ["-y", "@auth0/auth0-mcp-server", "run", "--tools", "*"],
      "env": { "DEBUG": "auth0-mcp" }
    }
  }
}

Usage

npx @auth0/auth0-mcp-server init --client claude-code

References

Testing

Verified with both automated tests and a manual end-to-end run against a real Auth0 tenant and a live Claude Code install.

Automated: npm run build, npm run typecheck, npm run lint, and npm test all pass (388 tests, 35 files). New suite test/clients/claude-code.test.ts covers: default user-scope path resolution; project-scope path resolution; throw when the project folder does not exist; getConfigPath fallback when no folder is set; the scope prompt (default user); the project-folder prompt; and that the mcpServers merge preserves pre-existing top-level keys in ~/.claude.json. Existing init/registry suites were extended to include the new client.

Manual end-to-end (real CLI, real tenant):

  1. Project scope — ran node dist/index.js init --client claude-code --scopes 'read:clients', completed the device-auth browser login, chose Project, and entered a project folder. Confirmed <folder>/.mcp.json was written with the auth0 entry under mcpServers.
  2. User scope — re-ran the same command, chose User. Confirmed the auth0 entry was merged into ~/.claude.json under mcpServers, and that all pre-existing servers (asana, atlassian, github, lucid, playwright, slack, zoom) and ~40 other top-level keys (projects, userID, etc.) were preserved untouched.
  3. Live connection — ran claude mcp list from the project directory and confirmed auth0: npx -y @auth0/auth0-mcp-server run --tools * - ✓ Connected, proving Claude Code actually loads and connects to the configured server. (Project-scope .mcp.json takes precedence over the user-scope entry in that directory, per Claude Code's documented scope hierarchy.)
  • This change adds unit test coverage
  • This change adds integration test coverage

Checklist

@GilbertLS GilbertLS requested a review from a team as a code owner June 2, 2026 20:13
Add a ClaudeCodeClientManager that configures the Auth0 MCP server for
the Claude Code CLI, prompting for user scope (~/.claude.json) or project
scope (.mcp.json at a project root). Wire it into the client registry,
ClientType union, init command, and CLI help text.
@GilbertLS GilbertLS force-pushed the feat/DXAA-claude-code branch from 4a47bff to cdbe70e Compare June 2, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant