Skip to content

fix(mcp): use plugin uninstall command for Claude Code and Codex#436

Open
posthog[bot] wants to merge 1 commit intomainfrom
posthog-code/fix-mcp-claude-code-uninstall
Open

fix(mcp): use plugin uninstall command for Claude Code and Codex#436
posthog[bot] wants to merge 1 commit intomainfrom
posthog-code/fix-mcp-claude-code-uninstall

Conversation

@posthog
Copy link
Copy Markdown

@posthog posthog Bot commented May 5, 2026

Summary

  • Fixes deterministic failure when users uninstall the PostHog MCP via the wizard: claude mcp remove --scope user posthog rejects with No user-scoped MCP server found.
  • Root cause: PR chore: plugin interface for claude and codex #428 migrated addServer to the plugin interface (claude plugin install) but left removeServer calling the legacy mcp remove subcommand. Same asymmetry existed in CodexMCPClient.
  • Adds uninstallPlugin() to the PluginCapable interface and routes removeServer through it for both clients, mirroring how addServer delegates to installPlugin. Treats "not installed" / "not found" / "does not exist" / "no such plugin" stderr as benign success, symmetric with installPlugin's handling of "already installed".
  • Linked error tracking issue: 019df89b-3f44-7791-85c4-6be1b9fe924a.

Test plan

  • pnpm typecheck passes
  • All 605 unit tests pass, including new coverage for the uninstall path in claude-code.test.ts and codex.test.ts
  • Lint and prettier clean on changed files
  • Manual verification on macOS: install MCP via wizard, then re-run wizard and remove — should succeed without the No user-scoped MCP server found error
  • Verify exact CLI subcommand names against current Claude Code and Codex CLIs (claude plugin uninstall posthog, codex plugin marketplace remove PostHog/ai-plugin); if either uses a different verb, it's a one-string fix per client

Generated-By: PostHog Code
Task-Id: 3774ac44-a10d-4f37-b5c2-fa82c315ec72

PR #428 migrated addServer to the plugin interface but left removeServer
calling the legacy mcp remove subcommand, which fails deterministically
with "No user-scoped MCP server found". Add uninstallPlugin to the
PluginCapable interface and route removeServer through it for both
clients, treating not-installed stderr as benign success.

Generated-By: PostHog Code
Task-Id: 3774ac44-a10d-4f37-b5c2-fa82c315ec72
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

🧙 Wizard CI

Run 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:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci basic-integration
  • /wizard-ci misc
  • /wizard-ci revenue

Test an individual app:

  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
Show more apps
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci misc/quack-quack
  • /wizard-ci revenue/stripe

Results will be posted here when complete.

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.

0 participants