Files
Athena-Deck/integrations/opencode-athena/GITEA-2026-10-14.md
T

5.9 KiB

Personal Gitea integration and project roots

Active setup

Unraid OpenCode 1.18.34 now has an additional local stdio MCP named gitea. It uses the official Gitea MCP v1.8.1 binary inside the existing container; no extra container, socket mount or public listener is needed. DuckDuckGo remains.

Server: https://git.casaderoll.de, account michael. The global AGENTS.md now includes gitea-project-rules.md: "my Git" means this server when no local project is named, search/list repositories through MCP first, and use durable checkouts rather than temporary clones for coding.

gitea-launch.py uses Git's configured credential helper in a captured subprocess and passes the password/token internally as GITEA_ACCESS_TOKEN to the official MCP. Neither the config nor command arguments contain credentials. The wrapper never prints helper output or exception details. Authentication and a real search for HORIZON both succeeded with the existing credential. Rotation of the previously exposed credential remains a separate user action; the integration does not revoke or rotate it. Updating the Git credential helper also supplies the credential to newly launched MCP processes; reconnect after rotation.

The MCP exposes 14 read tools for repository search, trees/files, branches, commits, issues and pull requests. It does not expose Actions secrets/configuration tools or write tools. Normal coding, commits and pushes still use Git in the actual local checkout. This MCP is not a global file-content search index; search_repos searches repositories. Do not infer unavailable code search from a guessed endpoint returning 404.

Correct local project

The collection /workspace contains an empty Git initialization with an ownership warning and no remote. It is not the user's Gitea server or the HORIZON checkout. Its metadata and ownership were not removed or altered.

Created a clean checkout at /workspace/HORIZON using a credential-free HTTPS clone URL and the existing Git credential helper. The directory is on the existing persistent workspace mount. Verified git rev-parse succeeds and status is clean. OpenCode's /project/current?directory=/workspace/HORIZON reports that exact worktree with vcs=git. The browser must open that folder as a project for its change view to correspond to HORIZON. A read-only inspection naturally has no diff.

The existing "Search Git for HORIZON" chat was not moved, restarted or rewritten. Its temporary clone was preserved; only its origin URL was sanitized to the clean HTTPS URL using git remote set-url, with no credential value read into outputs. No existing source files or uncommitted code were replaced.

Restore

  1. Restore the user's private OpenCode home/credential helper through protected backup, never Git. This repo contains no credential material.
  2. Install Python >=3.10 and Git in the OpenCode environment (Alpine packages python3/git; Debian python3/git). The preceding DuckDuckGo setup already installed Python 3.14.8 in the current container. An image recreation must retain or reinstall OS dependencies; a plain restart retains them.
  3. Download the official release archive into the user's persistent home: https://gitea.com/gitea/gitea-mcp/releases/download/v1.8.1/gitea-mcp_Linux_x86_64.tar.gz SHA256: 5ed5005e116a5c6e570893a2c6bb8fd034633b67bffd4145e2de1daa7b9fd761. Its checksum was compared with the upstream release checksum manifest. Extract to ~/.local/share/opencode/gitea-mcp/1.8.1/. For other architectures use the matching official artifact and verified hash.
  4. Install gitea-launch.py as ~/.config/opencode/mcp/gitea/launch.py (0755). The wrapper uses Path.home(), so native non-root users use their own credential helper and home. Merge gitea-mcp.json into the private config with the command path adjusted for that user's home. Preserve unrelated config.
  5. Append gitea-project-rules.md to global AGENTS.md, preserving other rules. Adjust the persistent project base /workspace if a native installation uses another checkout location. Open the actual checkout as the OpenCode project.

The binary, launcher, config and rules persist in the existing /root bind mount at /mnt/nvme-storage/appdata/OpenCode; local source checkouts persist in the existing /workspace mount. This is external OpenCode integration, not a new Deck runtime or a completed native Deck installer. Full restore onto a fresh host has not been performed.

Activation and validation

Saved global config on disk. Used the installed server's schema-confirmed POST /mcp to register this new server for /workspace without global disposal or container restart. It returned HTTP 200 with both duckduckgo and gitea connected. Direct stdio MCP tests initialized successfully, listed the selected tools, authenticated and found michael/HORIZON through search_repos. No new model call, coding chat or speculative web API probe was used for validation.

The initial hot registration applied only to the already open /workspace instance: the new HORIZON instance still saw cached pre-Gitea global config. After checking both known projects for active requests (none), updated only mcp through the schema-confirmed PATCH /global/config (HTTP 200). This reloads configuration and may discard transient instance state; no active task was interrupted, saved chats were not migrated or deleted, and no container was restarted.

The first identical on-disk patch did not invalidate the cache: upstream Config.updateGlobal invalidates only when file contents change. Set the launch command to the explicit /usr/bin/python3 interpreter through the official route, preserving the entire DuckDuckGo MCP entry. Do not rely on an HTTP 200 alone; verify live global config and both project-scoped MCP status endpoints.

References: