Skip to content

Drop trailing slash from PostHog MCP URL - #9

Merged
jsherman11 merged 1 commit into
mainfrom
fix/posthog-mcp-url-trailing-slash
May 12, 2026
Merged

Drop trailing slash from PostHog MCP URL#9
jsherman11 merged 1 commit into
mainfrom
fix/posthog-mcp-url-trailing-slash

Conversation

@jsherman11

@jsherman11 jsherman11 commented May 12, 2026

Copy link
Copy Markdown

Summary

The PostHog MCP URL baked into `docker/entrypoint.sh` had a trailing slash (`https://mcp.posthog.com/mcp/\`) which routes to a 404 at the application layer. Same URL without the slash reaches the JSON-RPC endpoint correctly.

Verification

From a live Railway shell against the running PostHog MCP endpoint:

  • With `/mcp/` (slash): `HTTP/2 404` + `{"error":{"code":-32000,"message":"Not found"}}` — wrong path
  • Without `/mcp` (no slash): `HTTP/2 400` + `{"error":{"code":-32700,"message":"Parse error: Invalid JSON"}}` — reached the JSON-RPC parser (parse error was from an empty test body, not the URL)

The no-slash form is the correct route.

Hermes was logging the failure as `MCP server 'posthog' initial connection failed ... unhandled errors in a TaskGroup (1 sub-exception)` — the underlying HTTPStatusError is wrapped inside an anyio TaskGroup and the WARNING-level log doesn't unwrap it. Worth a separate Hermes-upstream fix later to surface `BaseExceptionGroup.exceptions[0]` in MCP connection-failure warnings.

Out of scope

  • Live `/opt/data/config.yaml` was patched in-place via `sed` so the running gateway can reload without waiting for this redeploy.
  • The unused `transport:` and `pinned_context:` keys (silently ignored by Hermes per source) are a separate cleanup PR.

Test plan

  • Merge → Railway rebuild + redeploy
  • On boot, entrypoint sees the existing posthog stanza marker → skips injection (idempotent)
  • Future cold-volume deploys inject with the correct URL
  • If the live posthog stanza is ever regenerated (e.g. volume reset), `grep "mcp.posthog.com" /opt/data/config.yaml` shows the no-slash URL

🤖 Generated with Claude Code


Summary by cubic

Dropped the trailing slash from the PostHog MCP URL in docker/entrypoint.sh so it points to the JSON-RPC endpoint instead of a 404. Fixes startup connection failures and ensures future deploys inject the correct URL.

Written for commit 6c3f8da. Summary will update on new commits.

PostHog's MCP endpoint returns HTTP 404 with a JSON-RPC "Not found"
error when given https://mcp.posthog.com/mcp/ — the trailing slash
hits a path the application layer doesn't route. Without it, the
endpoint responds with valid JSON-RPC errors (auth + protocol-aware),
confirming the no-slash form is the correct URL.

Live config.yaml on the volume was patched in-place via sed; this
keeps future cold deploys from re-injecting the bad URL.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@jsherman11
jsherman11 merged commit 860a990 into main May 12, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant