
GitHub Action Trigger
STDIOGitHub Actions integration MCP server for workflow management and automation
GitHub Actions integration MCP server for workflow management and automation
A Model Context Protocol server for GitHub Actions integration.
This is a TypeScript-based MCP server designed for GitHub Actions integration. It provides the following features:
get_github_actions
- Get available GitHub Actions for a repository
owner
(repository owner, username or organization) and repo
(repository name)token
(GitHub personal access token, for accessing private repositories or increasing API rate limits)get_github_action
- Get detailed information about a specific GitHub Action, including inputs and their requirements
owner
(Action owner, username or organization) and repo
(repository name of the action)path
: Path to the action definition file (default: 'action.yml')ref
: Git reference (branch, tag, or commit SHA, default: 'main')token
: GitHub personal access token (optional)trigger_github_action
- Trigger a GitHub workflow and pass relevant parameters
owner
: Repository owner (username or organization)repo
: Repository nameworkflow_id
: The ID or filename of the workflow to triggerref
: The git reference to trigger the workflow on (default: 'main')inputs
: Inputs to pass to the workflow (must match the workflow's defined inputs)token
: GitHub personal access token (must have the workflow scope)get_github_release
- Get the latest 2 releases from a GitHub repository
owner
(repository owner, username or organization) and repo
(repository name)token
(GitHub personal access token, optional)enable_pull_request_automerge
- Enable auto-merge for a specific pull request
owner
: Repository owner (username or organization)repo
: Repository namepull_number
: The pull request numbermerge_method
: The merge method to use (MERGE, SQUASH, or REBASE, default: MERGE)token
: GitHub personal access token (optional)The simplest way to install and use is via the npx
command in your Claude Desktop configuration file without manual local installation:
{ "mcpServers": { "github-action-trigger-mcp": { "command": "npx", "args": [ "-y", "@nextdrive/github-action-trigger-mcp" ], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "your_github_token_here" } } } }
Benefits of this method:
If you prefer to install manually, follow these steps:
npm install -g @nextdrive/github-action-trigger-mcp
On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
{ "mcpServers": { "github-action-trigger-mcp": { "command": "@nextdrive/github-action-trigger-mcp", "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "your_github_token_here" } } } }
To access the GitHub API, especially for private repositories or workflow triggers, you need to configure a GitHub personal access token. There are several ways to do this:
Set the token directly in the Claude Desktop configuration file via the env
field:
"env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "your_github_token_here" }
Set the GITHUB_TOKEN
environment variable:
# On Linux/MacOS export GITHUB_TOKEN=your_github_token # On Windows set GITHUB_TOKEN=your_github_token
Edit the configuration file:
~/.nextdrive-github-action-trigger-mcp/config.json
Set your GitHub token:
{ "githubToken": "your_github_token" }
A template for this configuration file is automatically created the first time the server starts.
Install dependencies:
npm install
Build the server:
npm run build
For automatic rebuilding during development:
npm run watch
Use MCP Inspector for debugging:
npm run inspector
The Inspector will provide a URL to access the debugging tools in your browser.
If you want to publish this package to npm, follow these steps:
Make sure you're logged in to npm and have permissions to publish to the @nextdrive
organization:
npm login
Build the project:
npm run build
Publish to npm (organization-scoped packages are private by default, use --access public
to make it public):
npm publish --access public
After publishing, anyone can run this tool using the npx @nextdrive/github-action-trigger-mcp
command or use it in their Claude Desktop configuration.
Use the get_github_actions
tool to get GitHub Actions for a repository:
{ "owner": "username-or-org", "repo": "repository-name" }
If a default token is configured, it will be used automatically when accessing private repositories.
Example response:
[ { "id": 12345678, "name": "CI", "path": ".github/workflows/ci.yml", "state": "active", "url": "https://github.com/owner/repo/actions/workflows/ci.yml", "content": "name: CI\n\non:\n push:\n branches: [ main ]\n pull_request:\n branches: [ main ]\n\njobs:\n build:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v2\n - name: Setup Node.js\n uses: actions/setup-node@v2\n with:\n node-version: 16.x\n - name: Install dependencies\n run: npm ci\n - name: Build\n run: npm run build\n - name: Test\n run: npm test\n" } ]
Use the get_github_action
tool to get detailed information about a specific Action:
{ "owner": "actions", "repo": "checkout", "ref": "v4" }
Example response:
{ "name": "Checkout", "description": "Check out a Git repository at a particular version", "author": "GitHub", "inputs": [ { "name": "repository", "description": "Repository name with owner. For example, actions/checkout", "default": "", "required": false }, { "name": "ref", "description": "The branch, tag or SHA to checkout.", "default": "", "required": false } ], "runs": { "using": "node20", "main": "dist/index.js" } }
Use the trigger_github_action
tool to trigger a GitHub workflow:
{ "owner": "username-or-org", "repo": "repository-name", "workflow_id": "ci.yml", "inputs": { "deploy_environment": "production", "debug_enabled": "true" } }
Example response:
{ "success": true, "message": "Workflow dispatch event triggered successfully", "run": { "id": 12345678, "url": "https://github.com/owner/repo/actions/runs/12345678", "status": "queued", "conclusion": null, "created_at": "2025-03-19T06:45:12Z", "triggered_by": "API" } }
Note: Triggering workflows requires:
workflow_dispatch
eventworkflow
scope permissionUse the get_github_release
tool to get the latest 2 releases from a repository:
{ "owner": "username-or-org", "repo": "repository-name" }
Example response:
{ "count": 2, "releases": [ { "id": 12345678, "name": "v1.0.0", "tag_name": "v1.0.0", "published_at": "2025-03-15T10:00:00Z", "draft": false, "prerelease": false, "html_url": "https://github.com/owner/repo/releases/tag/v1.0.0", "body": "Release notes for version 1.0.0", "assets": [ { "name": "app-v1.0.0.zip", "size": 1234567, "download_count": 42, "browser_download_url": "https://github.com/owner/repo/releases/download/v1.0.0/app-v1.0.0.zip", "created_at": "2025-03-15T10:05:00Z", "updated_at": "2025-03-15T10:05:00Z" } ], "author": { "login": "username", "html_url": "https://github.com/username" } }, { "id": 87654321, "name": "v0.9.0", "tag_name": "v0.9.0", "published_at": "2025-03-01T10:00:00Z", "draft": false, "prerelease": true, "html_url": "https://github.com/owner/repo/releases/tag/v0.9.0", "body": "Pre-release notes for version 0.9.0", "assets": [], "author": { "login": "username", "html_url": "https://github.com/username" } } ] }
Use the enable_pull_request_automerge
tool to enable auto-merge for a specific pull request:
{ "owner": "username-or-org", "repo": "repository-name", "pull_number": 123, "merge_method": "SQUASH" }
Example response:
{ "success": true, "message": "Auto-merge enabled successfully", "pullRequest": { "id": "PR_kwDOABCD123_456", "title": "Add new feature", "number": 123, "autoMergeEnabled": true, "enabledAt": "2025-08-21T03:00:00Z", "mergeMethod": "SQUASH" } }
Note: Enabling auto-merge requires: