Skip to content

feat(mcp): add synthetic git endpoints for per-skill plugin distribution#57178

Draft
daniloc wants to merge 6 commits into
masterfrom
synthetic-git-marketplace
Draft

feat(mcp): add synthetic git endpoints for per-skill plugin distribution#57178
daniloc wants to merge 6 commits into
masterfrom
synthetic-git-marketplace

Conversation

@daniloc
Copy link
Copy Markdown
Contributor

@daniloc daniloc commented Apr 30, 2026

Adds a synthetic git smart HTTP layer to the MCP server that enables per-skill install attribution. Instead of one monolithic plugin clone from GitHub, each skill becomes an individually installable plugin served via git clone from mcp.posthog.com, with PostHog analytics events fired on every install and update fetch.

Problem

Skill distribution is a bit of a shitshow, and worse yet, we don't know exactly what skills are most desired. This resolves the issue by putting us in direct control of the marketplace interface.

Changes

  • Git interface for MCP server
  • Marketplace distribution via MCP server
  • Analytics events for Skill consumption, including installs and updates
  • Per-skill installation requests in the marketplace structure allow us to measure demand for skills

How did you test this code?

MCP run locally and installed marketplace to Claude Code.

🤖 Agent context

Claude Code reimplemented a strategy I've used in personal projects to good success here. Supplemented with some interesting research:

Issue #46163 on anthropics/claude-code (open, no Anthropic response): plugin authors have zero visibility into installs, active users, or adoption. They're requesting exactly what the synthetic git approach provides — install counts, version distribution, usage signals. VS Code Marketplace and npm both provide this as first-party analytics. Claude Code's ecosystem has nothing.

This means the synthetic git marketplace isn't just PostHog solving its own problem — it's a reference implementation for what every plugin author needs. That's a positioning opportunity: PostHog can dogfood its own analytics product on its own plugin distribution, and the pattern is reusable by anyone running a marketplace.

Adds a synthetic git smart HTTP layer to the MCP server that enables
per-skill install attribution. Instead of one monolithic plugin clone
from GitHub, each skill becomes an individually installable plugin
served via git clone from mcp.posthog.com, with PostHog analytics
events fired on every install and update fetch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@daniloc
Copy link
Copy Markdown
Contributor Author

daniloc commented Apr 30, 2026

Oh I forgot the best part:

this is the command to add it to Claude Code

/plugin marketplace add https://mcp.posthog.com/

daniloc and others added 2 commits April 30, 2026 12:07
Adds a synthetic git smart HTTP layer to the MCP server that enables
per-skill install attribution. Instead of one monolithic plugin clone
from GitHub, each skill becomes an individually installable plugin
served via git clone from mcp.posthog.com, with PostHog analytics
events fired on every install and update fetch.

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

Resolves merge conflict in index.ts. Replaces hardcoded plugin versions
with versions extracted from SKILL.md frontmatter (e.g. 1.12.1 from
context-mill). This ensures auto-update works: when context-mill cuts
a new release, the version string changes and Claude Code picks it up.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@daniloc
Copy link
Copy Markdown
Contributor Author

daniloc commented Apr 30, 2026

refinement: pipe through the version data from context-mill for ongoing, proper versioning.

@cvolzer3
Copy link
Copy Markdown
Contributor

very nice! excited to see this get rolled out.

daniloc and others added 3 commits April 30, 2026 15:35
Bundles combine multiple skills into a single plugin served from
/git/bundles/:name. The marketplace now lists 11 framework bundles
(nextjs, react, python, node, etc.) instead of 84 individual skills.
Bundle definitions come from the context-mill manifest.

Also fixes duplicate git objects in packfiles when skills share
identical reference files (dedup by SHA in synthesizeRepo).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The core plugin now includes a skill that detects the user's tech stack
(package.json, requirements.txt, Gemfile, etc.) and recommends the right
PostHog bundle to install. The skill content is generated dynamically
from the bundle catalog so it stays current as bundles are added.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The recommend-posthog-skills SKILL.md content now comes from the
context-mill manifest's recommendSkill field instead of being
hardcoded in the MCP server. Content authoring lives in context-mill's
bundles.yaml alongside the bundle definitions it references.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@daniloc
Copy link
Copy Markdown
Contributor Author

daniloc commented Apr 30, 2026

further refined to 11 plugins/skill bundles, plus a plugin selection skill that suggests the ideal plugin to install to the user when PostHog-shaped needs arise:

Bundle Name Skills Description
posthog-nextjs PostHog for Next.js 10 Analytics, feature flags, error tracking, and logging for Next.js applications
posthog-react PostHog for React 5 Analytics, feature flags, and error tracking for React applications
posthog-python PostHog for Python 10 Analytics, feature flags, error tracking, and logging for Python applications
posthog-node PostHog for Node.js 7 Analytics, feature flags, error tracking, and logging for Node.js applications
posthog-react-native PostHog for React Native 7 Analytics, feature flags, and error tracking for React Native applications
posthog-svelte PostHog for Svelte 5 Analytics, feature flags, and error tracking for SvelteKit applications
posthog-vue PostHog for Vue / Nuxt 7 Analytics, feature flags, and error tracking for Vue.js and Nuxt applications
posthog-ruby PostHog for Ruby 8 Analytics, feature flags, error tracking, and logging for Ruby and Rails applications
posthog-go PostHog for Go 6 Analytics, feature flags, error tracking, and logging for Go applications
posthog-llm PostHog LLM Analytics 2 Monitor LLM usage, costs, traces, and evaluations with PostHog
posthog-android PostHog for Android 6 Analytics, feature flags, and error tracking for Android applications

Depends on a new generator in context-mill:

PostHog/context-mill#120

Plugin recommender

    # Recommend PostHog Skills

    You are helping the user install the right PostHog skills for their project.

    ## Step 1: Detect the technology stack

    Check the project for framework indicators:

    ```bash
    # Check for key files
    ls package.json requirements.txt Gemfile go.mod Cargo.toml build.gradle pubspec.yaml 2>/dev/null

    # If package.json exists, check dependencies
    cat package.json 2>/dev/null | grep -E '"(next|react|react-native|expo|vue|nuxt|svelte|@sveltejs|astro|angular)"' | head -10

    # If requirements.txt or setup.py exists
    cat requirements.txt setup.py pyproject.toml 2>/dev/null | grep -iE '(django|flask|fastapi)' | head -5

    # If Gemfile exists
    cat Gemfile 2>/dev/null | grep -iE '(rails|sinatra)' | head -5
    ```

    ## Step 2: Match to a bundle

    Based on what you find, recommend ONE bundle from this list:

    {bundle_list}

    ## Step 3: Recommend installation

    Tell the user which bundle matches their stack and give them the install command:

    ```
    /plugin install posthog-{bundle-name}@posthog
    ```

    If the project uses multiple frameworks (e.g., a Next.js frontend + Python backend), recommend multiple bundles.

    If no framework is detected, ask the user what they're building.

@daniloc
Copy link
Copy Markdown
Contributor Author

daniloc commented May 1, 2026

So here's the flow, if we did this.

  1. we change the source.url value in the official plugin registry to point at mcp.posthog.com/git/core
  2. users run /plugin install posthog as usual, giving them MCP, etc
  3. the base plugin gives them a basic skills bundle for MCP interactions
  4. the plugin also ensures the necessary PostHog skills are present for any coding task that requires them
Screenshot 2026-04-30 at 8 22 32 PM
  1. now we have a surface to serve the user the content they need, when they need it, and the ability to measure their consumption
Screenshot 2026-04-30 at 8 22 52 PM

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, please remove the stale label – otherwise this will be closed in another week. If you want to permanently keep it open, use the waiting label.

@github-actions github-actions Bot added the stale label May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants