Use GitHub MCP server with dynamic repo context in code-scanning-fixer workflow #10164
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
code-scanning-fixerworkflow was instructing the AI to use the GitHub API directly with unspecified owner/repo parameters. Updated to use GitHub MCP server tools with dynamic context variables.Changes:
list_code_scanning_alertsfrom GitHub MCP server instead of direct API references${{ github.repository_owner }}for owner and extraction pattern for repo from${{ github.repository }}severity: highparameter directly in MCP tool call instead of post-filtering resultslist_code_scanning_alerts,get_code_scanning_alert, andget_file_contentscallsBefore:
After:
The workflow frontmatter already configures the GitHub MCP server via
tools.github.toolsets: [code_security].Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.