Skip to content

Add repository focus mode for project-scoped MCP workflows#2629

Open
advancedresearcharray wants to merge 1 commit into
github:mainfrom
advancedresearcharray:fix/project-context-default-repo-1683
Open

Add repository focus mode for project-scoped MCP workflows#2629
advancedresearcharray wants to merge 1 commit into
github:mainfrom
advancedresearcharray:fix/project-context-default-repo-1683

Conversation

@advancedresearcharray
Copy link
Copy Markdown

@advancedresearcharray advancedresearcharray commented Jun 6, 2026

Summary

  • Adds --repository / GITHUB_REPOSITORY configuration to bind a stdio server instance to a default owner/repo, similar to working inside a git checkout with gh.
  • Introduces get_repository_context to return the configured repository, token type, and access status (with fine-grained PAT permission hints when access fails).
  • Enables repository focus mode that updates server instructions and hides open-world discovery tools unless --allow-discovery-tools is set.

Test plan

  • go test ./pkg/github/... ./pkg/inventory/... ./internal/ghmcp/...
  • Configure MCP with GITHUB_REPOSITORY=owner/repo and confirm get_repository_context returns the expected owner/repo
  • Verify discovery tools are hidden in focus mode and visible with --allow-discovery-tools
  • Confirm fine-grained PAT access failures include actionable hints in get_repository_context

Closes #1683

@advancedresearcharray advancedresearcharray requested a review from a team as a code owner June 6, 2026 19:18
@advancedresearcharray advancedresearcharray force-pushed the fix/project-context-default-repo-1683 branch 3 times, most recently from 613e046 to 8c06dba Compare June 6, 2026 22:22
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 github#1683
@advancedresearcharray advancedresearcharray force-pushed the fix/project-context-default-repo-1683 branch from 8c06dba to d331b8d Compare June 6, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Addressing GitHub MCP's Key Issues: Token Scopes, Verbose Prompts, and Lack of Project Context

1 participant