Skip to content

feat(scripts): register CSA MCP server with Claude Code#21

Open
kurtseifried wants to merge 1 commit into
mainfrom
feat/csa-mcp-server-registration
Open

feat(scripts): register CSA MCP server with Claude Code#21
kurtseifried wants to merge 1 commit into
mainfrom
feat/csa-mcp-server-registration

Conversation

@kurtseifried
Copy link
Copy Markdown
Contributor

Summary

Adds CSA MCP server (`csa-mcp` → https://cloudsecurityalliance.org/mcp) registration to the five scripts that share the plugin-marketplace contract.

  • Where: `macos-ai-tools.sh`, `windows-ai-tools.ps1`, `macos-update.sh`, `macos-plugins.sh`, `windows-plugins.ps1` (same five files that share `CSA_MARKETPLACES`).
  • How: `claude mcp add --transport http --scope user csa-mcp https://cloudsecurityalliance.org/mcp\`, with the standard silent-by-default contract.
  • Gate: `gh api repos/CloudSecurityAlliance-Internal/CSA-Plugins` — same CSA-membership proxy used for marketplace gating. Non-CSA users see no chatter.
  • No clobber: skips when `csa-mcp` already appears in `claude mcp list` (regex `^csa-mcp[: ]`), so the user's authenticated OAuth session is preserved across re-runs.
  • Post-install hint: only on a fresh registration, prints `Run /mcp inside Claude Code to authenticate with the CSA MCP server.` (browser flow must be initiated by the user).
  • Scope: Claude Code only for now — Codex and Gemini support OAuth-HTTP MCP transports too but their config formats differ; that's future work.

CLAUDE.md gains a dedicated CSA MCP server registration section right after the existing Plugin install contract section, plus the Shared boilerplate paragraph now mentions the new shared function. `SCRIPT_VERSION` bumped on all five files.

Soft-launch context: per https://cloudsecurityalliance.org/csa-mcp-server-client-setup the server is currently open to `@cloudsecurityalliance.org` accounts and beta testers, so the gate matters.

Test plan

  • `bash -n` on all three macOS scripts — clean.
  • `shellcheck` on all three macOS scripts — no new findings (pre-existing SC2059/SC2094 only).
  • Verified `claude mcp list` output format for user-scope HTTP servers (`: (HTTP) - `) so the existence check regex actually matches.
  • Confirmed `csa-mcp` already on the test machine surfaces correctly — function would silent-skip on re-run (no clobber).
  • Manual smoke test: run `macos-plugins.sh` on a CSA-eligible machine without `csa-mcp` registered.
  • Manual smoke test: run `macos-plugins.sh` on a non-CSA machine — confirm zero MCP-related output.
  • PowerShell syntax check on a Windows machine (no `pwsh` locally).

🤖 Generated with Claude Code

Adds setup_csa_mcp_server / Register-CSAMcpServer to all five scripts
that share the plugin-marketplace contract (macos-ai-tools.sh,
windows-ai-tools.ps1, macos-update.sh, macos-plugins.sh,
windows-plugins.ps1). Registers `csa-mcp` →
`https://cloudsecurityalliance.org/mcp` (HTTP transport, OAuth 2.1 +
PKCE) at user scope.

Silent-by-default: returns silently when claude/gh is missing, gh is
unauthenticated, csa-mcp is already registered (parsed from
`claude mcp list`), or the user lacks CSA-Internal access. The CSA-
membership gate is a `gh api repos/CloudSecurityAlliance-Internal/
CSA-Plugins` probe — the same proxy used elsewhere for CSA-only
behavior. Existing entries are NOT clobbered, since re-adding would
invalidate the user's authenticated OAuth session.

On a fresh successful registration, prints the standard success line
plus a `Run /mcp inside Claude Code to authenticate with the CSA MCP
server.` reminder, since the OAuth flow is browser-driven and must be
initiated by the user. Failures print the captured stderr indented
underneath, matching the marketplace-add error format.

Currently Claude Code only — Codex/Gemini support is future work.

Bumps SCRIPT_VERSION on all five files. Documents the new contract in
CLAUDE.md as a sibling of the existing "Plugin marketplace
registration" section.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant