fix: 🔧 untrack machine-specific .mcp.json, ship portable template #264

Open
synath wants to merge 1 commit from synath/fix/untrack-local-mcp-json into main
synath commented 2026-06-21 22:45:07 +00:00 (Migrated from codeberg.org)

Problem

.mcp.json is listed in .gitignore (line 47) but is still tracked in the repo. The two never reconcile, so a developer-specific config keeps shipping to everyone and overwrites local copies on git pull.

The committed copy also doesn't work on anyone else's machine:

  • codeberg hardcodes /home/goern/go/bin/forgejo-mcp — an absolute path under a specific home directory.
  • codeberg-devel uses a relative ./forgejo-mcp that only resolves when the launcher's working directory is the repo root (notably breaks across git worktrees).

Fix

  • git rm --cached .mcp.json — stop tracking it, which is what the existing .gitignore entry already intends. Each developer keeps their own local copy.
  • Add .mcp.json.example as the portable reference:
    • codeberg → PATH-resolved forgejo-mcp instead of a hardcoded home dir (works for anyone who has it installed, including a ~/go/bin on PATH).
    • codeberg-devel${FORGEJO_MCP_BIN:-./forgejo-mcp} so a locally built binary can be referenced by absolute path from any directory/worktree, defaulting to the in-repo build.
    • Token passed via the FORGEJO_ACCESS_TOKEN environment variable rather than a --token argument, so it never appears in process listings (the binary already prefers this env var — cmd/cmd.go).
  • Document the copy-and-customize flow in DEVELOPER.md.

Notes

No code changes — config and docs only. Existing checkouts that already have a tracked .mcp.json keep their working copy after pulling this (the file is untracked, not deleted).

🤖 Generated with Claude Code

## Problem `.mcp.json` is listed in `.gitignore` (line 47) but is still tracked in the repo. The two never reconcile, so a developer-specific config keeps shipping to everyone and overwrites local copies on `git pull`. The committed copy also doesn't work on anyone else's machine: - `codeberg` hardcodes `/home/goern/go/bin/forgejo-mcp` — an absolute path under a specific home directory. - `codeberg-devel` uses a relative `./forgejo-mcp` that only resolves when the launcher's working directory is the repo root (notably breaks across git worktrees). ## Fix - `git rm --cached .mcp.json` — stop tracking it, which is what the existing `.gitignore` entry already intends. Each developer keeps their own local copy. - Add `.mcp.json.example` as the portable reference: - `codeberg` → PATH-resolved `forgejo-mcp` instead of a hardcoded home dir (works for anyone who has it installed, including a `~/go/bin` on PATH). - `codeberg-devel` → `${FORGEJO_MCP_BIN:-./forgejo-mcp}` so a locally built binary can be referenced by absolute path from any directory/worktree, defaulting to the in-repo build. - Token passed via the `FORGEJO_ACCESS_TOKEN` environment variable rather than a `--token` argument, so it never appears in process listings (the binary already prefers this env var — `cmd/cmd.go`). - Document the copy-and-customize flow in `DEVELOPER.md`. ## Notes No code changes — config and docs only. Existing checkouts that already have a tracked `.mcp.json` keep their working copy after pulling this (the file is untracked, not deleted). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
op1st-gitops commented 2026-06-21 22:45:19 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code is skipping this commit.
User synath is not allowed to trigger CI via pull_request in this repo.

op1st Pipelines as Code is skipping this commit. User synath is not allowed to trigger CI via pull_request in this repo.
goern commented 2026-06-22 06:25:26 +00:00 (Migrated from codeberg.org)

/ok-to-test

/ok-to-test
op1st-gitops commented 2026-06-22 06:25:33 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-code-scans-zlzp9 is running.

Starting Pipelinerun forgejo-mcp-code-scans-zlzp9 in namespace op1st-pipelines

You can monitor the execution using the op1st Pipelines as Code PipelineRun viewer or through the command line by
using the tkn CLI with the following command:

tkn pr logs -n op1st-pipelines forgejo-mcp-code-scans-zlzp9 -f

op1st Pipelines as Code/forgejo-mcp-code-scans-zlzp9 is running. Starting Pipelinerun <b>[forgejo-mcp-code-scans-zlzp9](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-zlzp9)</b> in namespace <b>op1st-pipelines</b> You can monitor the execution using the [op1st Pipelines as Code](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-zlzp9) PipelineRun viewer or through the command line by using the [tkn](https://tekton.dev/docs/cli/#installation) CLI with the following command: <code>tkn pr logs -n op1st-pipelines forgejo-mcp-code-scans-zlzp9 -f</code>
op1st-gitops commented 2026-06-22 06:25:33 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-on-pull-request-m5dbd is running.

Starting Pipelinerun forgejo-mcp-on-pull-request-m5dbd in namespace op1st-pipelines

You can monitor the execution using the op1st Pipelines as Code PipelineRun viewer or through the command line by
using the tkn CLI with the following command:

tkn pr logs -n op1st-pipelines forgejo-mcp-on-pull-request-m5dbd -f

op1st Pipelines as Code/forgejo-mcp-on-pull-request-m5dbd is running. Starting Pipelinerun <b>[forgejo-mcp-on-pull-request-m5dbd](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-m5dbd)</b> in namespace <b>op1st-pipelines</b> You can monitor the execution using the [op1st Pipelines as Code](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-m5dbd) PipelineRun viewer or through the command line by using the [tkn](https://tekton.dev/docs/cli/#installation) CLI with the following command: <code>tkn pr logs -n op1st-pipelines forgejo-mcp-on-pull-request-m5dbd -f</code>
op1st-gitops commented 2026-06-22 06:26:03 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-code-scans-zlzp9 has successfully validated your commit.


Task Statuses:

StatusDurationName
Succeeded 14 seconds

fetch-source

Succeeded 9 seconds

gitleaks-version

Succeeded 14 seconds

gitleaks

op1st Pipelines as Code/forgejo-mcp-code-scans-zlzp9 has <b>successfully</b> validated your commit. <ul> <li><b>Namespace</b>: <a href="https://detailurl.setting.custom-console-url-namespace.is.not.configured">op1st-pipelines</a></li> <li><b>PipelineRun:</b> <a href="https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-zlzp9">forgejo-mcp-code-scans-zlzp9</a></li> </ul> <hr> <h4>Task Statuses:</h4> <table> <tr><th>Status</th><th>Duration</th><th>Name</th></tr> <tr> <td>Succeeded</td> <td>14 seconds</td><td> [fetch-source](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-zlzp9/logs/fetch-source) </td></tr> <tr> <td>Succeeded</td> <td>9 seconds</td><td> [gitleaks-version](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-zlzp9/logs/gitleaks-version) </td></tr> <tr> <td>Succeeded</td> <td>14 seconds</td><td> [gitleaks](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-zlzp9/logs/gitleaks) </td></tr> </table>
op1st-gitops commented 2026-06-22 06:26:55 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-on-pull-request-m5dbd has failed.


Task Statuses:

StatusDurationName
Succeeded 16 seconds

fetch-source

Failed 1 minute

build-and-test

Succeeded 32 seconds

commit-title-check


Failure snippet:

task build-and-test has the status "Failed":
Files not gofmt'd:
operation/hook/hook.go
op1st Pipelines as Code/forgejo-mcp-on-pull-request-m5dbd has <b>failed</b>. <ul> <li><b>Namespace</b>: <a href="https://detailurl.setting.custom-console-url-namespace.is.not.configured">op1st-pipelines</a></li> <li><b>PipelineRun:</b> <a href="https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-m5dbd">forgejo-mcp-on-pull-request-m5dbd</a></li> </ul> <hr> <h4>Task Statuses:</h4> <table> <tr><th>Status</th><th>Duration</th><th>Name</th></tr> <tr> <td>Succeeded</td> <td>16 seconds</td><td> [fetch-source](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-m5dbd/logs/fetch-source) </td></tr> <tr> <td>Failed</td> <td>1 minute</td><td> [build-and-test](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-m5dbd/logs/build-and-test) </td></tr> <tr> <td>Succeeded</td> <td>32 seconds</td><td> [commit-title-check](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-m5dbd/logs/commit-title-check) </td></tr> </table> <hr> <h4>Failure snippet:</h4> task <b>build-and-test</b> has the status <b>"Failed"</b>: <pre>Files not gofmt'd: operation/hook/hook.go</pre>
goern commented 2026-06-22 06:30:48 +00:00 (Migrated from codeberg.org)

/triage

/triage
op1st-gitops commented 2026-07-18 17:23:30 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-code-scans-bfcjg is running.

Starting Pipelinerun forgejo-mcp-code-scans-bfcjg in namespace op1st-pipelines

You can monitor the execution using the op1st Pipelines as Code PipelineRun viewer or through the command line by
using the tkn CLI with the following command:

tkn pr logs -n op1st-pipelines forgejo-mcp-code-scans-bfcjg -f

op1st Pipelines as Code/forgejo-mcp-code-scans-bfcjg is running. Starting Pipelinerun <b>[forgejo-mcp-code-scans-bfcjg](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-bfcjg)</b> in namespace <b>op1st-pipelines</b> You can monitor the execution using the [op1st Pipelines as Code](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-bfcjg) PipelineRun viewer or through the command line by using the [tkn](https://tekton.dev/docs/cli/#installation) CLI with the following command: <code>tkn pr logs -n op1st-pipelines forgejo-mcp-code-scans-bfcjg -f</code>
op1st-gitops commented 2026-07-18 17:23:30 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-on-pull-request-ldhs6 is running.

Starting Pipelinerun forgejo-mcp-on-pull-request-ldhs6 in namespace op1st-pipelines

You can monitor the execution using the op1st Pipelines as Code PipelineRun viewer or through the command line by
using the tkn CLI with the following command:

tkn pr logs -n op1st-pipelines forgejo-mcp-on-pull-request-ldhs6 -f

op1st Pipelines as Code/forgejo-mcp-on-pull-request-ldhs6 is running. Starting Pipelinerun <b>[forgejo-mcp-on-pull-request-ldhs6](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-ldhs6)</b> in namespace <b>op1st-pipelines</b> You can monitor the execution using the [op1st Pipelines as Code](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-ldhs6) PipelineRun viewer or through the command line by using the [tkn](https://tekton.dev/docs/cli/#installation) CLI with the following command: <code>tkn pr logs -n op1st-pipelines forgejo-mcp-on-pull-request-ldhs6 -f</code>
op1st-gitops commented 2026-07-18 17:23:53 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-code-scans-bfcjg has successfully validated your commit.


Task Statuses:

StatusDurationName
Succeeded 12 seconds

fetch-source

Succeeded 9 seconds

gitleaks-version

Succeeded 10 seconds

gitleaks

op1st Pipelines as Code/forgejo-mcp-code-scans-bfcjg has <b>successfully</b> validated your commit. <ul> <li><b>Namespace</b>: <a href="https://detailurl.setting.custom-console-url-namespace.is.not.configured">op1st-pipelines</a></li> <li><b>PipelineRun:</b> <a href="https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-bfcjg">forgejo-mcp-code-scans-bfcjg</a></li> </ul> <hr> <h4>Task Statuses:</h4> <table> <tr><th>Status</th><th>Duration</th><th>Name</th></tr> <tr> <td>Succeeded</td> <td>12 seconds</td><td> [fetch-source](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-bfcjg/logs/fetch-source) </td></tr> <tr> <td>Succeeded</td> <td>9 seconds</td><td> [gitleaks-version](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-bfcjg/logs/gitleaks-version) </td></tr> <tr> <td>Succeeded</td> <td>10 seconds</td><td> [gitleaks](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-bfcjg/logs/gitleaks) </td></tr> </table>
synath-bot commented 2026-07-18 17:25:41 +00:00 (Migrated from codeberg.org)

Investigated the June CI failure: the build-and-test task failed at its gofmt-check step because operation/hook/hook.go was unformatted on the base branch at the time (misaligned const block from the then-new webhook tools) — not something this PR introduced. It was since fixed on main in 16f807c, so the failure no longer reproduces.

The branch has now been rebased onto current main (head 5af6226, same single commit); build, vet, mod-tidy, gofmt, and race tests all pass locally on it. Could you /ok-to-test again?

(Posted by synath's Claude agent on David's behalf — the investigation and rebase were agent work.)

Investigated the June CI failure: the `build-and-test` task failed at its **gofmt-check** step because `operation/hook/hook.go` was unformatted **on the base branch at the time** (misaligned const block from the then-new webhook tools) — not something this PR introduced. It was since fixed on main in 16f807c, so the failure no longer reproduces. The branch has now been rebased onto current main (head `5af6226`, same single commit); build, vet, mod-tidy, gofmt, and race tests all pass locally on it. Could you `/ok-to-test` again? *(Posted by synath's Claude agent on David's behalf — the investigation and rebase were agent work.)*
op1st-gitops commented 2026-07-18 17:25:47 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-on-pull-request-ldhs6 has successfully validated your commit.


Task Statuses:

StatusDurationName
Succeeded 14 seconds

fetch-source

Succeeded 2 minutes

build-and-test

Succeeded 16 seconds

commit-title-check

op1st Pipelines as Code/forgejo-mcp-on-pull-request-ldhs6 has <b>successfully</b> validated your commit. <ul> <li><b>Namespace</b>: <a href="https://detailurl.setting.custom-console-url-namespace.is.not.configured">op1st-pipelines</a></li> <li><b>PipelineRun:</b> <a href="https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-ldhs6">forgejo-mcp-on-pull-request-ldhs6</a></li> </ul> <hr> <h4>Task Statuses:</h4> <table> <tr><th>Status</th><th>Duration</th><th>Name</th></tr> <tr> <td>Succeeded</td> <td>14 seconds</td><td> [fetch-source](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-ldhs6/logs/fetch-source) </td></tr> <tr> <td>Succeeded</td> <td>2 minutes</td><td> [build-and-test](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-ldhs6/logs/build-and-test) </td></tr> <tr> <td>Succeeded</td> <td>16 seconds</td><td> [commit-title-check](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-on-pull-request-ldhs6/logs/commit-title-check) </td></tr> </table>
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin synath/fix/untrack-local-mcp-json:synath/fix/untrack-local-mcp-json
git switch synath/fix/untrack-local-mcp-json

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff synath/fix/untrack-local-mcp-json
git switch synath/fix/untrack-local-mcp-json
git rebase main
git switch main
git merge --ff-only synath/fix/untrack-local-mcp-json
git switch synath/fix/untrack-local-mcp-json
git rebase main
git switch main
git merge --no-ff synath/fix/untrack-local-mcp-json
git switch main
git merge --squash synath/fix/untrack-local-mcp-json
git switch main
git merge --ff-only synath/fix/untrack-local-mcp-json
git switch main
git merge synath/fix/untrack-local-mcp-json
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
agentic-forges/forgejo-mcp!264
No description provided.