Skip to content

Add optional GitHub MCP support to actions-ai-inference.md shared configuration#1288

Merged
pelikhan merged 5 commits intomainfrom
copilot/update-ai-inference-file
Oct 7, 2025
Merged

Add optional GitHub MCP support to actions-ai-inference.md shared configuration#1288
pelikhan merged 5 commits intomainfrom
copilot/update-ai-inference-file

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 7, 2025

This PR adds optional GitHub MCP (Model Context Protocol) integration to the actions-ai-inference.md shared workflow configuration file, following the capabilities documented in the actions/ai-inference README.

Changes

Updated .github/workflows/shared/actions-ai-inference.md to include:

  • enable-github-mcp: ${{ secrets.GITHUB_MCP_TOKEN != '' }} - Conditionally enables GitHub MCP based on secret availability
  • github-mcp-token: ${{ secrets.GITHUB_MCP_TOKEN }} - Provides the PAT token for MCP server authentication
  • Documentation: Added comprehensive setup instructions in the markdown comment explaining how to configure the GITHUB_MCP_TOKEN secret

How It Works

The expression ${{ secrets.GITHUB_MCP_TOKEN != '' }} evaluates to:

  • true when the GITHUB_MCP_TOKEN secret is defined → enables MCP
  • false when the secret is not defined → disables MCP (default behavior)

This makes the GitHub MCP support optional and backward compatible. Workflows using this shared configuration will:

  • Automatically gain GitHub MCP capabilities when the secret is configured
  • Continue working normally without the secret (MCP remains disabled)

Setup Instructions

To enable GitHub MCP integration:

  1. Go to your repository settings → Secrets and variables → Actions
  2. Create a new repository secret named GITHUB_MCP_TOKEN
  3. Use a Personal Access Token (PAT) with appropriate permissions as the secret value

Important: The GitHub MCP integration requires a Personal Access Token (PAT) and cannot use the built-in GITHUB_TOKEN.

Why This Matters

The GitHub MCP integration provides AI models with access to GitHub tools for repository management, issue tracking, and pull request operations. By making it optional through secret detection, workflows can:

  • Use MCP features in environments where a PAT is available
  • Run without MCP in standard environments using only GITHUB_TOKEN
  • Avoid requiring configuration changes to enable/disable the feature

Impact

The issue-classifier.lock.yml workflow has been recompiled to include these new fields. All existing functionality remains unchanged, and all tests pass.

Original prompt

Update the ai-inference.md file to support an optional github MCP. See actions/ai-inference readme.

  • the enable field should be an expression that checks if the github_mcp_secret secret is defined.

✨ 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 October 7, 2025 01:32
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update ai-inference.md to support optional GitHub MCP Add optional GitHub MCP support to actions-ai-inference.md shared configuration Oct 7, 2025
Copilot AI requested a review from pelikhan October 7, 2025 01:34
@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented Oct 7, 2025

@copilot use GITHUB_MCP_TOKEN (secrets.GITHUB_MCP_TOKEN) for the mcp secret.

@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented Oct 7, 2025

@copilot update markdown to describe how to configure the secrets.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 7, 2025

@copilot use GITHUB_MCP_TOKEN (secrets.GITHUB_MCP_TOKEN) for the mcp secret.

Updated to use GITHUB_MCP_TOKEN in commit 5a4aebc.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 7, 2025

@copilot update markdown to describe how to configure the secrets.

Added documentation in commit b91e9e4 with instructions on configuring the GITHUB_MCP_TOKEN secret.

@pelikhan pelikhan marked this pull request as ready for review October 7, 2025 02:20
@pelikhan pelikhan merged commit 18a0e24 into main Oct 7, 2025
@pelikhan pelikhan deleted the copilot/update-ai-inference-file branch October 7, 2025 02:20
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