open-edison 0.1.36__py3-none-any.whl → 0.1.37__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.
- {open_edison-0.1.36.dist-info → open_edison-0.1.37.dist-info}/METADATA +48 -2
- open_edison-0.1.37.dist-info/RECORD +35 -0
- open_edison-0.1.37.dist-info/entry_points.txt +5 -0
- src/__init__.py +4 -7
- src/mcp_importer/__init__.py +15 -0
- src/mcp_importer/__main__.py +19 -0
- src/mcp_importer/api.py +106 -0
- src/mcp_importer/cli.py +113 -0
- src/mcp_importer/export_cli.py +201 -0
- src/mcp_importer/exporters.py +393 -0
- src/mcp_importer/import_api.py +3 -0
- src/mcp_importer/importers.py +63 -0
- src/mcp_importer/merge.py +47 -0
- src/mcp_importer/parsers.py +148 -0
- src/mcp_importer/paths.py +92 -0
- src/mcp_importer/quick_cli.py +65 -0
- src/mcp_importer/types.py +5 -0
- open_edison-0.1.36.dist-info/RECORD +0 -22
- open_edison-0.1.36.dist-info/entry_points.txt +0 -3
- {open_edison-0.1.36.dist-info → open_edison-0.1.37.dist-info}/WHEEL +0 -0
- {open_edison-0.1.36.dist-info → open_edison-0.1.37.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,92 @@
|
|
1
|
+
import os
|
2
|
+
import sys
|
3
|
+
from pathlib import Path
|
4
|
+
|
5
|
+
|
6
|
+
def is_windows() -> bool:
|
7
|
+
return os.name == "nt"
|
8
|
+
|
9
|
+
|
10
|
+
def is_macos() -> bool:
|
11
|
+
return sys.platform == "darwin"
|
12
|
+
|
13
|
+
|
14
|
+
def find_cursor_user_file() -> list[Path]:
|
15
|
+
"""Find user-level Cursor MCP config (~/.cursor/mcp.json)."""
|
16
|
+
p = (Path.home() / ".cursor" / "mcp.json").resolve()
|
17
|
+
return [p] if p.exists() else []
|
18
|
+
|
19
|
+
|
20
|
+
def find_vscode_user_mcp_file() -> list[Path]:
|
21
|
+
"""Find VSCode user-level MCP config (User/mcp.json) on macOS or Linux."""
|
22
|
+
if is_macos():
|
23
|
+
p = Path.home() / "Library" / "Application Support" / "Code" / "User" / "mcp.json"
|
24
|
+
else:
|
25
|
+
p = Path.home() / ".config" / "Code" / "User" / "mcp.json"
|
26
|
+
p = p.resolve()
|
27
|
+
return [p] if p.exists() else []
|
28
|
+
|
29
|
+
|
30
|
+
def find_claude_code_user_settings_file() -> list[Path]:
|
31
|
+
"""Find Claude Code user-level settings (~/.claude/settings.json)."""
|
32
|
+
p = (Path.home() / ".claude" / "settings.json").resolve()
|
33
|
+
return [p] if p.exists() else []
|
34
|
+
|
35
|
+
|
36
|
+
def find_claude_code_user_all_candidates() -> list[Path]:
|
37
|
+
"""Return ordered list of Claude Code user-level MCP config candidates.
|
38
|
+
|
39
|
+
Based on docs, check in priority order:
|
40
|
+
- ~/.claude.json (primary user-level)
|
41
|
+
- ~/.claude/settings.json
|
42
|
+
- ~/.claude/settings.local.json
|
43
|
+
- ~/.claude/mcp_servers.json
|
44
|
+
"""
|
45
|
+
home = Path.home()
|
46
|
+
candidates: list[Path] = [
|
47
|
+
home / ".claude.json",
|
48
|
+
home / ".claude" / "settings.json",
|
49
|
+
home / ".claude" / "settings.local.json",
|
50
|
+
home / ".claude" / "mcp_servers.json",
|
51
|
+
]
|
52
|
+
existing: list[Path] = []
|
53
|
+
for p in candidates:
|
54
|
+
rp = p.resolve()
|
55
|
+
if rp.exists():
|
56
|
+
existing.append(rp)
|
57
|
+
return existing
|
58
|
+
|
59
|
+
|
60
|
+
# Shared utils for CLI import/export
|
61
|
+
|
62
|
+
|
63
|
+
def detect_cursor_config_path() -> Path | None:
|
64
|
+
files = find_cursor_user_file()
|
65
|
+
return files[0] if files else None
|
66
|
+
|
67
|
+
|
68
|
+
def detect_vscode_config_path() -> Path | None:
|
69
|
+
files = find_vscode_user_mcp_file()
|
70
|
+
return files[0] if files else None
|
71
|
+
|
72
|
+
|
73
|
+
def get_default_vscode_config_path() -> Path:
|
74
|
+
if is_macos():
|
75
|
+
return (
|
76
|
+
Path.home() / "Library" / "Application Support" / "Code" / "User" / "mcp.json"
|
77
|
+
).resolve()
|
78
|
+
return (Path.home() / ".config" / "Code" / "User" / "mcp.json").resolve()
|
79
|
+
|
80
|
+
|
81
|
+
def get_default_cursor_config_path() -> Path:
|
82
|
+
return (Path.home() / ".cursor" / "mcp.json").resolve()
|
83
|
+
|
84
|
+
|
85
|
+
def detect_claude_code_config_path() -> Path | None:
|
86
|
+
candidates = find_claude_code_user_all_candidates()
|
87
|
+
return candidates[0] if candidates else None
|
88
|
+
|
89
|
+
|
90
|
+
def get_default_claude_code_config_path() -> Path:
|
91
|
+
# Prefer top-level ~/.claude.json as default create target
|
92
|
+
return (Path.home() / ".claude.json").resolve()
|
@@ -0,0 +1,65 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
3
|
+
import argparse
|
4
|
+
from collections.abc import Iterable
|
5
|
+
|
6
|
+
from mcp_importer.api import (
|
7
|
+
CLIENT,
|
8
|
+
detect_clients,
|
9
|
+
export_edison_to,
|
10
|
+
import_from,
|
11
|
+
save_imported_servers,
|
12
|
+
)
|
13
|
+
|
14
|
+
|
15
|
+
def _pick_first(iterable: Iterable[CLIENT]) -> CLIENT | None:
|
16
|
+
for item in iterable:
|
17
|
+
return item
|
18
|
+
return None
|
19
|
+
|
20
|
+
|
21
|
+
def run_cli(argv: list[str] | None = None) -> int:
|
22
|
+
parser = argparse.ArgumentParser(
|
23
|
+
description=(
|
24
|
+
"Detect a client, import its servers into Open Edison, and export Open Edison back to it."
|
25
|
+
)
|
26
|
+
)
|
27
|
+
parser.add_argument("--dry-run", action="store_true", help="Preview actions without writing")
|
28
|
+
parser.add_argument("--yes", action="store_true", help="Skip confirmations (no effect here)")
|
29
|
+
args = parser.parse_args(argv)
|
30
|
+
|
31
|
+
detected = detect_clients()
|
32
|
+
client = _pick_first(detected)
|
33
|
+
if client is None:
|
34
|
+
print("No supported clients detected.")
|
35
|
+
return 2
|
36
|
+
|
37
|
+
servers = import_from(client)
|
38
|
+
if not servers:
|
39
|
+
print(f"No servers found to import from '{client.value}'.")
|
40
|
+
return 0
|
41
|
+
|
42
|
+
if args.dry_run:
|
43
|
+
print(
|
44
|
+
f"[dry-run] Would import {len(servers)} server(s) from '{client.value}' and save to config.json"
|
45
|
+
)
|
46
|
+
# Exercise export path safely (no writes)
|
47
|
+
export_edison_to(client, dry_run=True, force=True, create_if_missing=True)
|
48
|
+
print(
|
49
|
+
f"[dry-run] Would export Open Edison to '{client.value}' (backup and replace editor MCP config)"
|
50
|
+
)
|
51
|
+
print("Dry-run complete.")
|
52
|
+
return 0
|
53
|
+
|
54
|
+
save_imported_servers(servers)
|
55
|
+
export_edison_to(client, dry_run=False, force=True, create_if_missing=True)
|
56
|
+
print(f"Completed quick import/export for {client.value}.")
|
57
|
+
return 0
|
58
|
+
|
59
|
+
|
60
|
+
def main(argv: list[str] | None = None) -> int:
|
61
|
+
return run_cli(argv)
|
62
|
+
|
63
|
+
|
64
|
+
if __name__ == "__main__":
|
65
|
+
raise SystemExit(main())
|
@@ -1,22 +0,0 @@
|
|
1
|
-
src/__init__.py,sha256=QWeZdjAm2D2B0eWhd8m2-DPpWvIP26KcNJxwEoU1oEQ,254
|
2
|
-
src/__main__.py,sha256=kQsaVyzRa_ESC57JpKDSQJAHExuXme0rM5beJsYxFeA,161
|
3
|
-
src/cli.py,sha256=P38IWER41S5oAfbd_7p89hBpnjClsNHpmE5pSsJc6uU,9733
|
4
|
-
src/config.py,sha256=RSsAYzl8cj6eaDN1RORMcfKKWBcp4bKTQp2BdhAL9mg,10258
|
5
|
-
src/config.pyi,sha256=FgehEGli8ZXSjGlANBgMGv5497q4XskQciOc1fUcxqM,2033
|
6
|
-
src/events.py,sha256=aFQrVXDIZwt55Dz6OtyoXu2yi9evqo-8jZzo3CR2Tto,4965
|
7
|
-
src/oauth_manager.py,sha256=qcQa5BDRZr4bjqiXNflCnrXOh9mo9JVjvP2Caseg2Uc,9943
|
8
|
-
src/permissions.py,sha256=NGAnlG_z59HEiVA-k3cYvwmmiuHzxuNb5Tbd5umbL00,10483
|
9
|
-
src/server.py,sha256=cnO5bgxT-lrfuwk9AIvB_HBV8SWOtFClfGUn5_zFWyo,45652
|
10
|
-
src/single_user_mcp.py,sha256=rJrlqHcIubGkos_24ux5rb3OoKYDzvagCHghhfDeXTI,18535
|
11
|
-
src/telemetry.py,sha256=-RZPIjpI53zbsKmp-63REeZ1JirWHV5WvpSRa2nqZEk,11321
|
12
|
-
src/frontend_dist/index.html,sha256=s95FMkH8VLisvawLH7bZxbLzRUFvMhHkH6ZMzpVBngs,673
|
13
|
-
src/frontend_dist/sw.js,sha256=rihX1es-vWwjmtnXyaksJjs2dio6MVAOTAWwQPeJUYw,2164
|
14
|
-
src/frontend_dist/assets/index-BUUcUfTt.js,sha256=awoyPI6u0v6ao2iarZdSkrSDUvyU8aNkMLqHMvgVgyY,257666
|
15
|
-
src/frontend_dist/assets/index-o6_8mdM8.css,sha256=nwmX_6q55mB9463XN2JM8BdeihjkALpQK83Fc3_iGvE,15936
|
16
|
-
src/middleware/data_access_tracker.py,sha256=bArBffWgYmvxOx9z_pgXQhogvnWQcc1m6WvEblDD4gw,15039
|
17
|
-
src/middleware/session_tracking.py,sha256=5W1VH9HNqIZeX0HNxDEm41U4GY6SqKSXtApDEeZK2qo,23084
|
18
|
-
open_edison-0.1.36.dist-info/METADATA,sha256=o3ys6S2yDzXOQXKUqJ43lArMvpxeUYYqwDnOAqbl5gs,11915
|
19
|
-
open_edison-0.1.36.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
20
|
-
open_edison-0.1.36.dist-info/entry_points.txt,sha256=qNAkJcnoTXRhj8J--3PDmXz_TQKdB8H_0C9wiCtDIyA,72
|
21
|
-
open_edison-0.1.36.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
22
|
-
open_edison-0.1.36.dist-info/RECORD,,
|
File without changes
|
File without changes
|