MF-5: Forge-neutral MCP namespace (mcp__forge__*) #296

Closed
opened 2026-04-23 23:33:14 +00:00 by code-lead · 0 comments
Collaborator

As a skill/agent author, I want a single forge-neutral MCP namespace (mcp__forge__*) so that the same skill runs unchanged against any configured forge — the agent never has to know whether the repo lives on Forgejo, GitHub, or GitLab.

Acceptance criteria

Decision (documented inline)

  • Choose option (a): one forge-neutral MCP server backed by the ForgePort adapter bound to the agent's repo. Not per-forge MCPs.
  • Rationale captured in the package README: one surface to maintain, adapters already exist, no duplicated upstream MCP deps.

New MCP package

  • New workspace package: packages/forge-mcp/.
  • Exposes stdio MCP implementing the forge-neutral tool set:
    • forge__create_issue
    • forge__get_issue_by_index
    • forge__list_repo_issues
    • forge__add_issue_labels
    • forge__remove_issue_labels
    • forge__update_issue
    • forge__create_issue_comment
    • forge__list_issue_comments
    • forge__create_pull_request
    • forge__get_pull_request_by_index
    • forge__list_repo_pull_requests
    • forge__list_pull_request_files
    • forge__create_pull_review
    • forge__create_review_requests
    • forge__delete_review_requests
    • forge__submit_pull_review
    • forge__list_pull_reviews
    • forge__list_pull_review_comments
    • forge__get_pull_review
    • forge__merge_pull_request
    • forge__get_file_content
    • forge__get_workflow_run
    • forge__list_workflow_runs
    • forge__list_repo_labels
    • (1:1 with the ForgePort surface used by today's skills.)
  • Internal resolution: FORGE_TYPE env (forgejo|github|gitlab) + per-forge token file path select the adapter at MCP startup.

Container wiring

  • Agent containers mount packages/forge-mcp in place of (or, during the transition window, alongside) forgejo-mcp.
  • Container-reconcile and the env-sync watchdog both know about the new MCP binary path.

Skill migration

  • All repo-owned skills updated to the forge__* tool names: breakdown, design-implement, review, implement, security-review, revise-claude-md.
  • Tool-schema allowlists in .claude/settings.json (or equivalent) include the new namespace.

Transitional alias

  • forgejo-mcp stays installed for one release so any unmigrated skill keeps working.
  • When the old namespace is called, log a deprecation warning once per session (rate-limited).

Tests

  • forge-mcp.test.ts: each tool call maps to the correct ForgePort method with the env-selected adapter (Forgejo/GitHub via stub).
  • Skill smoke test: breakdown runs end-to-end against a fake GitHub ForgePort.
  • Deprecation warning fires exactly once for a call to mcp__forgejo__create_issue.

Out of scope

  • Deprecating mcp__forgejo__*-named skills that live outside this repo — other owners migrate on their own timeline.
  • Penpot / Context7 / other MCPs — unrelated, untouched.
  • Adding new capabilities to the port beyond what today's skills use.

References

  • Spec: specs/multi-forge.md § MF-5.
  • packages/shared/ — cross-app types.
  • Existing skills that call mcp__forgejo__* (grep the skills/ tree).
  • Open decision captured in the spec: rename vs alias — this story lands on rename.

Dependencies

  • Blocks on MF-4 (adapter factory) — the MCP resolves the adapter via the factory at startup.
  • Blocks on MF-1 (at least one non-Forgejo adapter). Server-side MCP code can begin earlier, but end-to-end skill migration requires a second adapter live.
  • Depends on #295 (MF-4)
  • Depends on #292 (MF-1)
As a skill/agent author, I want a single forge-neutral MCP namespace (`mcp__forge__*`) so that the same skill runs unchanged against any configured forge — the agent never has to know whether the repo lives on Forgejo, GitHub, or GitLab. ## Acceptance criteria ### Decision (documented inline) - [ ] Choose option **(a)**: one forge-neutral MCP server backed by the `ForgePort` adapter bound to the agent's repo. Not per-forge MCPs. - [ ] Rationale captured in the package README: one surface to maintain, adapters already exist, no duplicated upstream MCP deps. ### New MCP package - [ ] New workspace package: `packages/forge-mcp/`. - [ ] Exposes stdio MCP implementing the forge-neutral tool set: - `forge__create_issue` - `forge__get_issue_by_index` - `forge__list_repo_issues` - `forge__add_issue_labels` - `forge__remove_issue_labels` - `forge__update_issue` - `forge__create_issue_comment` - `forge__list_issue_comments` - `forge__create_pull_request` - `forge__get_pull_request_by_index` - `forge__list_repo_pull_requests` - `forge__list_pull_request_files` - `forge__create_pull_review` - `forge__create_review_requests` - `forge__delete_review_requests` - `forge__submit_pull_review` - `forge__list_pull_reviews` - `forge__list_pull_review_comments` - `forge__get_pull_review` - `forge__merge_pull_request` - `forge__get_file_content` - `forge__get_workflow_run` - `forge__list_workflow_runs` - `forge__list_repo_labels` - (1:1 with the `ForgePort` surface used by today's skills.) - [ ] Internal resolution: `FORGE_TYPE` env (`forgejo|github|gitlab`) + per-forge token file path select the adapter at MCP startup. ### Container wiring - [ ] Agent containers mount `packages/forge-mcp` in place of (or, during the transition window, alongside) `forgejo-mcp`. - [ ] Container-reconcile and the env-sync watchdog both know about the new MCP binary path. ### Skill migration - [ ] All repo-owned skills updated to the `forge__*` tool names: `breakdown`, `design-implement`, `review`, `implement`, `security-review`, `revise-claude-md`. - [ ] Tool-schema allowlists in `.claude/settings.json` (or equivalent) include the new namespace. ### Transitional alias - [ ] `forgejo-mcp` stays installed for one release so any unmigrated skill keeps working. - [ ] When the old namespace is called, log a deprecation warning once per session (rate-limited). ### Tests - [ ] `forge-mcp.test.ts`: each tool call maps to the correct `ForgePort` method with the env-selected adapter (Forgejo/GitHub via stub). - [ ] Skill smoke test: `breakdown` runs end-to-end against a fake GitHub `ForgePort`. - [ ] Deprecation warning fires exactly once for a call to `mcp__forgejo__create_issue`. ## Out of scope - Deprecating `mcp__forgejo__*`-named skills that live outside this repo — other owners migrate on their own timeline. - Penpot / Context7 / other MCPs — unrelated, untouched. - Adding new capabilities to the port beyond what today's skills use. ## References - Spec: [`specs/multi-forge.md`](../src/branch/main/specs/multi-forge.md) § MF-5. - `packages/shared/` — cross-app types. - Existing skills that call `mcp__forgejo__*` (grep the `skills/` tree). - Open decision captured in the spec: rename vs alias — this story lands on rename. ## Dependencies - **Blocks on MF-4** (adapter factory) — the MCP resolves the adapter via the factory at startup. - **Blocks on MF-1** (at least one non-Forgejo adapter). Server-side MCP code can begin earlier, but end-to-end skill migration requires a second adapter live. <!-- machine-parseable deps for the deps.ts body fallback; native POST /dependencies is currently returning HTTP 404 on this Forgejo. --> - Depends on #295 (MF-4) - Depends on #292 (MF-1)
Sign in to join this conversation.
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
charles/claude-hooks#296
No description provided.