mcp_manager 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/lib/mcp_manager/server.rb +45 -6
- data/lib/mcp_manager/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b5a418ec472278ef22b265f95e6ee77993bfbef7a4062ada8776c3375e63392
|
4
|
+
data.tar.gz: 839360bd30dd8d99d5aa39625c21f0d7357007534b917a44e2769945080b5744
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a57526cf3dd7247a02087e32a9f21bf3227e653be8edf9b1f14076cdd1bc09d89513883c951c575f93973536250d4ae6e99fa55bb8e32af10d555845d500c20f
|
7
|
+
data.tar.gz: 2b676d4558467aca181e095da5878b41c3d063f549038cfd79c423b72b515e165999dde820d9942cc0013208a0b23788bd48127668de455a1031b629ba8b33fa
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
+
## [0.1.1] - 2025-08-28
|
9
|
+
|
10
|
+
### Fixed
|
11
|
+
- Enhanced error handling for install and uninstall commands
|
12
|
+
- Handle nil values in system call checks
|
13
|
+
|
14
|
+
### Changed
|
15
|
+
- Improved config initialization and lazy loading
|
16
|
+
- Updated dependencies and GitHub repository links
|
17
|
+
- Updated author details with full name and contact email
|
18
|
+
|
8
19
|
## [0.1.0] - 2025-08-28
|
9
20
|
|
10
21
|
### Added
|
@@ -23,4 +34,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
23
34
|
- Command aliases: `add`, `remove`, `rm`
|
24
35
|
- Help and version flags
|
25
36
|
|
37
|
+
[0.1.1]: https://github.com/ben/mcp-manager/releases/tag/v0.1.1
|
26
38
|
[0.1.0]: https://github.com/ben/mcp-manager/releases/tag/v0.1.0
|
data/lib/mcp_manager/server.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'stringio'
|
2
|
+
|
1
3
|
module McpManager
|
2
4
|
class Server
|
3
5
|
attr_reader :name, :config
|
@@ -24,12 +26,16 @@ module McpManager
|
|
24
26
|
puts "ℹ️ Description: #{description}"
|
25
27
|
puts "ℹ️ Executing: #{command}"
|
26
28
|
|
27
|
-
|
28
|
-
|
29
|
+
stderr_output = capture_stderr do
|
30
|
+
system(command, out: File::NULL)
|
31
|
+
end
|
32
|
+
|
33
|
+
if $CHILD_STATUS&.success?
|
29
34
|
puts "✅ Successfully installed #{@name}"
|
30
35
|
true
|
31
36
|
else
|
32
|
-
|
37
|
+
error_message = build_error_message("install", stderr_output)
|
38
|
+
puts "❌ Failed to install #{@name}: #{error_message}"
|
33
39
|
false
|
34
40
|
end
|
35
41
|
end
|
@@ -40,12 +46,16 @@ module McpManager
|
|
40
46
|
uninstall_command = "claude mcp remove #{@name}"
|
41
47
|
puts "ℹ️ Executing: #{uninstall_command}"
|
42
48
|
|
43
|
-
|
44
|
-
|
49
|
+
stderr_output = capture_stderr do
|
50
|
+
system(uninstall_command, out: File::NULL)
|
51
|
+
end
|
52
|
+
|
53
|
+
if $CHILD_STATUS&.success?
|
45
54
|
puts "✅ Successfully uninstalled #{@name}"
|
46
55
|
true
|
47
56
|
else
|
48
|
-
|
57
|
+
error_message = build_error_message("uninstall", stderr_output)
|
58
|
+
puts "❌ Failed to uninstall #{@name}: #{error_message}"
|
49
59
|
false
|
50
60
|
end
|
51
61
|
end
|
@@ -53,5 +63,34 @@ module McpManager
|
|
53
63
|
def to_s
|
54
64
|
"#{@name}: #{description}"
|
55
65
|
end
|
66
|
+
|
67
|
+
private
|
68
|
+
|
69
|
+
def capture_stderr
|
70
|
+
original_stderr = $stderr
|
71
|
+
$stderr = StringIO.new
|
72
|
+
yield
|
73
|
+
$stderr.string
|
74
|
+
ensure
|
75
|
+
$stderr = original_stderr
|
76
|
+
end
|
77
|
+
|
78
|
+
def build_error_message(operation, stderr_output)
|
79
|
+
if $CHILD_STATUS.nil?
|
80
|
+
"process status unavailable"
|
81
|
+
elsif $CHILD_STATUS.respond_to?(:exitstatus) && $CHILD_STATUS.exitstatus
|
82
|
+
message = "command failed with exit code #{$CHILD_STATUS.exitstatus}"
|
83
|
+
if stderr_output && !stderr_output.strip.empty?
|
84
|
+
message += " (#{stderr_output.strip})"
|
85
|
+
end
|
86
|
+
message
|
87
|
+
else
|
88
|
+
message = "command failed"
|
89
|
+
if stderr_output && !stderr_output.strip.empty?
|
90
|
+
message += " (#{stderr_output.strip})"
|
91
|
+
end
|
92
|
+
message
|
93
|
+
end
|
94
|
+
end
|
56
95
|
end
|
57
96
|
end
|
data/lib/mcp_manager/version.rb
CHANGED