mcp-vector-search 0.12.6__py3-none-any.whl → 1.0.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mcp_vector_search/__init__.py +2 -2
- mcp_vector_search/analysis/__init__.py +64 -0
- mcp_vector_search/analysis/collectors/__init__.py +39 -0
- mcp_vector_search/analysis/collectors/base.py +164 -0
- mcp_vector_search/analysis/collectors/complexity.py +743 -0
- mcp_vector_search/analysis/metrics.py +341 -0
- mcp_vector_search/analysis/reporters/__init__.py +5 -0
- mcp_vector_search/analysis/reporters/console.py +222 -0
- mcp_vector_search/cli/commands/analyze.py +408 -0
- mcp_vector_search/cli/commands/chat.py +1262 -0
- mcp_vector_search/cli/commands/index.py +21 -3
- mcp_vector_search/cli/commands/init.py +13 -0
- mcp_vector_search/cli/commands/install.py +597 -335
- mcp_vector_search/cli/commands/install_old.py +8 -4
- mcp_vector_search/cli/commands/mcp.py +78 -6
- mcp_vector_search/cli/commands/reset.py +68 -26
- mcp_vector_search/cli/commands/search.py +30 -7
- mcp_vector_search/cli/commands/setup.py +1133 -0
- mcp_vector_search/cli/commands/status.py +37 -2
- mcp_vector_search/cli/commands/uninstall.py +276 -357
- mcp_vector_search/cli/commands/visualize/__init__.py +39 -0
- mcp_vector_search/cli/commands/visualize/cli.py +276 -0
- mcp_vector_search/cli/commands/visualize/exporters/__init__.py +12 -0
- mcp_vector_search/cli/commands/visualize/exporters/html_exporter.py +33 -0
- mcp_vector_search/cli/commands/visualize/exporters/json_exporter.py +29 -0
- mcp_vector_search/cli/commands/visualize/graph_builder.py +714 -0
- mcp_vector_search/cli/commands/visualize/layout_engine.py +469 -0
- mcp_vector_search/cli/commands/visualize/server.py +311 -0
- mcp_vector_search/cli/commands/visualize/state_manager.py +428 -0
- mcp_vector_search/cli/commands/visualize/templates/__init__.py +16 -0
- mcp_vector_search/cli/commands/visualize/templates/base.py +180 -0
- mcp_vector_search/cli/commands/visualize/templates/scripts.py +2507 -0
- mcp_vector_search/cli/commands/visualize/templates/styles.py +1313 -0
- mcp_vector_search/cli/commands/visualize.py.original +2536 -0
- mcp_vector_search/cli/didyoumean.py +22 -2
- mcp_vector_search/cli/main.py +115 -159
- mcp_vector_search/cli/output.py +24 -8
- mcp_vector_search/config/__init__.py +4 -0
- mcp_vector_search/config/default_thresholds.yaml +52 -0
- mcp_vector_search/config/settings.py +12 -0
- mcp_vector_search/config/thresholds.py +185 -0
- mcp_vector_search/core/auto_indexer.py +3 -3
- mcp_vector_search/core/boilerplate.py +186 -0
- mcp_vector_search/core/config_utils.py +394 -0
- mcp_vector_search/core/database.py +369 -94
- mcp_vector_search/core/exceptions.py +11 -0
- mcp_vector_search/core/git_hooks.py +4 -4
- mcp_vector_search/core/indexer.py +221 -4
- mcp_vector_search/core/llm_client.py +751 -0
- mcp_vector_search/core/models.py +3 -0
- mcp_vector_search/core/project.py +17 -0
- mcp_vector_search/core/scheduler.py +11 -11
- mcp_vector_search/core/search.py +179 -29
- mcp_vector_search/mcp/server.py +24 -5
- mcp_vector_search/utils/__init__.py +2 -0
- mcp_vector_search/utils/gitignore_updater.py +212 -0
- mcp_vector_search/utils/monorepo.py +66 -4
- mcp_vector_search/utils/timing.py +10 -6
- {mcp_vector_search-0.12.6.dist-info → mcp_vector_search-1.0.3.dist-info}/METADATA +182 -52
- mcp_vector_search-1.0.3.dist-info/RECORD +97 -0
- {mcp_vector_search-0.12.6.dist-info → mcp_vector_search-1.0.3.dist-info}/WHEEL +1 -1
- {mcp_vector_search-0.12.6.dist-info → mcp_vector_search-1.0.3.dist-info}/entry_points.txt +1 -0
- mcp_vector_search/cli/commands/visualize.py +0 -1467
- mcp_vector_search-0.12.6.dist-info/RECORD +0 -68
- {mcp_vector_search-0.12.6.dist-info → mcp_vector_search-1.0.3.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
"""Uninstall commands for MCP Vector Search CLI.
|
|
2
2
|
|
|
3
|
-
This module provides commands to remove MCP integrations from various platforms
|
|
3
|
+
This module provides commands to remove MCP integrations from various platforms
|
|
4
|
+
using the py-mcp-installer library.
|
|
4
5
|
|
|
5
6
|
Examples:
|
|
6
|
-
# Remove
|
|
7
|
-
$ mcp-vector-search uninstall
|
|
7
|
+
# Remove from auto-detected platform
|
|
8
|
+
$ mcp-vector-search uninstall mcp
|
|
8
9
|
|
|
9
|
-
# Remove
|
|
10
|
-
$ mcp-vector-search uninstall --
|
|
10
|
+
# Remove from specific platform
|
|
11
|
+
$ mcp-vector-search uninstall mcp --platform cursor
|
|
12
|
+
|
|
13
|
+
# Remove from all platforms
|
|
14
|
+
$ mcp-vector-search uninstall mcp --all
|
|
11
15
|
|
|
12
16
|
# Use alias
|
|
13
|
-
$ mcp-vector-search remove
|
|
17
|
+
$ mcp-vector-search remove mcp
|
|
14
18
|
"""
|
|
15
19
|
|
|
16
|
-
import json
|
|
17
|
-
import shutil
|
|
18
20
|
from pathlib import Path
|
|
19
21
|
|
|
20
22
|
import typer
|
|
21
23
|
from loguru import logger
|
|
24
|
+
|
|
25
|
+
# Import from py-mcp-installer library
|
|
26
|
+
from py_mcp_installer import MCPInstaller, Platform, PlatformDetector, PlatformInfo
|
|
22
27
|
from rich.console import Console
|
|
23
28
|
from rich.panel import Panel
|
|
24
29
|
from rich.table import Table
|
|
@@ -29,7 +34,6 @@ from ..output import (
|
|
|
29
34
|
print_error,
|
|
30
35
|
print_info,
|
|
31
36
|
print_success,
|
|
32
|
-
print_warning,
|
|
33
37
|
)
|
|
34
38
|
|
|
35
39
|
# Create console for rich output
|
|
@@ -41,25 +45,30 @@ uninstall_app = create_enhanced_typer(
|
|
|
41
45
|
|
|
42
46
|
[bold cyan]Usage Patterns:[/bold cyan]
|
|
43
47
|
|
|
44
|
-
[green]1. Remove
|
|
45
|
-
Remove MCP integration from
|
|
46
|
-
[code]$ mcp-vector-search uninstall
|
|
47
|
-
[code]$ mcp-vector-search uninstall cursor[/code]
|
|
48
|
+
[green]1. Remove from Auto-Detected Platform[/green]
|
|
49
|
+
Remove MCP integration from highest confidence platform:
|
|
50
|
+
[code]$ mcp-vector-search uninstall mcp[/code]
|
|
48
51
|
|
|
49
|
-
[green]2. Remove
|
|
52
|
+
[green]2. Remove from Specific Platform[/green]
|
|
53
|
+
Remove from a specific platform:
|
|
54
|
+
[code]$ mcp-vector-search uninstall mcp --platform cursor[/code]
|
|
55
|
+
|
|
56
|
+
[green]3. Remove from All Platforms[/green]
|
|
50
57
|
Remove from all configured platforms:
|
|
51
|
-
[code]$ mcp-vector-search uninstall --all[/code]
|
|
58
|
+
[code]$ mcp-vector-search uninstall mcp --all[/code]
|
|
52
59
|
|
|
53
|
-
[green]
|
|
60
|
+
[green]4. List Current Installations[/green]
|
|
54
61
|
See what's currently configured:
|
|
55
62
|
[code]$ mcp-vector-search uninstall list[/code]
|
|
56
63
|
|
|
57
64
|
[bold cyan]Supported Platforms:[/bold cyan]
|
|
58
|
-
• [green]claude-code[/green] - Claude Code
|
|
59
|
-
• [green]claude-desktop[/green] - Claude Desktop
|
|
60
|
-
• [green]cursor[/green] - Cursor IDE
|
|
61
|
-
• [green]
|
|
62
|
-
• [green]
|
|
65
|
+
• [green]claude-code[/green] - Claude Code
|
|
66
|
+
• [green]claude-desktop[/green] - Claude Desktop
|
|
67
|
+
• [green]cursor[/green] - Cursor IDE
|
|
68
|
+
• [green]auggie[/green] - Auggie
|
|
69
|
+
• [green]codex[/green] - Codex
|
|
70
|
+
• [green]windsurf[/green] - Windsurf IDE
|
|
71
|
+
• [green]gemini-cli[/green] - Gemini CLI
|
|
63
72
|
|
|
64
73
|
[dim]💡 Alias: 'mcp-vector-search remove' works the same way[/dim]
|
|
65
74
|
""",
|
|
@@ -69,149 +78,130 @@ uninstall_app = create_enhanced_typer(
|
|
|
69
78
|
|
|
70
79
|
|
|
71
80
|
# ==============================================================================
|
|
72
|
-
#
|
|
81
|
+
# Helper Functions
|
|
73
82
|
# ==============================================================================
|
|
74
83
|
|
|
75
|
-
SUPPORTED_PLATFORMS = {
|
|
76
|
-
"claude-code": {
|
|
77
|
-
"name": "Claude Code",
|
|
78
|
-
"config_path": ".mcp.json",
|
|
79
|
-
"scope": "project",
|
|
80
|
-
},
|
|
81
|
-
"claude-desktop": {
|
|
82
|
-
"name": "Claude Desktop",
|
|
83
|
-
"config_path": "~/Library/Application Support/Claude/claude_desktop_config.json",
|
|
84
|
-
"scope": "global",
|
|
85
|
-
},
|
|
86
|
-
"cursor": {
|
|
87
|
-
"name": "Cursor",
|
|
88
|
-
"config_path": "~/.cursor/mcp.json",
|
|
89
|
-
"scope": "global",
|
|
90
|
-
},
|
|
91
|
-
"windsurf": {
|
|
92
|
-
"name": "Windsurf",
|
|
93
|
-
"config_path": "~/.codeium/windsurf/mcp_config.json",
|
|
94
|
-
"scope": "global",
|
|
95
|
-
},
|
|
96
|
-
"vscode": {
|
|
97
|
-
"name": "VS Code",
|
|
98
|
-
"config_path": "~/.vscode/mcp.json",
|
|
99
|
-
"scope": "global",
|
|
100
|
-
},
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
def get_platform_config_path(platform: str, project_root: Path) -> Path:
|
|
105
|
-
"""Get the configuration file path for a platform."""
|
|
106
|
-
if platform not in SUPPORTED_PLATFORMS:
|
|
107
|
-
raise ValueError(f"Unsupported platform: {platform}")
|
|
108
|
-
|
|
109
|
-
config_info = SUPPORTED_PLATFORMS[platform]
|
|
110
|
-
config_path_str = config_info["config_path"]
|
|
111
|
-
|
|
112
|
-
if config_info["scope"] == "project":
|
|
113
|
-
return project_root / config_path_str
|
|
114
|
-
else:
|
|
115
|
-
return Path(config_path_str).expanduser()
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
def unconfigure_platform(
|
|
119
|
-
platform: str,
|
|
120
|
-
project_root: Path,
|
|
121
|
-
server_name: str = "mcp-vector-search",
|
|
122
|
-
backup: bool = True,
|
|
123
|
-
) -> bool:
|
|
124
|
-
"""Remove MCP integration from a platform's configuration.
|
|
125
84
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
project_root: Project root directory
|
|
129
|
-
server_name: Name of the MCP server to remove
|
|
130
|
-
backup: Whether to create a backup before modification
|
|
85
|
+
def detect_all_platforms() -> list[PlatformInfo]:
|
|
86
|
+
"""Detect all available platforms on the system.
|
|
131
87
|
|
|
132
88
|
Returns:
|
|
133
|
-
|
|
89
|
+
List of detected platforms with confidence scores
|
|
134
90
|
"""
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
91
|
+
detector = PlatformDetector()
|
|
92
|
+
detected_platforms = []
|
|
93
|
+
|
|
94
|
+
# Try to detect each platform
|
|
95
|
+
platform_detectors = {
|
|
96
|
+
Platform.CLAUDE_CODE: detector.detect_claude_code,
|
|
97
|
+
Platform.CLAUDE_DESKTOP: detector.detect_claude_desktop,
|
|
98
|
+
Platform.CURSOR: detector.detect_cursor,
|
|
99
|
+
Platform.AUGGIE: detector.detect_auggie,
|
|
100
|
+
Platform.CODEX: detector.detect_codex,
|
|
101
|
+
Platform.WINDSURF: detector.detect_windsurf,
|
|
102
|
+
Platform.GEMINI_CLI: detector.detect_gemini_cli,
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
for platform_enum, detector_func in platform_detectors.items():
|
|
106
|
+
try:
|
|
107
|
+
confidence, config_path = detector_func()
|
|
108
|
+
if confidence > 0.0 and config_path:
|
|
109
|
+
# Determine CLI availability
|
|
110
|
+
cli_available = False
|
|
111
|
+
from py_mcp_installer.utils import resolve_command_path
|
|
112
|
+
|
|
113
|
+
if platform_enum in (Platform.CLAUDE_CODE, Platform.CLAUDE_DESKTOP):
|
|
114
|
+
cli_available = resolve_command_path("claude") is not None
|
|
115
|
+
elif platform_enum == Platform.CURSOR:
|
|
116
|
+
cli_available = resolve_command_path("cursor") is not None
|
|
117
|
+
|
|
118
|
+
platform_info = PlatformInfo(
|
|
119
|
+
platform=platform_enum,
|
|
120
|
+
confidence=confidence,
|
|
121
|
+
config_path=config_path,
|
|
122
|
+
cli_available=cli_available,
|
|
123
|
+
)
|
|
124
|
+
detected_platforms.append(platform_info)
|
|
125
|
+
except Exception as e:
|
|
126
|
+
logger.debug(f"Failed to detect {platform_enum.value}: {e}")
|
|
127
|
+
continue
|
|
147
128
|
|
|
148
|
-
|
|
149
|
-
with open(config_path) as f:
|
|
150
|
-
config = json.load(f)
|
|
129
|
+
return detected_platforms
|
|
151
130
|
|
|
152
|
-
# Check if server exists
|
|
153
|
-
if "mcpServers" not in config or server_name not in config["mcpServers"]:
|
|
154
|
-
print_warning(f" ⚠️ Server '{server_name}' not found in {platform} config")
|
|
155
|
-
return False
|
|
156
131
|
|
|
157
|
-
|
|
158
|
-
|
|
132
|
+
def platform_name_to_enum(name: str) -> Platform | None:
|
|
133
|
+
"""Convert platform name to enum.
|
|
159
134
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
del config["mcpServers"]
|
|
135
|
+
Args:
|
|
136
|
+
name: Platform name (e.g., "cursor", "claude-code")
|
|
163
137
|
|
|
164
|
-
|
|
165
|
-
if
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
138
|
+
Returns:
|
|
139
|
+
Platform enum or None if not found
|
|
140
|
+
"""
|
|
141
|
+
name_map = {
|
|
142
|
+
"claude-code": Platform.CLAUDE_CODE,
|
|
143
|
+
"claude-desktop": Platform.CLAUDE_DESKTOP,
|
|
144
|
+
"cursor": Platform.CURSOR,
|
|
145
|
+
"auggie": Platform.AUGGIE,
|
|
146
|
+
"codex": Platform.CODEX,
|
|
147
|
+
"windsurf": Platform.WINDSURF,
|
|
148
|
+
"gemini-cli": Platform.GEMINI_CLI,
|
|
149
|
+
}
|
|
150
|
+
return name_map.get(name.lower())
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def find_configured_platforms() -> list[PlatformInfo]:
|
|
154
|
+
"""Find all platforms that have mcp-vector-search configured.
|
|
173
155
|
|
|
174
|
-
|
|
175
|
-
|
|
156
|
+
Returns:
|
|
157
|
+
List of platforms with mcp-vector-search installed
|
|
158
|
+
"""
|
|
159
|
+
detected = detect_all_platforms()
|
|
160
|
+
configured = []
|
|
176
161
|
|
|
177
|
-
|
|
162
|
+
for platform_info in detected:
|
|
163
|
+
try:
|
|
164
|
+
installer = MCPInstaller(platform=platform_info.platform)
|
|
165
|
+
server = installer.get_server("mcp-vector-search")
|
|
166
|
+
if server:
|
|
167
|
+
configured.append(platform_info)
|
|
168
|
+
except Exception as e:
|
|
169
|
+
logger.debug(
|
|
170
|
+
f"Failed to check {platform_info.platform.value} configuration: {e}"
|
|
171
|
+
)
|
|
172
|
+
continue
|
|
178
173
|
|
|
179
|
-
|
|
180
|
-
logger.error(f"Failed to unconfigure {platform}: {e}")
|
|
181
|
-
print_error(f" ❌ Failed to remove {platform} integration: {e}")
|
|
182
|
-
return False
|
|
174
|
+
return configured
|
|
183
175
|
|
|
184
176
|
|
|
185
|
-
def
|
|
186
|
-
"""
|
|
177
|
+
def uninstall_from_platform(platform_info: PlatformInfo) -> bool:
|
|
178
|
+
"""Uninstall from a specific platform.
|
|
187
179
|
|
|
188
180
|
Args:
|
|
189
|
-
|
|
181
|
+
platform_info: Platform information
|
|
190
182
|
|
|
191
183
|
Returns:
|
|
192
|
-
|
|
184
|
+
True if uninstallation succeeded
|
|
193
185
|
"""
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
for platform in SUPPORTED_PLATFORMS:
|
|
197
|
-
try:
|
|
198
|
-
config_path = get_platform_config_path(platform, project_root)
|
|
199
|
-
|
|
200
|
-
if not config_path.exists():
|
|
201
|
-
continue
|
|
202
|
-
|
|
203
|
-
# Check if mcp-vector-search is in the config
|
|
204
|
-
with open(config_path) as f:
|
|
205
|
-
config = json.load(f)
|
|
186
|
+
try:
|
|
187
|
+
installer = MCPInstaller(platform=platform_info.platform)
|
|
206
188
|
|
|
207
|
-
|
|
208
|
-
|
|
189
|
+
# Uninstall server
|
|
190
|
+
result = installer.uninstall_server("mcp-vector-search")
|
|
209
191
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
192
|
+
if result.success:
|
|
193
|
+
print_success(f" ✅ Removed from {platform_info.platform.value}")
|
|
194
|
+
return True
|
|
195
|
+
else:
|
|
196
|
+
print_error(
|
|
197
|
+
f" ❌ Failed to remove from {platform_info.platform.value}: {result.message}"
|
|
198
|
+
)
|
|
199
|
+
return False
|
|
213
200
|
|
|
214
|
-
|
|
201
|
+
except Exception as e:
|
|
202
|
+
logger.exception(f"Uninstallation from {platform_info.platform.value} failed")
|
|
203
|
+
print_error(f" ❌ Uninstallation failed: {e}")
|
|
204
|
+
return False
|
|
215
205
|
|
|
216
206
|
|
|
217
207
|
# ==============================================================================
|
|
@@ -219,266 +209,195 @@ def find_configured_platforms(project_root: Path) -> dict[str, Path]:
|
|
|
219
209
|
# ==============================================================================
|
|
220
210
|
|
|
221
211
|
|
|
222
|
-
@uninstall_app.
|
|
223
|
-
def
|
|
212
|
+
@uninstall_app.command(name="mcp")
|
|
213
|
+
def uninstall_mcp(
|
|
224
214
|
ctx: typer.Context,
|
|
215
|
+
platform: str | None = typer.Option(
|
|
216
|
+
None,
|
|
217
|
+
"--platform",
|
|
218
|
+
"-p",
|
|
219
|
+
help="Specific platform to uninstall from (e.g., cursor, claude-code)",
|
|
220
|
+
),
|
|
225
221
|
all_platforms: bool = typer.Option(
|
|
226
222
|
False,
|
|
227
223
|
"--all",
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
no_backup: bool = typer.Option(
|
|
231
|
-
False,
|
|
232
|
-
"--no-backup",
|
|
233
|
-
help="Skip creating backup files",
|
|
224
|
+
"-a",
|
|
225
|
+
help="Uninstall from all configured platforms",
|
|
234
226
|
),
|
|
235
227
|
) -> None:
|
|
236
|
-
"""
|
|
228
|
+
"""Remove MCP integration from platforms.
|
|
237
229
|
|
|
238
|
-
|
|
239
|
-
|
|
230
|
+
By default, uninstalls from the highest confidence platform. Use --all to
|
|
231
|
+
remove from all configured platforms.
|
|
240
232
|
|
|
241
233
|
[bold cyan]Examples:[/bold cyan]
|
|
242
234
|
|
|
235
|
+
[green]Remove from auto-detected platform:[/green]
|
|
236
|
+
$ mcp-vector-search uninstall mcp
|
|
237
|
+
|
|
243
238
|
[green]Remove from specific platform:[/green]
|
|
244
|
-
$ mcp-vector-search uninstall
|
|
239
|
+
$ mcp-vector-search uninstall mcp --platform cursor
|
|
245
240
|
|
|
246
241
|
[green]Remove from all platforms:[/green]
|
|
247
|
-
$ mcp-vector-search uninstall --all
|
|
242
|
+
$ mcp-vector-search uninstall mcp --all
|
|
248
243
|
|
|
249
|
-
|
|
250
|
-
$ mcp-vector-search uninstall list
|
|
251
|
-
|
|
252
|
-
[dim]💡 Backup files are created automatically unless --no-backup is used[/dim]
|
|
244
|
+
[dim]💡 Use 'mcp-vector-search uninstall list' to see configured platforms[/dim]
|
|
253
245
|
"""
|
|
254
|
-
# Only run if --all flag is used and no subcommand
|
|
255
|
-
if not all_platforms or ctx.invoked_subcommand is not None:
|
|
256
|
-
return
|
|
257
|
-
|
|
258
246
|
project_root = ctx.obj.get("project_root") or Path.cwd()
|
|
259
247
|
|
|
260
248
|
console.print(
|
|
261
249
|
Panel.fit(
|
|
262
|
-
"[bold yellow]Removing
|
|
250
|
+
"[bold yellow]Removing MCP Integration[/bold yellow]\n"
|
|
263
251
|
f"📁 Project: {project_root}",
|
|
264
252
|
border_style="yellow",
|
|
265
253
|
)
|
|
266
254
|
)
|
|
267
255
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
256
|
+
try:
|
|
257
|
+
# Find configured platforms
|
|
258
|
+
print_info("🔍 Finding configured platforms...")
|
|
259
|
+
configured = find_configured_platforms()
|
|
260
|
+
|
|
261
|
+
if not configured:
|
|
262
|
+
print_info("No MCP integrations found to remove")
|
|
263
|
+
return
|
|
264
|
+
|
|
265
|
+
# Display configured platforms
|
|
266
|
+
table = Table(title="Configured MCP Platforms")
|
|
267
|
+
table.add_column("Platform", style="cyan")
|
|
268
|
+
table.add_column("Config Path", style="green")
|
|
269
|
+
table.add_column("Confidence", style="yellow")
|
|
270
|
+
|
|
271
|
+
for p in configured:
|
|
272
|
+
table.add_row(
|
|
273
|
+
p.platform.value,
|
|
274
|
+
str(p.config_path) if p.config_path else "N/A",
|
|
275
|
+
f"{p.confidence:.2f}",
|
|
276
|
+
)
|
|
277
|
+
|
|
278
|
+
console.print(table)
|
|
279
|
+
|
|
280
|
+
# Filter platforms
|
|
281
|
+
target_platforms = configured
|
|
282
|
+
|
|
283
|
+
if platform:
|
|
284
|
+
# Uninstall from specific platform
|
|
285
|
+
platform_enum = platform_name_to_enum(platform)
|
|
286
|
+
if not platform_enum:
|
|
287
|
+
print_error(f"Unknown platform: {platform}")
|
|
288
|
+
print_info(
|
|
289
|
+
"Supported: claude-code, claude-desktop, cursor, auggie, codex, windsurf, gemini-cli"
|
|
290
|
+
)
|
|
291
|
+
raise typer.Exit(1)
|
|
292
|
+
|
|
293
|
+
target_platforms = [p for p in configured if p.platform == platform_enum]
|
|
294
|
+
|
|
295
|
+
if not target_platforms:
|
|
296
|
+
print_error(
|
|
297
|
+
f"Platform '{platform}' does not have mcp-vector-search configured"
|
|
298
|
+
)
|
|
299
|
+
raise typer.Exit(1)
|
|
300
|
+
|
|
301
|
+
elif not all_platforms:
|
|
302
|
+
# By default, uninstall from highest confidence platform only
|
|
303
|
+
if configured:
|
|
304
|
+
max_confidence_platform = max(configured, key=lambda p: p.confidence)
|
|
305
|
+
target_platforms = [max_confidence_platform]
|
|
306
|
+
print_info(
|
|
307
|
+
f"Removing from highest confidence platform: {max_confidence_platform.platform.value}"
|
|
308
|
+
)
|
|
309
|
+
print_info("Use --all to remove from all configured platforms")
|
|
310
|
+
|
|
311
|
+
# Show what will be removed
|
|
312
|
+
console.print("\n[bold]Target platforms:[/bold]")
|
|
313
|
+
for p in target_platforms:
|
|
314
|
+
console.print(f" • {p.platform.value}")
|
|
315
|
+
|
|
316
|
+
# Confirm removal if multiple platforms
|
|
317
|
+
if len(target_platforms) > 1:
|
|
318
|
+
if not confirm_action("\nRemove from all these platforms?", default=False):
|
|
319
|
+
print_info("Cancelled")
|
|
320
|
+
raise typer.Exit(0)
|
|
321
|
+
|
|
322
|
+
# Uninstall from each platform
|
|
323
|
+
console.print("\n[bold]Removing integrations...[/bold]")
|
|
324
|
+
successful = 0
|
|
325
|
+
failed = 0
|
|
326
|
+
|
|
327
|
+
for platform_info in target_platforms:
|
|
328
|
+
if uninstall_from_platform(platform_info):
|
|
329
|
+
successful += 1
|
|
330
|
+
else:
|
|
331
|
+
failed += 1
|
|
332
|
+
|
|
333
|
+
# Summary
|
|
334
|
+
console.print("\n[bold green]✨ Removal Summary[/bold green]")
|
|
335
|
+
console.print(f" ✅ Successful: {successful}")
|
|
336
|
+
if failed > 0:
|
|
337
|
+
console.print(f" ❌ Failed: {failed}")
|
|
338
|
+
|
|
339
|
+
console.print("\n[dim]💡 Restart your AI coding tool to apply changes[/dim]")
|
|
340
|
+
|
|
341
|
+
except typer.Exit:
|
|
342
|
+
raise
|
|
343
|
+
except Exception as e:
|
|
344
|
+
logger.exception("MCP uninstallation failed")
|
|
345
|
+
print_error(f"Uninstallation failed: {e}")
|
|
346
|
+
raise typer.Exit(1)
|
|
306
347
|
|
|
307
348
|
|
|
308
349
|
# ==============================================================================
|
|
309
|
-
#
|
|
350
|
+
# List Configured Platforms Command
|
|
310
351
|
# ==============================================================================
|
|
311
352
|
|
|
312
353
|
|
|
313
|
-
@uninstall_app.command("claude-code")
|
|
314
|
-
def uninstall_claude_code(
|
|
315
|
-
ctx: typer.Context,
|
|
316
|
-
no_backup: bool = typer.Option(False, "--no-backup", help="Skip backup creation"),
|
|
317
|
-
) -> None:
|
|
318
|
-
"""Remove Claude Code MCP integration (project-scoped)."""
|
|
319
|
-
project_root = ctx.obj.get("project_root") or Path.cwd()
|
|
320
|
-
|
|
321
|
-
console.print(
|
|
322
|
-
Panel.fit(
|
|
323
|
-
"[bold yellow]Removing Claude Code Integration[/bold yellow]\n"
|
|
324
|
-
"📁 Project-scoped configuration",
|
|
325
|
-
border_style="yellow",
|
|
326
|
-
)
|
|
327
|
-
)
|
|
328
|
-
|
|
329
|
-
success = unconfigure_platform("claude-code", project_root, backup=not no_backup)
|
|
330
|
-
|
|
331
|
-
if success:
|
|
332
|
-
console.print("\n[bold green]✅ Claude Code Integration Removed[/bold green]")
|
|
333
|
-
console.print("\n[dim]💡 Restart Claude Code to apply changes[/dim]")
|
|
334
|
-
else:
|
|
335
|
-
raise typer.Exit(1)
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
@uninstall_app.command("cursor")
|
|
339
|
-
def uninstall_cursor(
|
|
340
|
-
ctx: typer.Context,
|
|
341
|
-
no_backup: bool = typer.Option(False, "--no-backup"),
|
|
342
|
-
) -> None:
|
|
343
|
-
"""Remove Cursor IDE MCP integration (global)."""
|
|
344
|
-
project_root = ctx.obj.get("project_root") or Path.cwd()
|
|
345
|
-
|
|
346
|
-
console.print(
|
|
347
|
-
Panel.fit(
|
|
348
|
-
"[bold yellow]Removing Cursor Integration[/bold yellow]\n"
|
|
349
|
-
"🌐 Global configuration",
|
|
350
|
-
border_style="yellow",
|
|
351
|
-
)
|
|
352
|
-
)
|
|
353
|
-
|
|
354
|
-
success = unconfigure_platform("cursor", project_root, backup=not no_backup)
|
|
355
|
-
|
|
356
|
-
if success:
|
|
357
|
-
console.print("\n[bold green]✅ Cursor Integration Removed[/bold green]")
|
|
358
|
-
console.print("\n[dim]💡 Restart Cursor to apply changes[/dim]")
|
|
359
|
-
else:
|
|
360
|
-
raise typer.Exit(1)
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
@uninstall_app.command("windsurf")
|
|
364
|
-
def uninstall_windsurf(
|
|
365
|
-
ctx: typer.Context,
|
|
366
|
-
no_backup: bool = typer.Option(False, "--no-backup"),
|
|
367
|
-
) -> None:
|
|
368
|
-
"""Remove Windsurf IDE MCP integration (global)."""
|
|
369
|
-
project_root = ctx.obj.get("project_root") or Path.cwd()
|
|
370
|
-
|
|
371
|
-
console.print(
|
|
372
|
-
Panel.fit(
|
|
373
|
-
"[bold yellow]Removing Windsurf Integration[/bold yellow]\n"
|
|
374
|
-
"🌐 Global configuration",
|
|
375
|
-
border_style="yellow",
|
|
376
|
-
)
|
|
377
|
-
)
|
|
378
|
-
|
|
379
|
-
success = unconfigure_platform("windsurf", project_root, backup=not no_backup)
|
|
380
|
-
|
|
381
|
-
if success:
|
|
382
|
-
console.print("\n[bold green]✅ Windsurf Integration Removed[/bold green]")
|
|
383
|
-
console.print("\n[dim]💡 Restart Windsurf to apply changes[/dim]")
|
|
384
|
-
else:
|
|
385
|
-
raise typer.Exit(1)
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
@uninstall_app.command("claude-desktop")
|
|
389
|
-
def uninstall_claude_desktop(
|
|
390
|
-
ctx: typer.Context,
|
|
391
|
-
no_backup: bool = typer.Option(False, "--no-backup"),
|
|
392
|
-
) -> None:
|
|
393
|
-
"""Remove Claude Desktop MCP integration (global)."""
|
|
394
|
-
project_root = ctx.obj.get("project_root") or Path.cwd()
|
|
395
|
-
|
|
396
|
-
console.print(
|
|
397
|
-
Panel.fit(
|
|
398
|
-
"[bold yellow]Removing Claude Desktop Integration[/bold yellow]\n"
|
|
399
|
-
"🌐 Global configuration",
|
|
400
|
-
border_style="yellow",
|
|
401
|
-
)
|
|
402
|
-
)
|
|
403
|
-
|
|
404
|
-
success = unconfigure_platform("claude-desktop", project_root, backup=not no_backup)
|
|
405
|
-
|
|
406
|
-
if success:
|
|
407
|
-
console.print(
|
|
408
|
-
"\n[bold green]✅ Claude Desktop Integration Removed[/bold green]"
|
|
409
|
-
)
|
|
410
|
-
console.print("\n[dim]💡 Restart Claude Desktop to apply changes[/dim]")
|
|
411
|
-
else:
|
|
412
|
-
raise typer.Exit(1)
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
@uninstall_app.command("vscode")
|
|
416
|
-
def uninstall_vscode(
|
|
417
|
-
ctx: typer.Context,
|
|
418
|
-
no_backup: bool = typer.Option(False, "--no-backup"),
|
|
419
|
-
) -> None:
|
|
420
|
-
"""Remove VS Code MCP integration (global)."""
|
|
421
|
-
project_root = ctx.obj.get("project_root") or Path.cwd()
|
|
422
|
-
|
|
423
|
-
console.print(
|
|
424
|
-
Panel.fit(
|
|
425
|
-
"[bold yellow]Removing VS Code Integration[/bold yellow]\n"
|
|
426
|
-
"🌐 Global configuration",
|
|
427
|
-
border_style="yellow",
|
|
428
|
-
)
|
|
429
|
-
)
|
|
430
|
-
|
|
431
|
-
success = unconfigure_platform("vscode", project_root, backup=not no_backup)
|
|
432
|
-
|
|
433
|
-
if success:
|
|
434
|
-
console.print("\n[bold green]✅ VS Code Integration Removed[/bold green]")
|
|
435
|
-
console.print("\n[dim]💡 Restart VS Code to apply changes[/dim]")
|
|
436
|
-
else:
|
|
437
|
-
raise typer.Exit(1)
|
|
438
|
-
|
|
439
|
-
|
|
440
354
|
@uninstall_app.command("list")
|
|
441
355
|
def list_integrations(ctx: typer.Context) -> None:
|
|
442
356
|
"""List all currently configured MCP integrations."""
|
|
443
|
-
project_root = ctx.obj.get("project_root") or Path.cwd()
|
|
444
|
-
|
|
445
357
|
console.print(
|
|
446
358
|
Panel.fit(
|
|
447
359
|
"[bold cyan]Configured MCP Integrations[/bold cyan]", border_style="cyan"
|
|
448
360
|
)
|
|
449
361
|
)
|
|
450
362
|
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
363
|
+
try:
|
|
364
|
+
configured = find_configured_platforms()
|
|
365
|
+
|
|
366
|
+
if not configured:
|
|
367
|
+
console.print("\n[yellow]No MCP integrations configured[/yellow]")
|
|
368
|
+
console.print(
|
|
369
|
+
"\n[dim]Use 'mcp-vector-search install mcp' to add integrations[/dim]"
|
|
370
|
+
)
|
|
371
|
+
return
|
|
372
|
+
|
|
373
|
+
table = Table(show_header=True, header_style="bold cyan")
|
|
374
|
+
table.add_column("Platform", style="cyan")
|
|
375
|
+
table.add_column("Config Path")
|
|
376
|
+
table.add_column("Confidence", style="yellow")
|
|
377
|
+
table.add_column("Removal Command", style="dim")
|
|
378
|
+
|
|
379
|
+
for platform_info in configured:
|
|
380
|
+
table.add_row(
|
|
381
|
+
platform_info.platform.value,
|
|
382
|
+
str(platform_info.config_path) if platform_info.config_path else "N/A",
|
|
383
|
+
f"{platform_info.confidence:.2f}",
|
|
384
|
+
f"mcp-vector-search uninstall mcp --platform {platform_info.platform.value}",
|
|
385
|
+
)
|
|
386
|
+
|
|
387
|
+
console.print(table)
|
|
388
|
+
|
|
389
|
+
console.print("\n[bold blue]Removal Options:[/bold blue]")
|
|
455
390
|
console.print(
|
|
456
|
-
"
|
|
391
|
+
" • Remove specific: [code]mcp-vector-search uninstall mcp --platform <name>[/code]"
|
|
457
392
|
)
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
table = Table(show_header=True, header_style="bold cyan")
|
|
461
|
-
table.add_column("Platform", style="cyan")
|
|
462
|
-
table.add_column("Name")
|
|
463
|
-
table.add_column("Config Location")
|
|
464
|
-
table.add_column("Removal Command", style="dim")
|
|
465
|
-
|
|
466
|
-
for platform, config_path in configured.items():
|
|
467
|
-
platform_info = SUPPORTED_PLATFORMS[platform]
|
|
468
|
-
table.add_row(
|
|
469
|
-
platform,
|
|
470
|
-
platform_info["name"],
|
|
471
|
-
str(config_path),
|
|
472
|
-
f"mcp-vector-search uninstall {platform}",
|
|
393
|
+
console.print(
|
|
394
|
+
" • Remove all: [code]mcp-vector-search uninstall mcp --all[/code]"
|
|
473
395
|
)
|
|
474
396
|
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
" • Remove specific: [code]mcp-vector-search uninstall <platform>[/code]"
|
|
480
|
-
)
|
|
481
|
-
console.print(" • Remove all: [code]mcp-vector-search uninstall --all[/code]")
|
|
397
|
+
except Exception as e:
|
|
398
|
+
logger.exception("Failed to list configured platforms")
|
|
399
|
+
print_error(f"Failed to list configured platforms: {e}")
|
|
400
|
+
raise typer.Exit(1)
|
|
482
401
|
|
|
483
402
|
|
|
484
403
|
if __name__ == "__main__":
|