test(server): unit-test MCP server + tool allowlist assembly (#273 follow-up) #288

Merged
charles merged 1 commit from test/s11-mcp-config into main 2026-04-23 23:08:46 +00:00
Collaborator

PR #273 s11 extraction follow-up. Covers mcp-config.ts.

Coverage (11 tests across 2 describe blocks)

buildMcpSetup — stdio MCP spec assembly (6)

  • Non-penpot agent
  • penpot_mcp=true with env
  • penpot_mcp=true without env (#62 regression)
  • penpot_mcp=false with env present (config-flag-decides matrix fill — new)
  • Forgejo stdio args/command/token threading
  • Base allowedTools stability

FORGEJO_TOOLS_ALLOWLIST + env/SDK lockstep (5)

  • Minimum-surface RPC coverage (skills/ + webhooks)
  • FORGEJO_MCP_TOOLS comma-joined + whitespace-free
  • Per-tool mcp__forgejo__<name> env/SDK lockstep
  • No mcp__forgejo__* wildcard
  • Cross-feature guard that enabling Penpot doesn't collapse the forgejo per-tool list into a wildcard (new)

Sibling-file cleanup

Removed a duplicated buildMcpSetup describe block from agent-runner.test.ts (+ unused import); left a breadcrumb comment pointing at the new location.

Checks

  • bunx tsc --noEmit -p apps/server/tsconfig.json — EXIT=0
  • bun test apps/server/src/domain/agent/mcp-config.test.ts — 11/11 pass
  • bun test apps/server/src/domain/agent/{agent-runner,mcp-config}.test.ts — 57 pass / 0 fail (sanity check that the move didn't lose coverage)
  • Full suite: +2 net tests (moved 9, added 11), no regressions
PR #273 s11 extraction follow-up. Covers `mcp-config.ts`. ## Coverage (11 tests across 2 describe blocks) ### `buildMcpSetup — stdio MCP spec assembly` (6) - Non-penpot agent - penpot_mcp=true with env - penpot_mcp=true without env (#62 regression) - penpot_mcp=false with env present (config-flag-decides matrix fill — new) - Forgejo stdio args/command/token threading - Base `allowedTools` stability ### `FORGEJO_TOOLS_ALLOWLIST + env/SDK lockstep` (5) - Minimum-surface RPC coverage (skills/ + webhooks) - `FORGEJO_MCP_TOOLS` comma-joined + whitespace-free - Per-tool `mcp__forgejo__<name>` env/SDK lockstep - No `mcp__forgejo__*` wildcard - Cross-feature guard that enabling Penpot doesn't collapse the forgejo per-tool list into a wildcard (new) ## Sibling-file cleanup Removed a duplicated `buildMcpSetup` describe block from `agent-runner.test.ts` (+ unused import); left a breadcrumb comment pointing at the new location. ## Checks - `bunx tsc --noEmit -p apps/server/tsconfig.json` — EXIT=0 - `bun test apps/server/src/domain/agent/mcp-config.test.ts` — 11/11 pass - `bun test apps/server/src/domain/agent/{agent-runner,mcp-config}.test.ts` — 57 pass / 0 fail (sanity check that the move didn't lose coverage) - Full suite: +2 net tests (moved 9, added 11), no regressions
test(server): unit-test MCP server + tool allowlist assembly (#273 follow-up)
All checks were successful
qa / qa (pull_request) Successful in 4m11s
qa / dockerfile (pull_request) Successful in 7s
3544b2f56b
Move buildMcpSetup + FORGEJO_TOOLS_ALLOWLIST coverage out of agent-runner.test.ts
into a dedicated mcp-config.test.ts alongside the extracted module from s11.
Adds one fresh case (penpot_mcp=false with env loaded) and a cross-feature guard
that Penpot registration does not collapse the per-tool forgejo allowlist into
the mcp__forgejo__* wildcard.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
charles deleted branch test/s11-mcp-config 2026-04-23 23:08:47 +00:00
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
charles/claude-hooks!288
No description provided.