Skip to content

feat: MCP server (cloudgov mcp) + AGENTS.md#7

Merged
stxkxs merged 1 commit into
mainfrom
mcp-server
May 29, 2026
Merged

feat: MCP server (cloudgov mcp) + AGENTS.md#7
stxkxs merged 1 commit into
mainfrom
mcp-server

Conversation

@stxkxs
Copy link
Copy Markdown
Member

@stxkxs stxkxs commented May 29, 2026

See the commit message for full detail. Completes the agent-readiness phase of the approved plan (the gate + SARIF foundation landed in #6).

Summary

  • cloudgov mcp — stdio Model Context Protocol server exposing 15 tools (audit, iam_scan, storage_audit, network_audit, secrets_scan, certs, tags, orphans, quota, inventory, cost_diff, drift, k8s_rbac, lambda_audit, compliance). Each reuses the CLI's resolve*Providers + scanners + JSON writers — no duplicated logic. Read-only; clean EOF shutdown.
  • One new dependency: the official github.com/modelcontextprotocol/go-sdk v1.6.1 (typed AddTool[In,Out]).
  • AGENTS.md — agent entry point: MCP tool table, the CLI/JSON/SARIF/--fail-on contract + exit codes, a fab merge-gate recipe, and the audit-vs-enforce / runtime-vs-build-time boundary.

Verification

go build, go test ./..., go vet, golangci-lint v2.12.2 (uncapped) all pass. End-to-end: claude mcp add --transport stdio cloudgov -- cloudgov mcpConnected, and tools/list returns all 15 tools.

Next (Phase 2)

cloudgov platform — the independent auditor that verifies live Platform/Tenant conformance (IRSA, NetworkPolicy, ResourceQuota, KMS) against the eks-agent-platform contract.

fab is MCP-primary — every agent role declares its mcpServers — so a
CLI with no MCP surface is a second-class citizen there. This exposes
cloudgov as a Model Context Protocol server and adds the agent-facing
entry point, completing the agent-readiness phase.

─── MCP server ───

- cmd/mcp.go: `cloudgov mcp` runs a stdio MCP server exposing 15 tools —
  audit, iam_scan, storage_audit, network_audit, secrets_scan, certs,
  tags, orphans, quota, inventory, cost_diff, drift, k8s_rbac,
  lambda_audit, and compliance. Each tool reuses the same
  resolve*Providers helpers, internal scanners, and output.Write* JSON
  writers as the CLI — no duplicated scan logic — and returns the
  identical JSON report. The server is read-only; a client disconnect
  (io.EOF) is treated as a clean shutdown.
- Built on the official github.com/modelcontextprotocol/go-sdk v1.6.1
  (typed AddTool[In, Out] handlers; input schemas inferred from Go
  structs with jsonschema tag descriptions). This is the one new
  dependency — implementing the protocol by hand was the alternative.
- cmd/root.go: register the mcp command.

─── AGENTS.md ───

- Agent-facing entry point per the org convention: the MCP tool table
  with params, the CLI/JSON/SARIF/--fail-on contract and exit codes, a
  fab merge-gate recipe (TRANSCRIPTS + CITATIONS straight from cloudgov
  output), and the boundary — cloudgov audits deployed/runtime posture;
  it does not enforce (the operator does) or grade build-time standards
  (fab's curators do).

Verification: go build ./..., go test ./..., go vet ./..., and
golangci-lint v2.12.2 (uncapped) all pass. End-to-end:
`claude mcp add --transport stdio cloudgov -- cloudgov mcp` reports
"Connected", and a tools/list call returns all 15 tools.

Co-authored-by: stxkxsbot <275011021+stxkxsbot@users.noreply.github.com>
@stxkxs stxkxs merged commit cd780ef into main May 29, 2026
4 checks passed
@stxkxs stxkxs deleted the mcp-server branch May 29, 2026 18:55
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