github-mcp-server
github-mcp-server copied to clipboard
Add repository focus mode for project-scoped MCP workflows
Summary
- Adds
--repository/GITHUB_REPOSITORYconfiguration to bind a stdio server instance to a defaultowner/repo, similar to working inside a git checkout withgh. - Introduces
get_repository_contextto 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-toolsis set.
Test plan
- [x]
go test ./pkg/github/... ./pkg/inventory/... ./internal/ghmcp/... - [ ] Configure MCP with
GITHUB_REPOSITORY=owner/repoand confirmget_repository_contextreturns 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
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.