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.

2.0 KB
Raw Blame
# Deployment-level kill switch for the sync/ranking pipeline (crawl, aggregate, probe, rank)
# and gate for the DRF endpoints. Evaluated with a constant distinct_id for the pipeline
# (whole-deployment toggle, like mcp-analytics-clustering-schedule) and per-user for the API.
MCP_REGISTRY_FEATURE_FLAG = "mcp-registry"
MCP_REGISTRY_PIPELINE_DISTINCT_ID = "internal_mcp_registry_pipeline"

OFFICIAL_REGISTRY_BASE_URL = "https://registry.modelcontextprotocol.io/v0/servers"
# The registry has ~22k active servers at ~100/page; this cap only guards against a
# pagination bug or a runaway registry, not normal growth.
OFFICIAL_REGISTRY_MAX_PAGES = 1_000

# How far back the measured-signal aggregation looks, and the window stamped on stats rows.
MEASURED_WINDOW_DAYS = 30
# A stats row stops counting toward trust once it is this old. Aggregation only upserts
# servers that appeared in the window, so a server that stopped being called keeps its
# last row forever; without this it would keep the trust it earned when it was busy.
MEASURED_STALE_AFTER_DAYS = 60
# Per-server cap on tool rows kept from analytics aggregation (ordered by call volume).
MEASURED_TOOL_LIMIT = 200
# Cap on teams pulled into one aggregation run; revisit before wide rollout.
MEASURED_TEAM_LIMIT = 500

# Shallow-probe batch size per scheduled run: stalest servers first, so the whole index
# converges over successive days without one giant sweep.
PROBE_BATCH_SIZE = 500
# Probes wait on third-party servers, so they run in parallel. Kept modest because the
# index spreads over many hosts and the sweep is background work, not a load test.
PROBE_CONCURRENCY = 20
PROBE_TIMEOUT_SECONDS = 10
# Hard cap on a single probe response body. A registry publisher can point an entry at an
# endpoint that streams an unbounded body; up to PROBE_CONCURRENCY of those buffered at once
# would OOM the scheduled worker. Probes only need the JSON-RPC envelope, so anything past
# this is treated as a failed probe rather than read.
PROBE_RESPONSE_MAX_BYTES = 1_000_000
PROBE_TOOL_LIMIT = 100
PROBE_TOOL_DESCRIPTION_MAX_CHARS = 500