Skip to content

: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.

fix(mcp-store): keep disabled servers inactive (#94763)

Dylan Martin2e31a8a52da2
diff --git a/products/mcp_store/backend/catalog_sync.py b/products/mcp_store/backend/catalog_sync.py
index ff65e21b9f31..f81c98884dc4 100644
--- a/products/mcp_store/backend/catalog_sync.py
+++ b/products/mcp_store/backend/catalog_sync.py
@@ -161,10 +161,11 @@ def _update_template(template: MCPServerTemplate, entry: CatalogEntry, skip_prob
changed = [f for f in _CONTENT_FIELDS if getattr(template, f) != _entry_field_value(entry, f)]
for f in changed:
setattr(template, f, _entry_field_value(entry, f))
- if entry.disabled and template.is_active:
- template.is_active = False
- changed.append("is_active")
- logger.warning("mcp_catalog_sync.deactivated_disabled_entry", url=entry.url)
+ if entry.disabled:
+ if template.is_active:
+ template.is_active = False
+ changed.append("is_active")
+ logger.warning("mcp_catalog_sync.deactivated_disabled_entry", url=entry.url)
elif "auth_type" in changed and template.is_active:
# The row was vetted and activated under the old auth model — e.g. an
# oauth→api_key flip would route new installs through the API-key branch
diff --git a/products/mcp_store/backend/test/test_catalog_sync.py b/products/mcp_store/backend/test/test_catalog_sync.py
index eab14e8cf0ff..e420465cd71e 100644
--- a/products/mcp_store/backend/test/test_catalog_sync.py
+++ b/products/mcp_store/backend/test/test_catalog_sync.py
@@ -290,23 +290,36 @@ class TestSyncMCPCatalog(TestCase):
assert counts.created == 1
assert MCPServerTemplate.objects.get(url=_entry().url).is_active is False
- def test_disabled_entry_deactivates_existing_template(self):
+ @patch(
+ "products.mcp_store.backend.oauth_credentials.get_instance_settings",
+ return_value={"SLACK_APP_CLIENT_ID": "slack-client", "SLACK_APP_CLIENT_SECRET": "slack-secret"},
+ )
+ def test_disabled_entry_remains_inactive_across_syncs(self, _settings):
+ entry = _entry(disabled=True, oauth_credentials_source="slack_app")
template = MCPServerTemplate.objects.create(
name="Linear",
- url=_entry().url,
+ url=entry.url,
description="Manage Linear issues.",
auth_type="oauth",
category="dev",
icon_domain="linear.app",
is_active=True,
)
+ probe_result = ProbeResult(
+ reachable=True,
+ speaks_mcp=True,
+ auth_flavor="oauth_shared",
+ authorize_endpoint_ok=True,
+ )
- with patch("products.mcp_store.backend.catalog_sync.probe_mcp_server") as probe_mock:
- counts = sync_mcp_catalog(entries=[_entry(disabled=True)])
+ with patch("products.mcp_store.backend.catalog_sync.probe_mcp_server", return_value=probe_result) as probe_mock:
+ first_counts = sync_mcp_catalog(entries=[entry])
+ second_counts = sync_mcp_catalog(entries=[entry])
probe_mock.assert_not_called()
template.refresh_from_db()
- assert counts.updated == 1
+ assert first_counts.updated == 1
+ assert second_counts.unchanged == 1
assert template.is_active is False
def test_warns_on_active_row_missing_from_catalog(self):