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): use the system ca bundle instead of node's (#121776)

Tom Piccirellof04683fe6608
diff --git a/services/mcp/Dockerfile b/services/mcp/Dockerfile
index 13316fc2b7ab..94267b319674 100644
--- a/services/mcp/Dockerfile
+++ b/services/mcp/Dockerfile
@@ -70,6 +70,13 @@ WORKDIR /code
ARG COMMIT_HASH
RUN echo "${COMMIT_HASH:-unknown}" > /code/commit.txt
+# Node 24.13.0's bundled CA store still trusts the compromised eMudhra roots.
+# --use-openssl-ca in CMD makes Node read this Debian bundle instead, which
+# ca-certificates 20250419~deb12u2 and later keep current.
+RUN apt-get update && \
+ apt-get install -y --no-install-recommends ca-certificates && \
+ rm -rf /var/lib/apt/lists/*
+
# Bundle is fully self-contained — ioredis and everything else is inlined.
COPY --from=build --chown=node:node /code/services/mcp/dist/hono-server.mjs ./hono-server.mjs
COPY --from=build --chown=node:node /code/services/mcp/dist/hono-server.mjs.map ./hono-server.mjs.map
@@ -88,4 +95,6 @@ EXPOSE 3001
USER node
-CMD ["node", "hono-server.mjs"]
+# The flag lives here, not in NODE_OPTIONS, because the deploy chart sets
+# NODE_OPTIONS and would replace it.
+CMD ["node", "--use-openssl-ca", "hono-server.mjs"]