contextl 1.2.35 → 1.2.36
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.
- package/package.json +3 -3
- package/python/installer.py +85 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contextl",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.36",
|
|
4
4
|
"description": "contextl — finds the most relevant files in your codebase for any change request. MCP server for AI coding agents.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"files": [
|
|
32
32
|
"bin/",
|
|
33
33
|
"python/",
|
|
34
|
-
"README.md",
|
|
34
|
+
"README.md",
|
|
35
|
+
"requirements.txt"
|
|
35
36
|
],
|
|
36
|
-
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">=18"
|
|
39
39
|
},
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import json
|
|
3
|
+
import platform
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
def install_mcp():
|
|
7
|
+
home = Path.home()
|
|
8
|
+
system = platform.system()
|
|
9
|
+
|
|
10
|
+
# Define common MCP configuration paths
|
|
11
|
+
targets = []
|
|
12
|
+
|
|
13
|
+
# 1. Antigravity
|
|
14
|
+
targets.append(home / ".gemini" / "antigravity" / "mcp_config.json")
|
|
15
|
+
|
|
16
|
+
# 2. Claude Desktop
|
|
17
|
+
if system == "Darwin":
|
|
18
|
+
targets.append(home / "Library" / "Application Support" / "Claude" / "claude_desktop_config.json")
|
|
19
|
+
elif system == "Windows":
|
|
20
|
+
appdata = os.environ.get("APPDATA", "")
|
|
21
|
+
if appdata:
|
|
22
|
+
targets.append(Path(appdata) / "Claude" / "claude_desktop_config.json")
|
|
23
|
+
else:
|
|
24
|
+
# Linux
|
|
25
|
+
targets.append(home / ".config" / "Claude" / "claude_desktop_config.json")
|
|
26
|
+
|
|
27
|
+
# 3. Cline / Roo (VSCode)
|
|
28
|
+
targets.append(home / "Documents" / "Cline" / "cline_mcp_settings.json")
|
|
29
|
+
if system == "Darwin":
|
|
30
|
+
targets.append(home / "Library" / "Application Support" / "Code" / "User" / "globalStorage" / "rooveterinaryinc.roo-cline" / "settings" / "cline_mcp_settings.json")
|
|
31
|
+
elif system == "Windows":
|
|
32
|
+
appdata = os.environ.get("APPDATA", "")
|
|
33
|
+
if appdata:
|
|
34
|
+
targets.append(Path(appdata) / "Code" / "User" / "globalStorage" / "rooveterinaryinc.roo-cline" / "settings" / "cline_mcp_settings.json")
|
|
35
|
+
else:
|
|
36
|
+
targets.append(home / ".config" / "Code" / "User" / "globalStorage" / "rooveterinaryinc.roo-cline" / "settings" / "cline_mcp_settings.json")
|
|
37
|
+
|
|
38
|
+
# 4. Cursor
|
|
39
|
+
targets.append(home / ".cursor" / "mcp.json")
|
|
40
|
+
|
|
41
|
+
success_count = 0
|
|
42
|
+
|
|
43
|
+
for path in targets:
|
|
44
|
+
if path.exists():
|
|
45
|
+
try:
|
|
46
|
+
# Read config
|
|
47
|
+
with open(path, "r", encoding="utf-8") as f:
|
|
48
|
+
content = f.read()
|
|
49
|
+
if not content.strip():
|
|
50
|
+
config = {}
|
|
51
|
+
else:
|
|
52
|
+
config = json.loads(content)
|
|
53
|
+
|
|
54
|
+
# Ensure mcpServers key exists
|
|
55
|
+
if "mcpServers" not in config:
|
|
56
|
+
config["mcpServers"] = {}
|
|
57
|
+
|
|
58
|
+
# Inject contextl
|
|
59
|
+
config["mcpServers"]["contextl"] = {
|
|
60
|
+
"command": "npx",
|
|
61
|
+
"args": ["-y", "contextl"]
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
# Write config
|
|
65
|
+
with open(path, "w", encoding="utf-8") as f:
|
|
66
|
+
json.dump(config, f, indent=2)
|
|
67
|
+
|
|
68
|
+
print(f"✅ Successfully injected ContextL MCP Server into: {path}")
|
|
69
|
+
success_count += 1
|
|
70
|
+
except Exception as e:
|
|
71
|
+
print(f"❌ Failed to parse or write to {path}: {e}")
|
|
72
|
+
|
|
73
|
+
if success_count > 0:
|
|
74
|
+
print("\nInstallation successful! Please restart your IDE or AI Client (e.g. reload the window) for the changes to take effect.")
|
|
75
|
+
else:
|
|
76
|
+
print("No supported MCP configuration files were found automatically.")
|
|
77
|
+
print("You may need to manually add the following JSON to your MCP configuration:")
|
|
78
|
+
print(json.dumps({
|
|
79
|
+
"mcpServers": {
|
|
80
|
+
"contextl": {
|
|
81
|
+
"command": "npx",
|
|
82
|
+
"args": ["-y", "contextl"]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}, indent=2))
|