Skip to content

[WIP] Add validation for GitHub token permissions in MCP-server - #13504

Closed
pelikhan with Copilot wants to merge 3 commits into
mainfrom
copilot/add-github-token-validation
Closed

pelikhan with Copilot wants to merge 3 commits into
mainfrom
copilot/add-github-token-validation

Conversation

Copilot AI commented Feb 3, 2026 •

Copy link
Copy Markdown
Contributor

Task: Add GitHub Token Permission Validation for Logs/Audit Tools

Adding code to validate GitHub token permissions for workflow runs in the MCP server command.

Plan

  • Explore repository structure and understand MCP server implementation
  • Identify where tools are registered (pkg/cli/mcp_server.go)
  • Find validation function location (pkg/cli/mcp_validation.go)
  • Review GitHub API permission checking examples
  • Create function to check GitHub Actions workflow runs permission
  • Add permission validation to validateMCPServerConfiguration
  • Conditionally disable logs and audit tools if permission check fails
  • Add extensive logging throughout the validation
  • Write tests for the permission validation function
  • Test the changes manually
  • Run linters and tests
  • Final validation with make agent-finish
Original prompt

Add code in MCP-server command that validates that the GitHub token has permissions to read the actions workflow runs. If not available, do not mount the logs and audit tools.

Add extensive logging.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 3, 2026 13:53
- Add checkGitHubActionsPermissions() function to validate token has actions:read permission
- Conditionally mount logs and audit tools based on permission check
- Add extensive logging throughout validation process
- Add unit tests for permission validation
- Add integration test for conditional tool mounting

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Use mcp.ListToolsParams instead of mcp.ListToolsRequest

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan closed this Feb 3, 2026
Copilot AI requested a review from pelikhan February 3, 2026 14:00
Copilot stopped work on behalf of pelikhan due to an error February 3, 2026 14:00
@github-actions
github-actions Bot deleted the copilot/add-github-token-validation branch April 2, 2026 12:06
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.

2 participants