claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[FEATURE] Support Auth on Private Marketplaces and Plugins

Open a1flecke opened this issue 6 months ago • 15 comments

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

We are a Gitlab SaaS shop and all of our projects are private. As far as I can tell, and as far as I have tried, Claude Code does not support loading private marketplaces and plugins when auth is required. This is an interesting hurdle in distributing our Claude Code augmentation. It would be great if:

  1. We could use git instead of HTTP when installing marketplaces and plugins
  2. We could supply Auth with the HTTP requests when installing marketplaces and plugins

Proposed Solution

  1. ideally claude would support git links in the sources for plugins and marketplace and just use the already configured git auth.
  2. if you really want to keep HTTP then a VENDOR_TOKEN with basic auth when making the http request. Example: if it is a gitlab link AND GITLAB_TOKEN is present then use basic auth in the fetch

Alternative Solutions

No response

Priority

High - Significant impact on productivity

Feature Category

Developer tools/SDK

Use Case Example

  1. We are trying to figure out how to distribute our slash commands, skills, agents, etc to 200+ developers. Plugins seem designed for this
  2. We do not want to publicly expose this
  3. We use Gitlab SaaS so the server is not in our network and requires auth
  4. We are now trying to come up with a weird reverse mirror or auto-syncing or something to get around this limitation

Additional Context

No response

a1flecke avatar Oct 17 '25 17:10 a1flecke

I am dealing with this gap as well. We definitely could use this!

joeyweisband avatar Oct 17 '25 18:10 joeyweisband

This would be useful

jacobthompsonramsey avatar Oct 17 '25 19:10 jacobthompsonramsey

This is definitely needed

rmacconn avatar Oct 17 '25 20:10 rmacconn

This would be an awesome feature for team onboarding!

blakeyoder avatar Oct 17 '25 21:10 blakeyoder

You can add a private gitlab repo as a marketplace by using a project access token. The token needs the read_repository scope. You then use it with the https url as the password. They are described here.

To test a given token you can attempt to clone the repository:

git clone https://USERNAME:[email protected]/organization/repository

(reminder that USERNAME can be anything and TOKEN is your project access token).

I think that the token role may affect this? If you have the token set up but cannot clone it try increasing the role permission. Developer worked for me.

If this works then you can add the marketplace using this url with .git on the end. For example:

git clone https://USERNAME:[email protected]/organization/repository.git

This did not work for me when the url lacked the .git suffix.

matthewfranglen avatar Oct 20 '25 14:10 matthewfranglen

I also vote for this feature request!

jztan avatar Nov 01 '25 03:11 jztan

yes please.

emilwester-optimizely avatar Nov 27 '25 15:11 emilwester-optimizely

Hitting the same wall here. Would appreciate being able to use my SSH key to authenticate to my private gitlab.

lthoulon-locala avatar Dec 04 '25 10:12 lthoulon-locala

I have succeeded in using my private repository by adding my SSH key to my ssh agent. As i'm on mac I'm even using keychain and it seems to work like a charm.

Quoting Claude itself.

# 1. Add key to agent + store passphrase in Keychain (enter passphrase once)
ssh-add --apple-use-keychain ~/.ssh/id_rsa

# 2. Create/edit SSH config
nano ~/.ssh/config

# 3. Add these lines:
Host git.domain.priv
    AddKeysToAgent yes
    UseKeychain yes
    IdentityFile ~/.ssh/id_rsa

# 4. Set permissions
chmod 600 ~/.ssh/config

# 5. Verify
ssh-add -l  # Should show your key
git fetch   # Should work without prompt

lthoulon-locala avatar Dec 08 '25 14:12 lthoulon-locala

Would like to see support for this. I have the exact same use-case raised by the OP and not found a good workaround yet.

psjamesh avatar Dec 12 '25 10:12 psjamesh

Also experiencing this issue. I'm trying to make the marketplace a built-in part of a different private repo in the same GitLab account, and putting a token in the path is a violation of SOC2 compliance policies.

This should be using the system's GIT credentials by default.

robertmclaws avatar Dec 13 '25 20:12 robertmclaws

Also experiencing this issue. Would be incredible for managing internal Claude Code plugins!

EricVentor avatar Dec 16 '25 21:12 EricVentor

Investigation Findings

I ran into this same issue with a private GitHub repository and did some debugging. Here's what I found:

Root Cause

When /plugin marketplace add runs git clone, the subprocess doesn't inherit authentication context:

  1. GITHUB_TOKEN environment variable is not passed to the git subprocess
  2. gh auth git-credential helper (configured via credential.https://github.com.helper) doesn't work in the non-interactive subprocess context

This explains why public repositories work fine (no auth needed) while private repositories fail with:

fatal: could not read Username for 'https://github.com': terminal prompts disabled

Evidence

In my shell session:

  • gh auth status shows active authentication with GITHUB_TOKEN
  • git ls-remote https://github.com/my-org/private-repo.git works perfectly
  • But /plugin marketplace add https://github.com/my-org/private-repo.git fails

The difference is that my shell has GITHUB_TOKEN set and access to the credential helper, but the spawned git process does not.

Workaround

For anyone hitting this with GitHub private repos, here's a manual workaround:

# 1. Clone manually (this uses your shell's auth context)
cd ~/.claude/plugins/marketplaces
git clone https://github.com/your-org/your-marketplace.git marketplace-name

# 2. Register in known_marketplaces.json
# Add an entry like:
{
  "marketplace-name": {
    "source": {
      "source": "git",
      "url": "https://github.com/your-org/your-marketplace.git"
    },
    "installLocation": "/Users/you/.claude/plugins/marketplaces/marketplace-name",
    "lastUpdated": "2025-12-16T21:30:00.000Z"
  }
}

After this, /plugin install <plugin-name> works normally.

Suggested Fix

The fix would be to pass relevant auth environment variables (GITHUB_TOKEN, GITLAB_TOKEN, etc.) to the git subprocess when cloning. This would leverage the user's existing authentication setup without requiring any new configuration.

lindner avatar Dec 16 '25 21:12 lindner

Looking at the bundled CLI source, I found that Claude Code intentionally disables credential helpers by setting the -c "credential.helper=" flag to an empty string, bypassing any configured credential helpers.

As @matthewfranglen mentioned, baking the token into the HTTPS URL works for cloning the marketplace repo itself:

claude plugin marketplace add https://oauth2:${TOKEN}@gitlab.com/org/marketplace.git

However, this breaks if you need nested plugin sources, i.e., if your marketplace.json references plugins in other private repos:

  {
    "plugins": [{
      "name": "my-plugin",
      "source": {
        "source": "url",
        "url": "https://gitlab.com/org/other-private-repo.git"
      }
    }]
  }

And there is no way AFAIK to inject the token in that URL (unless you are willing to hardcode the token in the marketplace.json

lucacavazzana avatar Dec 20 '25 00:12 lucacavazzana