> ## Documentation Index
> Fetch the complete documentation index at: https://docs.joystream.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect GitHub for private repos

> Connect a repo-scoped GitHub token and import a private repository as a skill source or MCP repository.

To import a private GitHub repository — skills or MCP servers — you need a GitHub credential with the `repo` scope connected to JoyStream. This guide walks through connecting it and running your first private sync.

<Steps>
  <Step title="Create a GitHub personal access token">
    In GitHub, create a personal access token that includes the `repo` scope. That scope grants read access to your private repositories.

    <Note>
      The standard "Connect with GitHub" sign-in grants only public access. A personal access token with `repo` scope is the supported way to read private repositories today.
    </Note>
  </Step>

  <Step title="Connect it in JoyStream">
    Open **Settings → Connections**, choose **Connect a Service**, and connect **GitHub** using your `repo`-scoped token.

    You can also reach this page from the **Connect GitHub** call to action that appears on a skill source or MCP repository card when a sync reports that a credential is required.
  </Step>

  <Step title="Add the repository">
    In the UI, use the skill sources or MCP repositories card and paste the repository URL.

    From the CLI:

    ```bash theme={null}
    # MCP repository
    jstm mcp repo add https://github.com/acme-corp/internal-mcp-servers --scope personal

    # Skill source
    jstm skills repo add https://github.com/acme-corp/internal-skills --scope personal
    ```

    Only GitHub URLs are accepted. A non-GitHub URL is rejected at this step.
  </Step>

  <Step title="Sync it">
    In the UI, click the per-row **Sync** control on the card.

    From the CLI:

    ```bash theme={null}
    jstm mcp repo sync 3f21b8c0-91ad-4f6e-89b2-77c0a4e1d9f3
    jstm skills repo sync 9b74e2a1-33cd-4f80-a5e6-1d20b8f7c4aa
    ```

    On success you see how many servers or skills were imported.
  </Step>
</Steps>

## If you see "GitHub credential required"

The sync couldn't read the repository and no usable GitHub credential was found for you. This is the expected message before you've connected a `repo`-scoped token.

In the UI, click **Connect GitHub** on the card to reach `/settings/connections`.

From the CLI you see:

```text theme={null}
GitHub credential required.

Connect a GitHub token with 'repo' scope: /settings/connections
```

With `--json`:

```json theme={null}
{
  "error": "credential_required",
  "provider": "github",
  "required_scope": "repo",
  "connect_url": "/settings/connections"
}
```

Connect a `repo`-scoped GitHub token, then re-run the sync.

## If a sync still fails after connecting

If you have a credential connected but the sync reports the repository wasn't found, either the repository path is wrong or your token does not have `repo` access to it. Check the token's scope and confirm it can see that repository.

For organization repositories protected by SSO, authorize the token for that organization's SSO and retry.

## Notes

* Public repositories need no credential at all.
* The CLI has no `--token` flag by design. It always uses the credential you connected in Settings, so your token never ends up in your shell history.
* Your token is used only for the sync request and is then discarded.

## See also

* [Importing private GitHub repositories](/features/private-repos) — how it works.
* [Credential problems](/troubleshooting/credentials)
