:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(mcp-store): allow * in the slack dev app project allowlist (#123824)
Vojta Bartoš4ea3ca677a50
diff --git a/docs/internal/slack-local-setup-guide.md b/docs/internal/slack-local-setup-guide.mdindex ac9d5cc9cc6b..36e174d154c5 100644--- a/docs/internal/slack-local-setup-guide.md+++ b/docs/internal/slack-local-setup-guide.md@@ -273,6 +273,8 @@ It does not move bot events to production or change the production Slack app's cDo not replace `SLACK_APP_CLIENT_ID`, `SLACK_APP_CLIENT_SECRET`, or `SLACK_APP_SIGNING_SECRET`.3. Set `MCP_STORE_SLACK_DEV_ALLOWED_TEAM_IDS` to a comma-separated list of permitted project IDs in that region's server configuration.The default is empty, which blocks access.+ Use `*` to permit all projects in the region, for example on the dev region where every user is internal.+ Do not use `*` in a production region.Apply the same configuration to the web processes and workers.Production deployments must also add these variables to `posthog/charts` and provision their values through `posthog/secrets`.Adding the settings in this repository does not configure production.diff --git a/products/mcp_store/backend/oauth_credentials.py b/products/mcp_store/backend/oauth_credentials.pyindex 21737fc6e699..1f27e17019b3 100644--- a/products/mcp_store/backend/oauth_credentials.py+++ b/products/mcp_store/backend/oauth_credentials.py@@ -25,7 +25,10 @@ SUPPORTED_OAUTH_CREDENTIAL_SOURCES = frozenset(_TRUSTED_OAUTH_METADATA_BY_SOURCEdef oauth_credentials_source_is_allowed(source: str, team_id: int) -> bool:- return source != "slack_dev_app" or str(team_id) in settings.MCP_STORE_SLACK_DEV_ALLOWED_TEAM_IDS+ if source != "slack_dev_app":+ return True+ allowed_team_ids = settings.MCP_STORE_SLACK_DEV_ALLOWED_TEAM_IDS+ return "*" in allowed_team_ids or str(team_id) in allowed_team_idsdef validate_oauth_credentials_source_metadata(source: str, metadata: Mapping[str, object]) -> None:diff --git a/products/mcp_store/backend/test/test_api.py b/products/mcp_store/backend/test/test_api.pyindex 999935accd74..342545c598c5 100644--- a/products/mcp_store/backend/test/test_api.py+++ b/products/mcp_store/backend/test/test_api.py@@ -212,15 +212,20 @@ class TestMCPServerAPI(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):@parameterized.expand([- ("allowed_and_flagged", True, True, True),- ("allowed_without_flag", True, False, False),- ("flagged_outside_allowed_project", False, True, False),+ ("allowed_and_flagged", "team", True, True),+ ("allowed_without_flag", "team", False, False),+ ("flagged_outside_allowed_project", "none", True, False),+ ("wildcard_and_flagged", "wildcard", True, True),])- def test_slack_dev_template_visibility(self, _name: str, allowed: bool, flag_enabled: bool, expected: bool) -> None:+ def test_slack_dev_template_visibility(+ self, _name: str, allowlist: str, flag_enabled: bool, expected: bool+ ) -> None:template = self._create_active_template(oauth_credentials_source="slack_dev_app")+ allowed = allowlist != "none"+ allowed_team_ids = {"team": [str(self.team.id)], "wildcard": ["*"], "none": []}[allowlist]with (- self.settings(MCP_STORE_SLACK_DEV_ALLOWED_TEAM_IDS=[str(self.team.id)] if allowed else []),+ self.settings(MCP_STORE_SLACK_DEV_ALLOWED_TEAM_IDS=allowed_team_ids),patch("posthog.permissions.posthoganalytics.feature_enabled", return_value=flag_enabled) as feature_enabled,):response = self.client.get(f"/api/environments/{self.team.id}/mcp_servers/")