Commit Graph

616 Commits

Author SHA1 Message Date
Adam Holt cf6bab9908 WIP
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
Build and Test Go Project / build (macos-latest) (push) Has been cancelled
Build and Test Go Project / build (ubuntu-latest) (push) Has been cancelled
Build and Test Go Project / build (windows-latest) (push) Has been cancelled
2026-01-12 17:43:48 +01:00
Adam Holt 3956a97e7c WIP 2026-01-12 13:11:09 +01:00
Ksenia Bobrova 44d9e1329e Bringing back local mcp server registry config (#1767)
* Bringing back local mcp server registry config

* Making auth header optional
2026-01-09 13:41:11 +01:00
Tommaso Moro b1ab893af3 bug fix (#1775) 2026-01-09 12:10:42 +00:00
copilot-swe-agent[bot] c061804405 Use default scope in examples and clarify --scope flag is optional
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-08 21:34:03 +00:00
copilot-swe-agent[bot] e33550311a Update Claude Code installation command to use add-json format for v2.1.1+
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-08 21:34:03 +00:00
copilot-swe-agent[bot] ff0e67e008 Add formatScopeDisplay helper and improve empty scope handling
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-08 10:52:36 +00:00
copilot-swe-agent[bot] 33014a66ef Add helpers.go with shared formatToolsetName function
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-08 10:52:36 +00:00
copilot-swe-agent[bot] cd75b9b96b Refactor formatToolsetName to shared helper function
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-08 10:52:36 +00:00
copilot-swe-agent[bot] d2df189e98 Add list_scopes.go implementation file
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-08 10:52:36 +00:00
copilot-swe-agent[bot] ee8f4e6bc5 Add list-scopes command using inventory architecture
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-08 10:52:36 +00:00
Tommaso Moro f2ff9d22fe updated (#1756) 2026-01-08 09:53:48 +00:00
Sam Morrow cc9e8645c1 Fix nil pointer dereference in completion handler
The CompleteParams.Context field is optional (marked omitempty) and can be
nil when clients don't send it. The code was accessing Context.Arguments
directly without checking if Context was nil first, causing a panic.

This fix adds a nil check for Context before accessing Arguments.
2026-01-07 15:44:58 +00:00
Florian Grousset ab23070b43 Update command instructions for terminal usage
Clarified instructions to run commands in the terminal instead of Claude Code CLI.
2026-01-07 09:36:21 +00:00
Matt Holloway 71862a93e4 update tests to use new mock pattern 2026-01-06 17:38:12 +00:00
Matt Holloway a57b4726e5 add http resp code checking for getProjectItem 2026-01-06 17:38:12 +00:00
Matt Holloway be5a449e48 fix project tools to add scope to newtool init 2026-01-06 17:38:12 +00:00
Matt Holloway 099f995615 revert "hold-bac feature flag" 2026-01-06 17:38:12 +00:00
Matt Holloway 7b30c930f8 update docs 2026-01-06 17:38:12 +00:00
Matt Holloway 304f07401e hold-bac feature flag 2026-01-06 17:38:12 +00:00
Matt Holloway 3cd0be2af2 update tool aliases 2026-01-06 17:38:12 +00:00
Matt Holloway 66a01645f8 initial projects consolidation 2026-01-06 17:38:12 +00:00
Copilot 80b0306557 Replace go-github-mock with stretchr/testify for actions/issues/projects tests (#1737)
* Initial plan

* migrate tests from go-github-mock to internal testify-based mock

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* address feedback in testmock helper

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* tweak testmock path matching edge case

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* refine testmock options and path matching

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* simplify matchPath and document delete endpoint

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* Replace go-github-mock usage in tests with shared HTTP mock helper

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* Replace go-github-mock usage in tests with shared HTTP mock helper

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* fix tests and lint after mock cleanup

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* Remove import completely

* Partial removal in repositories_test.go

* Final removal

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>
Co-authored-by: JoannaaKL <joannaakl@github.com>
2026-01-06 10:45:29 +01:00
Sam Morrow 7d4a4a68c3 Document public repo access quirk for read-only tools 2026-01-05 16:05:24 +00:00
Sam Morrow c428f72863 Don't filter read-only repo tools (work on public repos without scope) 2026-01-05 16:05:24 +00:00
Sam Morrow c80976661e Mention OAuth scope challenges in server-configuration.md 2026-01-05 16:05:24 +00:00
Sam Morrow 9aef43596e Fix server-configuration.md scope filtering description 2026-01-05 16:05:24 +00:00
Sam Morrow 4deaa8321e Remove empty filter.go and document OAuth scope challenges 2026-01-05 16:05:24 +00:00
Sam Morrow f14f507a39 Add tip about editing PAT scopes in GitHub UI 2026-01-05 16:05:24 +00:00
Sam Morrow acd7929281 Document that GitHub App and server-to-server tokens are not filtered 2026-01-05 16:05:24 +00:00
Sam Morrow c2450ce96a Update pkg/scopes/filter.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-05 16:05:24 +00:00
Sam Morrow 39fed357f4 Remove manual scope-to-tools table from docs
The README already has auto-generated tool documentation with scopes.
Keep only the scope hierarchy explanation which is structural.
2026-01-05 16:05:24 +00:00
Sam Morrow 8afb4fb16e Only check scopes for classic PATs (ghp_ prefix)
- Scope filtering only applies to classic PATs which return X-OAuth-Scopes
- Fine-grained PATs and other token types skip filtering (all tools shown)
- Updated docs to clarify PAT filtering vs OAuth scope challenges
2026-01-05 16:05:24 +00:00
Sam Morrow f45b94a8f5 Make scope filtering always enabled (remove flag)
Scope filtering is now a built-in feature rather than a configurable option.
The server automatically fetches token scopes at startup and filters tools
accordingly. If scope detection fails, it logs a warning and continues with
all tools available.
2026-01-05 16:05:24 +00:00
Sam Morrow a19a159d0a Enable scope filtering by default 2026-01-05 16:05:24 +00:00
Sam Morrow 46b8cb63ac Add PAT scope filtering for stdio server
Add the ability to filter tools based on token scopes for PAT users.
This uses an HTTP HEAD request to GitHub's API to discover token scopes.

New components:
- pkg/scopes/filter.go: HasRequiredScopes checks if scopes satisfy tool requirements
- pkg/scopes/fetcher.go: FetchTokenScopes gets scopes via HTTP HEAD to GitHub API
- pkg/github/scope_filter.go: CreateScopeFilter creates inventory.ToolFilter

Integration:
- Add --filter-by-scope flag to stdio command (disabled by default)
- When enabled, fetches token scopes on startup
- Tools requiring unavailable scopes are hidden from tool list
- Gracefully continues without filtering if scope fetch fails (logs warning)

This allows the OSS server to have similar scope-based tool visibility
as the remote server, and the filter logic can be reused by remote server.
2026-01-05 16:05:24 +00:00
Sam Morrow 48744ca556 Sort scope slices for deterministic output
Map iteration in Go is non-deterministic, which causes doc generation
to produce different output on each run. Sort the scope slices in:
- ScopeSet.ToSlice()
- ScopeSet.ToStringSlice()
- ExpandScopes()
2026-01-05 15:54:17 +00:00
Sam Morrow cec5a1ae0f Fix conflict and regenerate docs after rebase 2026-01-05 15:54:17 +00:00
Sam Morrow df9fc6a3b3 Use repo scope for star/unstar tools instead of public_repo
public_repo is implicit - the GitHub API handles the distinction between
public and private repos. Using repo as the required scope is more
consistent with our enforcement model:
- PATs: tools visible if token has repo scope
- OAuth: scope challenge requests repo scope
2026-01-05 15:54:17 +00:00
Sam Morrow 3d1ae306f8 refres readme after update 2026-01-05 15:54:17 +00:00
Sam Morrow 7796c08681 Add scope hierarchy and auto-derive accepted scopes
- Add ScopeHierarchy map defining parent-child scope relationships
- Add ExpandScopes() function to derive accepted scopes from required scopes
- Update NewTool/NewToolFromHandler to take []scopes.Scope and auto-derive AcceptedScopes
- Add new scope constants: NoScope, User, ReadUser, UserEmail, ReadPackages, WritePackages
- Update all tool files to use new signature with typed scopes
- Add comprehensive tests for ExpandScopes

The scope hierarchy allows automatic derivation of accepted scopes:
- repo → public_repo, security_events
- admin:org → write:org → read:org
- project → read:project
- write:packages → read:packages
- user → read:user, user:email

This enables the remote server to consume scope info directly from OSS tools.
2026-01-05 15:54:17 +00:00
Sam Morrow c765101aeb refresh readme after rebase 2026-01-05 15:54:17 +00:00
copilot-swe-agent[bot] db179be4c3 Simplify scope implementation per feedback
- Replace NewToolWithScopes with updated NewTool that includes scope parameters
- All tools now use the same constructor with explicit scope requirements
- Documentation only shows accepted scopes when they differ from required
- Removed NewToolWithScopes and NewToolFromHandlerWithScopes helper functions

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-05 15:54:17 +00:00
copilot-swe-agent[bot] db9f4e8ddf Complete OAuth scope implementation for all tools
- Updated all remaining tools with OAuth scope information
- Added scope documentation generation to generate-docs command
- Documentation now shows Required and Accepted OAuth scopes for each tool
- All 100+ tools now have scope information defined
- Tests pass, linter passes, documentation generated successfully

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-05 15:54:17 +00:00
copilot-swe-agent[bot] 1e5931a2ab Update most tools with OAuth scope information
- Updated 60+ tools with required and accepted OAuth scopes
- Added scopes to: gists, git, notifications, projects, code scanning,
  dependabot, secret scanning, security advisories, actions, discussions,
  issues (partial), labels, pull requests (partial), repositories (partial), search (partial)
- Remaining: ~20 tools in issues, pullrequests, repositories, and search files

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-05 15:54:17 +00:00
copilot-swe-agent[bot] eb6db0fb5d Add scopes package and update ServerTool struct with scope fields
- Created pkg/scopes package with OAuth scope constants
- Added RequiredScopes and AcceptedScopes fields to ServerTool
- Added NewToolWithScopes helpers in dependencies.go
- Updated context tools (get_me, get_teams, get_team_members) with scopes

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-05 15:54:17 +00:00
Ksenia Bobrova 2b352ab0b9 Improvements to push_files tool (#1676)
Build and Test Go Project / build (macos-latest) (push) Has been cancelled
Build and Test Go Project / build (ubuntu-latest) (push) Has been cancelled
Build and Test Go Project / build (windows-latest) (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
Docker / build (push) Has been cancelled
GoReleaser Release / release (push) Has been cancelled
Publish to MCP Registry / publish (push) Has been cancelled
* Fallback to default branch in get_file_contents when main doesn't exist

* Addressing review comments

* Improvements to push_files tool

* Fixed copilot comments

* Addressing review comments

* Remove debug statement
v0.27.0
2026-01-05 13:27:32 +01:00
Matt Holloway 905a08f8fb Update cmd/github-mcp-server/generate_docs.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-05 10:14:37 +00:00
Matt Holloway 67f3427d39 Update cmd/github-mcp-server/generate_docs.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-05 10:14:37 +00:00
Matt Holloway 6f7bf271ed refactor docs toolset gen 2026-01-05 10:14:37 +00:00