Skip to content

Document MCP configuration and fix deprecated workflow flag#6

Closed
Copilot wants to merge 5 commits intomainfrom
copilot/update-docs-for-mcp-configuration
Closed

Document MCP configuration and fix deprecated workflow flag#6
Copilot wants to merge 5 commits intomainfrom
copilot/update-docs-for-mcp-configuration

Conversation

Copy link
Contributor

Copilot AI commented Jan 31, 2026

Commit 593425b introduced Model Context Protocol (MCP) for GitHub Copilot integration but left copilot.generate-tests.yml using deprecated flags and lacked documentation for the dual-token authentication pattern.

Critical Fix

.github/workflows/copilot.generate-tests.yml

  • Replaced deprecated --enable-all-github-mcp-tools with --mcp-config .github/mcp.json
  • Added missing GITHUB_MCP_TOKEN environment variable
  • Now consistent with copilot.generate-docs.yml pattern
# Before (deprecated)
copilot -p "$PROMPT" --enable-all-github-mcp-tools --allow-all-tools

# After
env:
  GH_TOKEN: ${{ secrets.COPILOT_CLI_TOKEN }}           # Copilot API auth
  GITHUB_MCP_TOKEN: ${{ secrets.GITHUB_TOKEN }}        # GitHub operations via MCP
run: |
  copilot -p "$PROMPT" \
    --mcp-config .github/mcp.json \
    --allow-all-tools

Documentation Added

Dual-Token Pattern (docs/github-deployment.md)

  • COPILOT_CLI_TOKEN: Personal PAT for Copilot API authentication (scope: copilot)
  • GITHUB_TOKEN: Workflow token for MCP operations (permissions: contents: read, issues: write)

MCP Configuration (.github/mcp.json)

{
  "mcpServers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "Authorization": "Bearer ${GITHUB_MCP_TOKEN}"
      }
    }
  }
}

Workflow Documentation (labs/agentic-ci-workflows/)

  • MCP server capabilities (read repos, create issues, assign tasks)
  • Workflow permissions requirements
  • Troubleshooting authentication failures, configuration errors, token expiration

Local Development (docs/development.md)

  • Setup instructions for using MCP with Copilot CLI locally
  • Example prompts for analyzing commits, generating docs, checking test coverage
  • Local troubleshooting scenarios

Coverage

  • 4 documentation files updated
  • 680 lines added
  • All MCP-enabled workflows now documented consistently
Original prompt

This section details on the original issue you should resolve

<issue_title>📚 Documentation needed for commit 593425b (MCP Configuration)</issue_title>
<issue_description>## Documentation Required for Commit 593425b

Summary

Commit 593425b introduces MCP (Model Context Protocol) configuration for GitHub Copilot integration and updates workflow authentication patterns.

What Changed

  1. New File: .github/mcp.json - MCP server configuration for GitHub API access
  2. Workflow Update: .github/workflows/copilot.generate-docs.yml now uses:
    • GH_TOKEN for Copilot CLI authentication
    • GITHUB_MCP_TOKEN for MCP GitHub operations
    • --mcp-config flag (replaces deprecated --enable-all-github-mcp-tools)

Documentation Needed

1. Update docs/github-deployment.md

  • Add section explaining MCP configuration requirements
  • Document the dual-token authentication pattern:
    • COPILOT_CLI_TOKEN: Personal PAT for Copilot API
    • GITHUB_TOKEN: Workflow token for MCP operations (issues, PRs, etc.)
  • Explain token scopes needed for each

2. Create/Update Workflow Documentation

  • Document the .github/mcp.json configuration format
  • Explain how MCP enables Copilot to interact with GitHub (create issues, assign tasks)
  • Provide troubleshooting guidance for MCP authentication failures

3. Update docs/development.md or Create New MCP Guide

  • Explain what MCP is and why it's used
  • Document local development setup with MCP
  • Provide examples of MCP-enabled Copilot capabilities

Breaking Changes

⚠️ Workflow now requires two secrets:

  • COPILOT_CLI_TOKEN (existing)
  • Workflow must have access to GITHUB_TOKEN with issue write permissions

Related Files

  • .github/mcp.json
  • .github/workflows/copilot.generate-docs.yml
  • docs/github-deployment.md
  • docs/development.md

This issue was automatically created by analyzing commit 593425b</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ 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 4 commits January 31, 2026 21:04
- Updated labs/agentic-ci-workflows/copilot.generate-docs.md:
  - Added dual-token authentication section (GH_TOKEN vs GITHUB_MCP_TOKEN)
  - Documented MCP configuration file format and fields
  - Explained workflow configuration with --mcp-config flag
  - Added MCP troubleshooting section
  - Included migration guide from deprecated flags

- Updated docs/github-deployment.md:
  - Added optional COPILOT_CLI_TOKEN secret documentation
  - Created comprehensive MCP Configuration section
  - Documented dual-token authentication pattern
  - Added token scopes summary table
  - Listed MCP-enabled workflows
  - Added MCP troubleshooting to main troubleshooting section
  - Updated table of contents

- Updated docs/development.md:
  - Added "Agentic Workflows with MCP" section
  - Explained MCP purpose and capabilities
  - Documented local MCP setup and usage
  - Provided example prompts for local development
  - Added MCP troubleshooting for local usage
  - Included links to detailed workflow documentation

Co-authored-by: raykao <860691+raykao@users.noreply.github.com>
- Update copilot.generate-tests.yml to use --mcp-config instead of deprecated --enable-all-github-mcp-tools flag
- Add GITHUB_MCP_TOKEN environment variable to copilot.generate-tests.yml workflow
- Add comprehensive MCP configuration section to copilot.generate-tests.md documentation
- Add dual-token authentication pattern explanation
- Add MCP troubleshooting section with common error scenarios
- Add migration guide from deprecated flags
- Enhance development.md with note about deprecated flag
- Ensure consistency across all MCP documentation files

This brings the generate-tests workflow and documentation in line with the generate-docs workflow,
ensuring all MCP-enabled workflows use the current configuration approach.
Remove MCP review documents as they were for internal review only

Co-authored-by: raykao <860691+raykao@users.noreply.github.com>
Copilot AI changed the title [WIP] Update documentation for MCP configuration Document MCP configuration and fix deprecated workflow flag Jan 31, 2026
Copilot AI requested a review from raykao January 31, 2026 21:18
@raykao raykao closed this Jan 31, 2026
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.

📚 Documentation needed for commit 593425b (MCP Configuration)

2 participants