add_repository
Attach a GitHub repository to a project (owner + repo_name; clone URL derived; projectId defaults to the bound / default project). Public repos need nothing else. Private repos need installation_id from list_installations (a GitHub App installation that covers the repo) or a workspace PAT saved on the dashboard; without either the attach is refused (private_repository_needs_credential) instead of failing on the queued clone. Idempotent. First attach dispatches an indexing job; response carries visibility, credential ("installation" | "pat" | null), indexing_status ("queued" | "already_indexed") and indexing_job_id to poll. Needs mcp:admin.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | GitHub owner (user or org) | |
| feedback | No | Optional: report how a previous answer worked out; piggybacks on any call. | |
| projectId | No | Project id from init/list_projects. Omit for the active project. | |
| repo_name | Yes | Repository name | |
| default_branch | No | Default branch (default main) | |
| installation_id | No | Private repository: id of a GitHub App installation from list_installations that covers it. Refused (installation_lacks_repository) when the installation does not grant access. |