Clarify token requirements for MCP integration

Updated authentication section to clarify token usage for MCP integration.
This commit is contained in:
Sevil
2025-10-25 22:53:45 +02:00
committed by GitHub
parent 83bb5ca3e8
commit e0da58c63f
+12 -5
View File
@@ -162,8 +162,15 @@ This action now supports **read-only** integration with the GitHub-hosted Model
Context Protocol (MCP) server, which provides access to GitHub tools like Context Protocol (MCP) server, which provides access to GitHub tools like
repository management, issue tracking, and pull request operations. repository management, issue tracking, and pull request operations.
> [!NOTE] ### Authentication
> The GitHub MCP integration requires a Personal Access Token (PAT) and cannot use the built-in `GITHUB_TOKEN`. You can authenticate the MCP server with **either**:
1. **Personal Access Token (PAT)** user-scoped token
2. **GitHub App Installation Token** (`ghs_…`) short-lived, app-scoped token
> The built-in `GITHUB_TOKEN` is **not** accepted by the MCP server.
Using a **GitHub App installation token** is recommended in most CI environments because it is short-lived and least-privilege by design.
### Enabling MCP in the action
Set `enable-github-mcp: true` and provide a token via `github-mcp-token`.
```yaml ```yaml
steps: steps:
@@ -173,7 +180,7 @@ steps:
with: with:
prompt: 'List my open pull requests and create a summary' prompt: 'List my open pull requests and create a summary'
enable-github-mcp: true enable-github-mcp: true
token: ${{ secrets.USER_PAT }} token: ${{ secrets.USER_PAT }} # or a ghs_ installation token
``` ```
If you want, you can use separate tokens for the AI inference endpoint If you want, you can use separate tokens for the AI inference endpoint
@@ -188,7 +195,7 @@ steps:
prompt: 'List my open pull requests and create a summary' prompt: 'List my open pull requests and create a summary'
enable-github-mcp: true enable-github-mcp: true
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
github-mcp-token: ${{ secrets.USER_PAT }} github-mcp-token: ${{ secrets.USER_PAT }} # or a ghs_ installation token
``` ```
When MCP is enabled, the AI model will have access to GitHub tools and can When MCP is enabled, the AI model will have access to GitHub tools and can
@@ -212,7 +219,7 @@ the action:
| `endpoint` | The endpoint to use for inference. If you're running this as part of an org, you should probably use the org-specific Models endpoint | `https://models.github.ai/inference` | | `endpoint` | The endpoint to use for inference. If you're running this as part of an org, you should probably use the org-specific Models endpoint | `https://models.github.ai/inference` |
| `max-tokens` | The max number of tokens to generate | 200 | | `max-tokens` | The max number of tokens to generate | 200 |
| `enable-github-mcp` | Enable Model Context Protocol integration with GitHub tools | `false` | | `enable-github-mcp` | Enable Model Context Protocol integration with GitHub tools | `false` |
| `github-mcp-token` | Token to use for GitHub MCP server (defaults to the main token if not specified). This must be a PAT for MCP to work | `""` | | `github-mcp-token` | Token to use for GitHub MCP server (defaults to the main token if not specified). | `""` |
## Outputs ## Outputs