Skip to content

feat(mcp): port dead github_actions server to Gitea-native gitea_actions #5

@nllptrx

Description

@nllptrx

Summary

The CI/CD introspection MCP server (github_actions / github_ci upstream) has been dead code in this fork since commit 47c9f3d (2026-02-15, "refactor: update MCP server configurations for GitHubContext"). That refactor simplified src/mcp/install-mcp-server.ts down to registering only gitea + local_git_ops servers and silently dropped the github_actions registration, but kept the server file and left mcp__github_actions__* entries in the allowlist at src/create-prompt/index.ts:68-70.

Net effect: when a user sets additional_permissions: actions: read, the allowlist gains tool names that have no backing MCP server. Claude is told the tools exist and fails at runtime when it calls them.

Additionally, even if we restored the upstream registration as-is, it wouldn't work on Gitea — deepwiki confirms the upstream uses mcp__github_ci__* hitting GitHub's Actions API endpoints, which are both path-different and shape-different from Gitea's.

Verified against live Gitea 1.24.6

Direct probes against the local E2E harness (gitea-e2e) against swagger + live responses:

Endpoints

GitHub API (Octokit) Gitea 1.24.6 Notes
GET /repos/{o}/{r}/actions/runs 404 Not present in 1.24.6. Use /actions/tasks instead.
GET /repos/{o}/{r}/actions/runs/{run}/jobs 404 No list-jobs endpoint in 1.24.6 REST API.
GET /repos/{o}/{r}/actions/jobs/{job_id} 404 No single-job detail endpoint in 1.24.6.
GET /repos/{o}/{r}/actions/jobs/{job_id}/logs ✅ works Same path, raw text body.
GET /repos/{o}/{r}/actions/tasks ✅ works Wrapper {workflow_runs, total_count}, returns ActionTask items.

(Deepwiki initially described /actions/runs and /actions/runs/{run}/jobs as present — those paths do exist in Gitea's main branch source but have not shipped in 1.24.6. Verified via live swagger + 404 responses.)

Response shape

Gitea's ActionTask differs from GitHub's ActionWorkflowRun:

  • namedisplay_title
  • created_atrun_started_at (also exposes both created_at + run_started_at)
  • No conclusion field — terminal state is in status (success | failure | cancelled | skipped)
  • No html_url — only url

Status/conclusion strings are a strict subset of GitHub's; the three we filter on (success, failure, completed) behave identically.

Permission model

Gitea does not expose a literal actions: read token scope. Read access to the Actions unit falls under AccessTokenScopeCategoryRepository (repo-read scope + Actions unit enabled on the repo). A probe-based check (/actions/tasks?limit=1) is the right way to verify — works on both Gitea and GitHub API since both honor the endpoint.

Proposal

Port to a Gitea-native server. GitHub fallback will be disabled — users needing GitHub parity should use upstream anthropics/claude-code-action.

  • New src/mcp/gitea-actions-server.ts: raw fetch (Octokit hardcodes GitHub paths), /actions/tasks + ActionTask parsing, 3 tools:
    • get_ci_status(status?) — list tasks filtered by PR head SHA, return pass/fail/pending summary
    • get_workflow_run_details(run_number) — group tasks by run_number client-side (approximates "jobs in a run" without step-level detail, which Gitea 1.24 does not expose)
    • download_job_log(job_id) — download /actions/jobs/{job_id}/logs to disk
  • src/mcp/install-mcp-server.ts: register gitea_actions conditionally when additional_permissions: actions: read is set on a PR context; probe /actions/tasks?limit=1 first; on github.com, skip registration with a warning
  • src/create-prompt/index.ts: rename allowlist entries from mcp__github_actions__*mcp__gitea_actions__*
  • Delete src/mcp/github-actions-server.ts (no longer referenced)
  • README: update tool name references, disclose Gitea-only scope

Acceptance

  • New server file registered conditionally (PR + additional_permissions + probe OK)
  • Skip + log warning on github.com rather than installing a broken server
  • All three tools work end-to-end against live Gitea 1.24.6 (drive via MCP client over stdio)
  • bun test passes; no residual github_actions references

Companion PR forthcoming.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions