feat(workspace-integrations): port native MCP + integration catalog from ocm-cloud - #37
Merged
Conversation
…rom ocm-cloud Brings the workspace-integrations / native-MCP feature into the public core: remote-MCP catalog and gateway, OAuth connectors (Google, GitHub), workspace integration import/management/governance, per-machine integration token signing, Secret-Manager-style connection credential storage, and the associated frontend pages (Workspaces, WorkspaceIntegrations). Adds migrations 099–108 and the ocm-integrations bundled plugin/skill. Backend builds and frontend typechecks clean; migrations are sequential (no collision with 098). Ported from the ocm-cloud overlay. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ecurity review findings Addresses the PR #37 review. Confirmed bugs: - Config push no longer fails fleet-wide when JWT_SECRET is weak/unset. The push path passed a never-nil method value as the token signer, so the injector's nil-signer skip never fired and a signer error aborted every machine's AssembleConfig. Pass the raw nilable signer (mirroring the seed path), and make the injector treat a nil/erroring signer as skip-with-warn — leaving the REST fallback in place, only disabling it once native MCP is actually wired. Regression tests added. - GraphQL SDL import no longer truncates a block at the first '}'. Object/list default-value literals (e.g. `filter: Filter = {limit: 10}`) previously dropped that field and everything after it. Replaced the `\{(.*?)\}` regex extraction with a brace-depth, string-literal-aware body scanner; also fixed the comment stripper cutting '#' inside string literals. Regression tests added. Deploy-safety / resilience: - Config + seed assembly degrade (warn, continue with empty list) instead of aborting when ListEnabledWorkspaceIntegrationsForMachine errors, so an integrations-subsystem fault can't block provisioning for machines with zero integrations. Verified migration 099 backfills every machine before SET NOT NULL (workspaces created first; machines.account_id FK guarantees coverage). Performance: - Reuse two Server-level outbound HTTP clients (secure/insecure) instead of building a fresh Transport per tool call, restoring connection pooling. - call_tool builds tool descriptors once and shares them between the ambiguity check and resolution, cutting repeated projection + guidance-overlay queries. - Hoisted per-call regex compiles in the GraphQL importer to package vars. Maintainability / correctness nits: - Collapsed the duplicated workspace-integration admin routes behind a prefix helper mounted under both surfaces so they can't drift. - Centralized the REST-plugin slug + config-key list stripped by the generic assembler into named constants (single source of truth). - Telemetry guidance drafts now get distinct versions per sibling via a windowed offset instead of colliding on MAX+1. - randomStateNonce returns an error on RNG failure instead of a guessable timestamp fallback (it feeds the PKCE code_verifier). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Covers the ported feature across the three docs the reader actually reaches for: - README "How it works" gains the workspace-integrations bullet + a deep link to the new architecture section. - architecture.md adds a "Workspace Integrations & Native MCP" section: the workspace/machine data model (migrations 099-108, encrypted credentials), how config assembly injects the single built-in MCP server, the search_tools/describe_tool/call_tool facade + per-machine JWT gateway auth, and the degraded-mode/fallback behavior (weak JWT_SECRET skips injection and keeps the REST fallback instead of failing). - user-guide.md adds a "Workspace integrations" section (connect once per workspace, how the agent discovers/calls tools, approval + guidance) and a troubleshooting row for the no-tools/weak-JWT_SECRET case. Grounded in the end-to-end run against a real backend + Postgres. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the workspace-integrations / native-MCP feature from the ocm-cloud overlay into the public core.
What's included
workspace_integrations_mcp*.go, catalog, gateway, orchestration, probe.workspace_integrations_google.go,_github.go, OAuth token flow).workspace_integrations_import.go,_management.go, plus governance migration.auth/workspace_integration_token.go.store/workspace_integrations_postgres.go+ credentials migration.pages/Workspaces.tsx,pages/WorkspaceIntegrations.tsx, App/AppShell wiring, api client.plugins/ocm-integrations-plugin/,rootfs/skills/ocm-integrations/, build + live-verify scripts.State
go build ./...clean; frontendtsc --noEmitclean.*_test.gocame with the port).Separate from the local-dev-stability work in #36 (merged) — this is its own feature PR.
🤖 Generated with Claude Code