An open-source library built on the Context Engine SDK that makes diverse sources searchable across agents and apps.
Features
- Multiple Sources: Index code, documentation, runbooks, schemas, and configs from GitHub, GitLab, BitBucket, or websites - Flexible Storage: Store indexes locally or in S3 for persistent storage in production apps - Multiple Clients: CLI search, interactive agent, MCP server (local & remote) - Incremental Updates: Only re-index what changed - Smart Filtering: Respects .gitignore, .augmentignore, and filters binary/generated files
github | Index a GitHub repository | | gitlab | Index a GitLab project | | bitbucket | Index a Bitbucket repository | | website | Crawl and index a website |
list_files and read_file tools in addition to search. Use --search-only to disable file operations and provide only the search tool.
Programmatic Usage
$3
`typescript import { Indexer } from "@augmentcode/context-connectors"; import { GitHubSource } from "@augmentcode/context-connectors/sources"; import { FilesystemStore } from "@augmentcode/context-connectors/stores";
const source = new GitHubSource({ owner: "myorg", repo: "myrepo" }); const store = new FilesystemStore({ basePath: ".context-connectors" }); const indexer = new Indexer();
const result = await indexer.index(source, store, "my-project"); console.log(
Indexed ${result.filesIndexed} files); `
$3
`typescript import { SearchClient } from "@augmentcode/context-connectors"; import { FilesystemStore } from "@augmentcode/context-connectors/stores";
const store = new FilesystemStore({ basePath: ".context-connectors" }); const client = new SearchClient({ store, indexName: "my-project" }); await client.initialize(); // Required before calling search()
const result = await client.search("authentication"); console.log(result.results);
`
> Important: You must call
await client.initialize() before calling search(). This loads the index state and prepares the client for queries. Calling search() or getMetadata() before initialization will throw a "Client not initialized" error.
$3
`typescript import { runMCPServer } from "@augmentcode/context-connectors"; import { FilesystemStore } from "@augmentcode/context-connectors/stores";
const store = new FilesystemStore({ basePath: ".context-connectors" });
The remote MCP server uses HTTP without TLS by default. This has important security implications:
⚠️ API keys and all data are transmitted in cleartext when using plain HTTP. This means anyone who can observe network traffic (via MITM attacks, network sniffing, etc.) can capture credentials and data.
#### Recommended Deployments
For Development (localhost only)
When binding to
localhost (the default), traffic never leaves your machine:`bash
Now connect to localhost:3000 on your local machine
`
#### Network Isolation
If TLS isn't feasible, ensure the server runs within: - A private VPC/network with no public internet access - A trusted network segment with firewall rules limiting access - A Docker network or Kubernetes cluster with network policies
#### Authentication
Always use an API key for any non-localhost deployment:
`bash
Set via environment variable (recommended - avoids key in shell history)
`typescript import express from "express"; import { createExpressHandler } from "@augmentcode/context-connectors/integrations/express"; import { FilesystemStore } from "@augmentcode/context-connectors/stores";
const app = express(); const store = new FilesystemStore({ basePath: "./indexes" });
// Must use raw body for signature verification app.post( "/webhook", express.raw({ type: "application/json" }), createExpressHandler({ store, secret: process.env.GITHUB_WEBHOOK_SECRET!, }) );
app.listen(3000);
`
$3
`typescript import { createGitHubWebhookHandler, verifyWebhookSignature } from "@augmentcode/context-connectors/integrations"; import { S3Store } from "@augmentcode/context-connectors/stores";
const store = new S3Store({ bucket: "my-indexes" }); const handler = createGitHubWebhookHandler({ store, secret: "..." });
// In your request handler: async function handleRequest(req: Request) { const signature = req.headers.get("x-hub-signature-256")!; const eventType = req.headers.get("x-github-event")!; const body = await req.text();
if (!await verifyWebhookSignature(body, signature, secret)) { return new Response("Unauthorized", { status: 401 }); }
const result = await handler(eventType, JSON.parse(body)); return Response.json(result); }
`
$3
1. Go to Settings > Developer settings > GitHub Apps > New GitHub App 2. Set webhook URL to your deployed handler 3. Generate and save the webhook secret 4. Set Repository contents permission to Read 5. Subscribe to Push events 6. Install the app on your repositories
Environment Variables
| Variable | Description | Required For | |----------|-------------|--------------| |
AUGMENT_API_TOKEN | Augment API token | All operations | | AUGMENT_API_URL | Augment API URL | All operations | | GITHUB_TOKEN | GitHub access token | GitHub source | | GITLAB_TOKEN | GitLab access token | GitLab source | | BITBUCKET_TOKEN | BitBucket access token | BitBucket source | | GITHUB_WEBHOOK_SECRET | Webhook signature secret | Webhook integration | | OPENAI_API_KEY | OpenAI API key | Agent (openai provider) | | ANTHROPIC_API_KEY | Anthropic API key | Agent (anthropic provider) | | GOOGLE_API_KEY | Google API key | Agent (google provider) | | AWS_ACCESS_KEY_ID | AWS access key | S3 store | | AWS_SECRET_ACCESS_KEY | AWS secret key | S3 store | | CC_S3_BUCKET | S3 bucket name | S3 store | | CC_S3_ENDPOINT | Custom S3 endpoint URL (for MinIO, etc.) | S3-compatible storage | | CC_S3_FORCE_PATH_STYLE | Use path-style URLs (true/false) | S3-compatible storage | | MCP_API_KEY | API key for MCP HTTP server authentication | MCP HTTP server | | CONTEXT_CONNECTORS_STORE_PATH | Override default store location | Optional |
Data Storage
By default, indexes are stored in
~/.augment/context-connectors/ on all platforms.
This location aligns with other Augment CLI state: -
--store-path or the CONTEXT_CONNECTORS_STORE_PATH environment variable.
Architecture
` Sources → Indexer → Stores → Clients `
- Sources: Fetch files from data sources (GitHub, GitLab, BitBucket, Website) - Indexer: Orchestrates indexing using Augment's context engine - Stores: Persist index state (Filesystem, S3) - Clients: Consume the index (CLI, Agent, MCP Server via stdio or HTTP)
.augmentignore file must be placed in the source root directory (the path passed to the add command), not the current working directory.
Website Source
The website source crawls and indexes static HTML content.
$3
- JavaScript-rendered content is not supported. Only static HTML is crawled. Single-page applications (SPAs) or pages that require JavaScript to render content will not be fully indexed. - Link-based crawling only - pages must be discoverable through links from the starting URL.
S3-Compatible Storage
When using S3-compatible services like MinIO, DigitalOcean Spaces, or Backblaze B2, configure via environment variables: