[FEATURE] Support Auth on Private Marketplaces and Plugins
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:
- We could use git instead of HTTP when installing marketplaces and plugins
- We could supply Auth with the HTTP requests when installing marketplaces and plugins
Proposed Solution
- ideally claude would support git links in the sources for plugins and marketplace and just use the already configured git auth.
- if you really want to keep HTTP then a
VENDOR_TOKENwith basic auth when making the http request. Example: if it is a gitlab link ANDGITLAB_TOKENis 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
- We are trying to figure out how to distribute our slash commands, skills, agents, etc to 200+ developers. Plugins seem designed for this
- We do not want to publicly expose this
- We use Gitlab SaaS so the server is not in our network and requires auth
- 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
I am dealing with this gap as well. We definitely could use this!
This would be useful
This is definitely needed
This would be an awesome feature for team onboarding!
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.
I also vote for this feature request!
yes please.
Hitting the same wall here. Would appreciate being able to use my SSH key to authenticate to my private gitlab.
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
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.
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.
Also experiencing this issue. Would be incredible for managing internal Claude Code plugins!
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:
-
GITHUB_TOKENenvironment variable is not passed to the git subprocess -
gh auth git-credentialhelper (configured viacredential.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 statusshows active authentication withGITHUB_TOKEN -
git ls-remote https://github.com/my-org/private-repo.gitworks perfectly - But
/plugin marketplace add https://github.com/my-org/private-repo.gitfails
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.
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