Claude-skill-registry-data mcp-uninstall
Remove magnet-local and/or magnet-canary MCP server configurations from project and global locations. Use when user says "uninstall mcp", "remove mcp", "delete mcp config", or "clean up mcp".
git clone https://github.com/majiayu000/claude-skill-registry-data
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry-data "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/mcp-uninstall" ~/.claude/skills/majiayu000-claude-skill-registry-data-mcp-uninstall && rm -rf "$T"
data/mcp-uninstall/SKILL.mdMCP Server Uninstall
This skill helps users remove Magnet MCP server configurations (magnet-local and/or magnet-canary) from their system.
When to Use This Skill
Use this skill when the user requests:
- Removing MCP server configurations
- Cleaning up old MCP settings
- Uninstalling the local or canary MCP server
- Resetting their MCP configuration
Instructions
Step 1: Ask What to Uninstall
Use AskUserQuestion to determine which configuration(s) to remove:
Question: "Which MCP server configuration do you want to remove?" Options:
- "magnet-local" - Remove the local development server configuration
- "magnet-canary" - Remove the canary environment server configuration
- "Both" - Remove both local and canary configurations
Step 2: Scan for Configurations
Check for MCP configurations in project and client-specific locations:
Project location (magnet-app):
# Find magnet-app directory MAGNET_APP_DIR=$(ls -d ~/magnet-app 2>/dev/null || ls -d ~/Projects/magnet-app 2>/dev/null || ls -d ~/Code/magnet-app 2>/dev/null) # Check for .mcp.json if [ -n "$MAGNET_APP_DIR" ] && [ -f "$MAGNET_APP_DIR/.mcp.json" ]; then echo "Found project config: $MAGNET_APP_DIR/.mcp.json" cat "$MAGNET_APP_DIR/.mcp.json" fi
Cursor:
if [ -f ~/.cursor/mcp.json ]; then echo "Found Cursor config: ~/.cursor/mcp.json" cat ~/.cursor/mcp.json fi
Claude Desktop (macOS):
if [ -f ~/Library/Application\ Support/Claude/claude_desktop_config.json ]; then echo "Found Claude Desktop config" cat ~/Library/Application\ Support/Claude/claude_desktop_config.json fi
Global Claude Code locations (~/.claude/):
# Check for global MCP configs if [ -f ~/.claude/settings.json ]; then echo "Found ~/.claude/settings.json" grep -l "mcpServers" ~/.claude/settings.json 2>/dev/null && cat ~/.claude/settings.json fi if [ -f ~/.claude/settings.local.json ]; then echo "Found ~/.claude/settings.local.json" cat ~/.claude/settings.local.json fi
Step 3: Display Findings
Report what was found to the user:
- List each location where the target configuration(s) exist
- Show the current configuration content
- If configuration not found, report "Configuration not found in [location]"
Step 4: Confirm Removal
Use AskUserQuestion to confirm before making changes:
Question: "Found [config-name] in [locations]. Do you want to remove it?" Options:
- "Yes, remove it" - Proceed with removal
- "No, cancel" - Abort the operation
Step 5: Remove Configuration Entries
For each location where the configuration exists:
Removing from .mcp.json:
# Use jq to remove specific server entry (if jq is available) # Otherwise, use node/JavaScript to parse and modify JSON # Example with node: node -e " const fs = require('fs'); const path = '$MAGNET_APP_DIR/.mcp.json'; const config = JSON.parse(fs.readFileSync(path, 'utf8')); delete config.mcpServers['magnet-local']; // or 'magnet-canary' fs.writeFileSync(path, JSON.stringify(config, null, 2)); console.log('Removed magnet-local from', path); "
Important behaviors:
- Only remove the specific server entry, not the entire file
- If
becomes empty after removal, remove themcpServers
keymcpServers - If the file becomes just
, optionally inform user they can delete the file{} - Preserve other configurations in the same file
Step 6: Report Results
After removal, report:
- Which configurations were removed
- From which locations
- Any configurations that were not found
- Remind user to restart Claude Code to apply changes
Example output:
Removed configurations: - magnet-local from ~/magnet-app/.mcp.json - magnet-canary from ~/magnet-app/.mcp.json Not found: - No global configurations in ~/.claude/ Please restart Claude Code to apply the changes.
Edge Cases
Configuration Not Found
If the requested configuration doesn't exist:
The magnet-local configuration was not found in any of the checked locations: - ~/magnet-app/.mcp.json (file exists but doesn't contain magnet-local) - ~/.claude/settings.json (no mcpServers section) No changes were made.
Last Server in File
If removing the last server entry:
// After removal, check if mcpServers is empty if (Object.keys(config.mcpServers).length === 0) { delete config.mcpServers; // Inform user: "The mcpServers section is now empty" }
File Permissions
If unable to modify the file:
Error: Unable to modify ~/magnet-app/.mcp.json Please check file permissions or remove the configuration manually.
Examples
Example 1: Remove Local Configuration
User: "Remove the local MCP server"
Actions:
- Confirm they want to remove magnet-local
- Check ~/magnet-app/.mcp.json - found magnet-local
- Check ~/.claude/ - no global config
- Ask for confirmation
- Remove magnet-local entry from .mcp.json
- Report success and remind to restart Claude Code
Example 2: Remove Both Configurations
User: "Clean up all Magnet MCP configurations"
Actions:
- Ask which to remove → user selects "Both"
- Scan all locations
- Find magnet-local and magnet-canary in ~/magnet-app/.mcp.json
- Confirm removal of both
- Remove both entries
- Report what was removed
Example 3: Configuration Not Found
User: "Remove the canary server"
Actions:
- Confirm they want to remove magnet-canary
- Scan locations - magnet-canary not found anywhere
- Report "Configuration not found, no changes made"
Notes
- This skill removes configuration entries, not the actual MCP server code
- Always confirm before removing configurations
- Check both project-specific and global locations
- Preserve other configurations in the same files
- Remind users to restart Claude Code after changes
- If jq is not available, use node for JSON manipulation