Skip to content

Commit 3e4099d

Browse files
committed
chore: make GITHUB_API_PARALLELISM configurable via env var (default 4)
1 parent affae4e commit 3e4099d

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

docs/install.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,16 @@ Across clients you always provide:
7070

7171
Register the server under a stable name (this documentation uses **`rethunk-github`**). Tools appear as `{serverName}_{toolName}` (e.g. `rethunk-github_repo_status`).
7272

73+
### Environment variables
74+
75+
| Variable | Default | Purpose |
76+
|----------|---------|---------|
77+
| **`GITHUB_TOKEN`** | (required) | GitHub personal access token. Required scopes: `repo`, `read:org` (for `org_pulse`). |
78+
| **`GH_TOKEN`** | (fallback) | Alternative to `GITHUB_TOKEN` if using `gh` CLI authentication. |
79+
| **`GITHUB_API_URL`** | `https://api.github.com` | GitHub REST API base URL (for GitHub Enterprise). |
80+
| **`GITHUB_GRAPHQL_URL`** | (auto) | GitHub GraphQL endpoint (for GitHub Enterprise; defaults to REST API URL + `/graphql`). |
81+
| **`GITHUB_API_PARALLELISM`** | `4` | Concurrency limit for API calls. Lower if rate-limited; raise if on a fast connection. |
82+
7383
## Cursor
7484

7585
**User scope:** `~/.cursor/mcp.json`. **Project scope:** `.cursor/mcp.json`.
@@ -180,5 +190,5 @@ For contributors working inside a clone of [rethunk-github-mcp](https://github.c
180190
| Tools missing / stale | Restart the MCP host or use its "reload MCP / reset tools" action. |
181191
| `npx` / `bun` not found | Install Node >= 22 or Bun; use full paths in config if `PATH` is minimal. |
182192
| `org_not_found` | Verify the org login; the token needs `read:org` scope for org access. |
183-
| Rate limits | GitHub API has rate limits (5,000/hr REST, 5,000 points/hr GraphQL). Reduce `maxRepos`/`maxResults` if hitting limits. |
193+
| Rate limits | GitHub API has rate limits (5,000/hr REST, 5,000 points/hr GraphQL). Reduce `maxRepos`/`maxResults` if hitting limits. Set `GITHUB_API_PARALLELISM` (default `4`) lower for rate-limited environments. |
184194
| GitHub Enterprise | Set `GITHUB_API_URL` (and optionally `GITHUB_GRAPHQL_URL`) in the `env` block. |

src/server/github-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export async function asyncPool<T, R>(
6868
return results;
6969
}
7070

71-
const GITHUB_API_PARALLELISM = 4;
71+
const GITHUB_API_PARALLELISM = parseInt(process.env.GITHUB_API_PARALLELISM ?? "4", 10);
7272

7373
/** Convenience: run API calls in parallel with default concurrency. */
7474
export async function parallelApi<T, R>(

0 commit comments

Comments
 (0)