Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

GitHub MCP Test

A test repository for OpenCode's GitHub MCP (Model Context Protocol) integration. This project demonstrates how to use OpenCode as a GitHub Actions bot to assist with issues and pull requests directly from GitHub comments.

Repository Structure

github-test/
├── .github/
│   └── workflows/
│       └── opencode.yml    # GitHub Actions workflow for OpenCode
└── README.md               # This file

Prerequisites

  • A GitHub repository
  • An OpenCode API key (obtain from OpenCode)
  • GitHub Actions enabled on your repository

Setup

  1. Add the workflow file

    Copy .github/workflows/opencode.yml to your repository.

  2. Configure the API key

    • Go to your repository Settings → Secrets and variables → Actions
    • Click "New repository secret"
    • Name: OPENCODE_API_KEY
    • Value: Your OpenCode API key
  3. Grant permissions

    Ensure the workflow has the following permissions:

    • id-token: write
    • contents: read
    • pull-requests: read
    • issues: read

Usage

Trigger OpenCode by commenting on any issue or pull request with:

Command Description
/oc Short trigger command
/opencode Full trigger command

Examples

On an issue:

/oc explain what this issue is about

On a pull request:

/opencode review this pull request for potential bugs

With additional context:

/oc summarize the discussion in this thread

Troubleshooting

Issue Solution
Workflow doesn't trigger Ensure comment starts with or contains /oc or /opencode
Authentication error Verify OPENCODE_API_KEY secret is configured correctly
Permission denied Check repository Settings → Actions → General → Workflow permissions
Action fails to run Confirm GitHub Actions is enabled in repository Settings → Actions

Roadmap

  • Add support for custom commands
  • Implement response formatting options
  • Add label-based filtering
  • Support for draft pull requests
  • Multi-language support
  • Configuration file for custom triggers

License

See LICENSE for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors