[FEATURE] Support Auth on Private Marketplaces and Plugins

Resolved 💬 32 comments Opened Oct 17, 2025 by a1flecke Closed Jan 23, 2026
💡 Likely answer: A maintainer (whyuan-cc, contributor) responded on this thread — see the highlighted reply below.

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_

View original on GitHub ↗

32 Comments

joeyweisband · 9 months ago

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

jacobthompsonramsey · 9 months ago

This would be useful

rmacconn · 9 months ago

This is definitely needed

blakeyoder · 9 months ago

This would be an awesome feature for team onboarding!

matthewfranglen · 8 months ago

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:TOKEN@gitlab.com/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:TOKEN@gitlab.com/organization/repository.git

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

jztan · 8 months ago

I also vote for this feature request!

emilwester-optimizely · 7 months ago

yes please.

lthoulon-locala · 7 months ago

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

lthoulon-locala · 7 months ago

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
psjamesh · 7 months ago

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.

robertmclaws · 7 months ago

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.

EricVentor · 7 months ago

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

lindner · 7 months ago

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.

lucacavazzana · 6 months ago

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)

lucacseth · 6 months ago

+1 this is needed

cooco119 · 6 months ago

As a workaround, I'm using a custom claude command that pulls the private marketplace created with the workaround method suggested by @lindner. Thanks for the investigation and the workaround example.

I've fed @lindner's comment to claude code to make a custom command and it works just fine.

example: https://github.com/cooco119/claude-plugin-private-marketplace-helper

whyuan-cc contributor · 6 months ago

We merged the PR, which should be in the next release of Claude Code. It should work

export GITHUB_TOKEN=$(gh auth token) or export GITLAB_TOKEN
/plugin marketplace add ${private_marketplace_git} 
jztan · 6 months ago
We merged the PR, which should be in the next release of Claude Code. It should work `` export GITHUB_TOKEN=$(gh auth token) or export GITLAB_TOKEN /plugin marketplace add ${private_marketplace_git} ``

Can't wait for this release :)

robertmclaws · 6 months ago

This is great, thanks. What about for GitLab?

renehernandez · 6 months ago

I am still running into this issue in claude code 2.1.6 version and gitlab self-hosted

First attempt:

Just setting the env var:

folder[ main]
❯ export GITLAB_TOKEN=****************

folder[ main]
❯ echo $GITLAB_TOKEN
*****************

folder[ main]
❯ claude plugin marketplace add https://gitlab.example.com/ai/claude-code-plugins.git
Adding marketplace...
Cloning repository: https://gitlab.example.com//ai/claude-code-plugins.git
✘ Failed to add marketplace: Failed to clone marketplace repository: HTTPS authentication failed. For private repos, set GITHUB_TOKEN, GITLAB_TOKEN, or BITBUCKET_TOKEN environment variable.

Original error: Cloning into '/Users/<user>/.claude/plugins/marketplaces/temp_1768273861563'...
fatal: could not read Username for 'https://gitlab.example.com': terminal prompts disabled

Second attempt:

Specifying also my gitlab username:

folder[ main]
❯ claude plugin marketplace add https://<gitlab_username>@https://gitlab.example.com/ai/claude-code-plugins.git
Adding marketplace...
Cloning repository: https://<gitlab_username>@https://gitlab.example.com/ai/claude-code-plugins.git
✘ Failed to add marketplace: Failed to clone marketplace repository: HTTPS authentication failed. For private repos, set GITHUB_TOKEN, GITLAB_TOKEN, or BITBUCKET_TOKEN environment variable.

Original error: Cloning into '/Users/<user>/.claude/plugins/marketplaces/temp_1768273872479'...
fatal: could not read Password for 'https://<gitlab_username>@https://gitlab.example.com': terminal prompts disabled

So if I have to hardcode the token in the git url, then when my token expires I would have to manually go through the setup again. I hope that GITLAB_TOKEN variable will allow to avoid that hurdle, as I can configure my terminal to load the token dynamically when starting a new session

rahulkadam · 6 months ago
We merged the PR, which should be in the next release of Claude Code. It should work `` export GITHUB_TOKEN=$(gh auth token) or export GITLAB_TOKEN /plugin marketplace add ${private_marketplace_git} ``

it looks it work without export also, do you see any place where have this issue and need to handle this way, it we put URL simply in setting.,json it works

matthewfranglen · 6 months ago

Is there a reason why using the system git to clone the repo with the system settings was not considered? That would allow installing any marketplace or plugin from any git repo to which you have access without having to handle special site specific tokens.

turing · 6 months ago

@whyuan-cc for those not initially using token auth, this requires either a PAT with a great deal of access or building your own workaround similar to the one outlined above for manually modifying files in the install, which is obviously ugly. I'd say inheriting the environment including whatever git/gh auth is set up is a necessary precondition for private marketplaces. The current status is untenable.

For anyone who is creating a github PAT restricted to the marketplace repo that doesn't want it messing with the rest of their auth:

claude() {
  GITHUB_TOKEN="{muh-pat}" command claude "$@"
}

↑ add this to ~/.zshrc

this is filthy, and I'll probably move it into keychain shortly but it does work and isolates the environment variable.

-----

In general, the user's own github auth setup is a necessary precondition for many nice workflows, like private marketplaces, pulling github issue contents, etc.

evrimalacan · 6 months ago
@whyuan-cc for those not initially using token auth, this requires either a PAT with a great deal of access or building your own workaround similar to the one outlined above for manually modifying files in the install, which is obviously ugly. I'd say inheriting the environment including whatever git/gh auth is set up is a necessary precondition for private marketplaces. The current status is untenable. For anyone who is creating a github PAT restricted to the marketplace repo that doesn't want it messing with the rest of their auth: `` claude() { GITHUB_TOKEN="{muh-pat}" command claude "$@" } `` ↑ add this to ~/.zshrc this is filthy, and I'll probably move it into keychain shortly but it does work and isolates the environment variable.

Agreed. The last release introduced support for GitHub and Bitbucket tokens, and requires users to obtain a token just to install the marketplace. The user already has their SSH set up. Why would they bother creating an access token again?

I created a custom slash command that clones the private marketplace manually (the ugly way), and I will stick to it.

tsoukup77 · 5 months ago
We merged the PR, which should be in the next release of Claude Code. It should work `` export GITHUB_TOKEN=$(gh auth token) or export GITLAB_TOKEN /plugin marketplace add ${private_marketplace_git} ``

@whyuan-cc How does this work for automated updates, provided the initial token expires?

whyuan-cc contributor · 5 months ago

thanks for more feedback. We will investigate automatically get auth from git env.

vaclavpavek · 5 months ago

IIt would be good if the solution were more flexible. I use GitHub, GitLab, GitLab self-host, and Forgejo for various collaborations.

lindner · 5 months ago

Not sure when this was fixed but now I am getting error messages about missing GITHUB_TOKEN. Setting it properly appears to work fine now!

 claude plugin marketplace add https://github.com/metropolis-io/site
Adding marketplace...
Cloning repository: https://github.com/metropolis-io/site.git
✘ Failed to add marketplace: Failed to clone marketplace repository: HTTPS authentication failed. For private repos, set GITHUB_TOKEN, GITLAB_TOKEN, or BITBUCKET_TOKEN environment variable.

Original error: Cloning into '/Users/plindner/.claude/plugins/marketplaces/temp_1769126820292'...
fatal: could not read Username for 'https://github.com': terminal prompts disabled
whyuan-cc contributor · 5 months ago

2.1.19 has the fix for using existing credentials, without manually exporting env vars like GITHUB_TOKEN.

iyousifi · 5 months ago

So what about azure devops repos?

ts-shu · 5 months ago

Hi @whyuan-cc, thanks! However, that fix doesn't seem to have flowed through to the autoupdate path? There's a disableCredentialHelper which is hardcoded to true and not configurable by any means

github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.