feat(skills): mcp-analytics instruments Python MCP servers too#205
Merged
Conversation
The Python SDK (posthog.mcp, shipped inside posthog v7.21.0) is live, so the wizard codemod should handle Python instead of aborting on it. - Guardrail: route by language in STEP 1 (TS/JS or Python); only abort on other languages, not Python. - Each step now has a TS/JS part and a Python part: detect a Python MCP server (official mcp FastMCP/Server, jlowin fastmcp 2.0, or a custom dispatcher), install `posthog>=7.21` (the mcp/fastmcp SDK is a peer dep already present), wrap with `instrument(server, posthog)` or use `PostHogMCP`, flush on exit, and keep STDIO clean (no print() to stdout; logger to stderr). - config.yaml: broaden the description and add a `python` variant (tags: [python, mcp]) so the wizard offers mcp-analytics on Python projects. Reaches users on the next context-mill release (merge with the `mcp-publish` + `minor` labels). Wizard command word is unchanged, so no wizard-repo PR needed. Generated-By: PostHog Code Task-Id: b21bc954-5de3-4512-a0d5-6bec2371f782
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Results will be posted here when complete. |
…Python paths #204 (NestJS Path D) merged to main while this branch was in review. Keep both: the bilingual TS/JS + Python structure, with the @rekog/mcp-nest Path D folded into the JS side (STEP 1 signals, STEP 2 paths, STEP 4 instrumentMutator snippet) and added to the config description. Generated-By: PostHog Code Task-Id: b21bc954-5de3-4512-a0d5-6bec2371f782
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Python SDK (
posthog.mcp, shipped inside posthog v7.21.0 — already on PyPI) is live, so thewizard mcp-analyticscodemod should instrument Python servers instead of aborting on them. This makes Python onboarding as one-line as TS/JS.What changed (
context/skills/mcp-analytics/)description.md— the codemod is now bilingual:mcpFastMCP/Server, jlowin'sfastmcp2.0, or a custom FastAPI/Starlette/edge dispatcher.posthog>=7.21(themcp/fastmcpSDK is a peer dependency the user already has — don't add it;PostHogMCP-only projects need nothing beyondposthog).instrument(server, posthog)(path P1) or usePostHogMCP+capture_tool_call/capture_initialize(path P2).await analytics.flush()→posthog.shutdown()), and keep STDIO clean (neverprint()to stdout;loggerto stderr).config.yaml— broadened the description and added apythonvariant (tags: [python, mcp]) so the wizard offersmcp-analyticson Python projects.Notes
mcp-analytics), so no wizard-repo PR is needed — this resolves at runtime from the context-mill release.mcp-publish+minorlabels.vitest run scripts/lib/tests(70/70 pass), config YAML parses with both variants.Related: SDK PostHog/posthog-python#691 (merged, shipped v7.21.0), docs PostHog/posthog.com#17827.
Created with PostHog Code