You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add repository focus mode for project-scoped MCP workflows
Bind a stdio server instance to a default owner/repo so agents can call
get_repository_context instead of searching repositories first, with optional
discovery-tool filtering and fine-grained PAT access hints.
Closes#1683
| Default Repository | Not available |`--repository` flag or `GITHUB_REPOSITORY` env var |
18
19
| Server Name/Title | Not available |`GITHUB_MCP_SERVER_NAME` / `GITHUB_MCP_SERVER_TITLE` env vars or `github-mcp-server-config.json`|
19
20
20
21
> **Default behavior:** If you don't specify any configuration, the server uses the **default toolsets**: `context`, `issues`, `pull_requests`, `repos`, `users`.
@@ -446,6 +447,49 @@ MCP Apps is enabled by [Insiders Mode](#insiders-mode), or independently via the
446
447
447
448
---
448
449
450
+
### Repository Focus Mode
451
+
452
+
**Best for:** single-repository development workflows where agents should behave like `gh` inside a git checkout—working directly on one project instead of searching across your account first.
453
+
454
+
Set a default repository with `--repository owner/repo` or the `GITHUB_REPOSITORY` environment variable. The value accepts common formats such as `owner/repo`, `https://github.com/owner/repo`, or `git@github.com:owner/repo.git`.
455
+
456
+
When a default repository is configured:
457
+
458
+
- The `get_repository_context` tool returns the configured owner/repo and verifies token access (including fine-grained PAT permission hints when access fails).
459
+
- Server instructions tell agents to call `get_repository_context` first and use the configured owner/repo with repo-scoped tools like `list_issues`.
460
+
- Open-world discovery tools (`search_repositories`, `search_users`, `search_orgs`, `list_starred_repositories`, `create_repository`, `fork_repository`) are hidden unless you pass `--allow-discovery-tools`.
> **Note:** The MCP server cannot read your local `.git` directory directly. Configure `GITHUB_REPOSITORY` in your MCP host settings (or pass `--repository`) to bind an instance to the project you are working on.
490
+
491
+
---
492
+
449
493
### Scope Filtering
450
494
451
495
**Automatic feature:** The server handles OAuth scopes differently depending on authentication type:
@@ -467,6 +511,8 @@ See [Scope Filtering](./scope-filtering.md) for details on how filtering works w
467
511
| Server fails to start | Invalid tool name in `--tools` or `X-MCP-Tools`| Check tool name spelling; use exact names from [Tools list](../README.md#tools)|
468
512
| Write tools not working | Read-only mode enabled | Remove `--read-only` flag or `X-MCP-Readonly` header |
469
513
| Tools missing | Toolset not enabled | Add the required toolset or specific tool |
514
+
| Agent searches all repos first | No default repository configured | Set `GITHUB_REPOSITORY` or `--repository owner/repo` and call `get_repository_context`|
515
+
| Fine-grained PAT cannot access collaborator repo | Token not authorized for that repository | Grant repository access and required permissions on the fine-grained PAT; check `get_repository_context` hint |
0 commit comments