github-mcp-server icon indicating copy to clipboard operation
github-mcp-server copied to clipboard

Add repository focus mode for project-scoped MCP workflows

Open advancedresearcharray opened this issue 5 months ago • 1 comments

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

  • [x] 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 avatar Jun 06 '26 19:06 advancedresearcharray

Merge-ready check-in

This PR looks ready for maintainer review/merge when you have a moment.

  • Change: Add repository focus mode for project-scoped MCP workflows
  • CI: green / passing
  • Review: REVIEW_REQUIRED (mergeable: MERGEABLE)

Happy to rebase or address any remaining feedback. Thanks for maintaining the project.

advancedresearcharray avatar Jun 12 '26 17:06 advancedresearcharray