feat(integrations): migrate PostHog, Sentry and X MCP onto the shared setup flow#4199
Conversation
- add IntegrationSetupSpec for posthog_mcp, sentry_mcp, and x_mcp - route CLI + wizard through apply_setup so keyring/.env stay in sync - omit fixed transport fields; config defaults already match hosted HTTP - share MCP env-var names via config/constants and catalog readers - extend CLI + env round-trip coverage for the three MCP specs
Greptile code reviewThis repo uses Greptile for automated review. Before merge, aim for Confidence Score: 5/5 with zero unresolved review threads — see CONTRIBUTING.md. Run a review — add a PR comment with: Give it ~5-10 minutes (sometimes longer) for results, then fix feedback and re-trigger until you reach Confidence Score: 5/5. Optional: automate with the greploop skill. |
Greptile SummaryThis is the fifth batch in a series of migrations (#4168) that brings PostHog MCP, Sentry MCP, and X MCP onto the shared
Confidence Score: 5/5Safe to merge — the migration is mechanical and each new spec was verified against the model's field defaults before omitting fields from the spec. Every field omitted from the three new specs (mode, command, args, read_only, bearer_token) has a model-level default that exactly matches what the old hand-rolled handlers hard-coded, so no credentials change at runtime. The core fix — that opensre integrations setup now writes to the integration store, keyring, and .env instead of just the store — is exercised by both the env round-trip test and the CLI spec-setup suite. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix(integrations): resolve main conflict..." | Re-trigger Greptile |
- merge upstream/main into feat/setup-specs-batch5 - keep batch5 MCP specs alongside batches 2–4 setup migrations - use shared env constants in posthog/sentry/x MCP config_from_env
|
@greptile review |
|
🐉 Legend says enough merged PRs and you ascend. @muddlebee is dangerously close. 🌤️ 👋 Join us on Discord - OpenSRE : hang out, contribute, or hunt for features and issues. Everyone's welcome. |

Part of #4168. Follows #4191 (batch 1), #4194 (batch 2), #4196 (batch 3), and #4197 (batch 4).
Describe the changes you have made in this PR -
Fifth migration batch onto the shared setup flow: PostHog MCP, Sentry MCP, X MCP.
These were the "constant / derived fields" gap from #4168 — their CLI handlers hard-code
mode/command/args(and never prompt for them) with comments like "do NOT reintroduce a transport selection." Rather than inventingSetupField.constantfor this batch, the specs only declare the fields a user is actually asked for. For these three hosted/streamable-HTTP servers,PostHogMCPConfig/SentryMCPConfig/XMCPConfigalready defaultmodetostreamable-httpand leavecommand/argsempty — the same values every setup path was hard-coding — so omitting them from the persisted credentials is equivalent to writing them.OpenClaw is intentionally not in this batch. Its CLI hard-codes
mode=stdio, butOpenClawConfig's default isstreamable-http. Omittingmodewould silently flip transport. That one still needsSetupField.constant(or an explicit persist of the fixed stdio mode) before it can migrate.What this fixes for the three that did migrate
Previously
opensre integrations setup posthog_mcp|sentry_mcp|x_mcponly wrote the integration store. The matching wizard configurators already wrote store + keyring +.env. Same deploy-preflight footgun as the earlier batches. Both surfaces now go throughapply_setup.Demo/Screenshot for feature changes and bug fixes -
Env round-trip guard for the three MCP specs:
CLI spec-setup suite including the new handlers:
(The skip is
x_mcp: every required field has a default URL, so the "blank required field" case does not apply.)Code Understanding and AI Usage
Did you use AI assistance (ChatGPT, Claude, Copilot, etc.) to write any part of this code?
If you used AI assistance:
Explain your implementation approach:
#4168 listed these four as blocked on a new
SetupField.constantfeature. I checked whether that feature is actually required for each:configure_from_spec/_run_spec_setupwould do for every field today) and avoids inventing a new spec feature for a case the config layer already covers.stdioconflicts with the config default (streamable-http). Omitting would change behavior. Left hand-rolled untilSetupField.constantexists.Key pieces:
integrations/{posthog_mcp,sentry_mcp,x_mcp}/setup.py— prompted fields only; verifier wired explicitly.config/constants/{posthog_mcp,sentry_mcp,x_mcp}.py— shared env names for writer + catalog reader.configure_from_spec; REST PostHog/Sentry configurators left alone (batch 2 owns those).Edge cases: optional
project_id/host/auth_tokenclear every tier when blanked; URL defaults are offered as prompt prefills and applied byapply_setupso enter-to-accept works without a typed value.Checklist before requesting a review