| description | argument-hint |
|---|---|
Index GitHub repos with Augment Context Connectors and generate MCP server config |
org/repo1#main, org/repo2#develop, org/repo3#v1.0 |
You are setting up Augment Context Connectors to index multiple GitHub repositories and configure an MCP server for cross-repo semantic search.
If $ARGUMENTS is empty or not provided, ask the user for:
- A comma-separated list of repos in the format
org_name/repo_name#ref_name(e.g.,myorg/service-auth#main, myorg/service-payments#develop) - A GitHub Personal Access Token (PAT) with
reposcope
If $ARGUMENTS is provided, use it as the repo list and ask only for the GitHub PAT.
Parse each entry from the comma-separated list into a tuple: (org_name, repo_name, ref_name).
For example, given: myorg/service-auth#main, myorg/service-payments#develop
Parse into:
org_name=myorg,repo_name=service-auth,ref_name=mainorg_name=myorg,repo_name=service-payments,ref_name=develop
Derive the index name for each repo by joining org and repo with underscore: org_name_repo_name (e.g., myorg_service-auth).
For each parsed repo, run the following command:
export GITHUB_TOKEN='<github-pat>' && npx @augmentcode/context-connectors index github \
--owner <org_name> \
--repo <repo_name> \
--ref <ref_name> \
--index <org_name>_<repo_name> \
--store filesystemRun these commands sequentially (one at a time), and report success/failure for each repo before moving to the next.
Run this command and capture its output:
auggie token printThe output will contain a line like:
SESSION={"accessToken":"...","tenantURL":"https://...","scopes":["read","write"]}
Parse the JSON from the SESSION= line to extract:
accessToken— the Augment API tokentenantURL— the Augment API URL
Using all the collected values, display the following MCP server configuration snippet for the user to add to their ~/.augment/settings.json file:
{
"mcpServers": {
"Augment Context Connectors": {
"type": "stdio",
"command": "npx",
"args": [
"@augmentcode/context-connectors",
"mcp",
"stdio",
"--index <index_name_1> <index_name_2> <index_name_n>"
],
"env": {
"AUGMENT_API_TOKEN": "<accessToken>",
"AUGMENT_API_URL": "<tenantURL>",
"GITHUB_TOKEN": "<github-pat>"
}
}
}
}NOTES:
- the
--indexargument receives a list of index names separated by space (NOT commas). It is a one single param followed by the indexes names. <index_name_1> <index_name_2> <index_name_n>corresponds to the list of indexed repos (using theorg_name_repo_namepattern)<accessToken>and<tenantURL>come from Step 4<github-pat>is the GitHub PAT provided in Step 1
After displaying the config, provide a summary:
- List all repos that were successfully indexed
- List any repos that failed to index (if any)
- Remind the user to:
- Copy the JSON snippet into
~/.augment/settings.json(merge with existing config if needed) - Restart Auggie CLI or their IDE to pick up the new MCP server
- The
context-connectorsMCP server will now allow semantic search across all indexed repos without naming them explicitly
- Copy the JSON snippet into