mcp_manager 0.1.0
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 +7 -0
- data/.gitignore +59 -0
- data/.mcp.yml.example +46 -0
- data/CHANGELOG.md +26 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +28 -0
- data/LICENSE +21 -0
- data/README.md +114 -0
- data/Rakefile +10 -0
- data/bin/mcp-manager +5 -0
- data/lib/mcp_manager/cli.rb +182 -0
- data/lib/mcp_manager/config.rb +48 -0
- data/lib/mcp_manager/server.rb +57 -0
- data/lib/mcp_manager/version.rb +3 -0
- data/lib/mcp_manager.rb +10 -0
- data/mcp_manager.gemspec +31 -0
- metadata +129 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e01236dc1b1fccad43ce014ea216e013e7aef535ca785108ed5eecc4fe5d520b
|
4
|
+
data.tar.gz: f60ff97b8967c80846ca15e7522bc4e6e32556da8221640e55b9ae1abceaeb64
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9b99a642bc7fc882880a508f23526d5960f6c289cbe30c66c9fbd783c5c846dc74946144118d10ebb1b5f5154c4bd34f3fc8023646cce9d96b20a3d369038e44
|
7
|
+
data.tar.gz: e0a2ce0f863c9e00ae433d194936d0f04404dba273ed636eb339b478cab765399ea92edb1c64504b5676dbb4ca5f14fbffb392074486d9dc8be74277320b97c2
|
data/.gitignore
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
4
|
+
/coverage/
|
5
|
+
/InstalledFiles
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/spec/examples.txt
|
9
|
+
/test/tmp/
|
10
|
+
/test/version_tmp/
|
11
|
+
/tmp/
|
12
|
+
|
13
|
+
# Used by dotenv library to load environment variables.
|
14
|
+
# .env
|
15
|
+
|
16
|
+
# Ignore Byebug command history file.
|
17
|
+
.byebug_history
|
18
|
+
|
19
|
+
## Specific to RubyMotion:
|
20
|
+
.dat*
|
21
|
+
.repl_history
|
22
|
+
build/
|
23
|
+
*.bridgesupport
|
24
|
+
build-iPhoneOS/
|
25
|
+
build-iPhoneSimulator/
|
26
|
+
|
27
|
+
## Specific to RubyMotion (use of CocoaPods):
|
28
|
+
#
|
29
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
30
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
31
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
32
|
+
#
|
33
|
+
# vendor/Pods/
|
34
|
+
|
35
|
+
## Documentation cache and generated files:
|
36
|
+
/.yardoc/
|
37
|
+
/_yardoc/
|
38
|
+
/doc/
|
39
|
+
/rdoc/
|
40
|
+
|
41
|
+
## Environment normalization:
|
42
|
+
/.bundle/
|
43
|
+
/vendor/bundle
|
44
|
+
/lib/bundler/man/
|
45
|
+
|
46
|
+
# for a library or gem, you might want to ignore these files since the code is
|
47
|
+
# intended to run in multiple environments; otherwise, check them in:
|
48
|
+
# Gemfile.lock
|
49
|
+
# .ruby-version
|
50
|
+
# .ruby-gemset
|
51
|
+
|
52
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
53
|
+
.rvmrc
|
54
|
+
|
55
|
+
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
|
56
|
+
# .rubocop-https?--*
|
57
|
+
|
58
|
+
# MCP YAML config
|
59
|
+
.mcp.yml
|
data/.mcp.yml.example
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
# MCP Server Configuration
|
2
|
+
# This file defines available MCP servers and their installation commands
|
3
|
+
# Used by scripts/mcp-manager.rb for easy server management
|
4
|
+
|
5
|
+
servers:
|
6
|
+
asana-remote:
|
7
|
+
description: "Asana task management (OAuth)"
|
8
|
+
command: 'claude mcp add asana-remote -- npx -y mcp-remote https://mcp.asana.com/sse'
|
9
|
+
env_vars: []
|
10
|
+
|
11
|
+
google-workspace:
|
12
|
+
description: "Gmail/Calendar integration (requires OAuth credentials)"
|
13
|
+
command: 'claude mcp add google-workspace -e GOOGLE_OAUTH_CLIENT_ID="$GOOGLE_OAUTH_CLIENT_ID" -e GOOGLE_OAUTH_CLIENT_SECRET="$GOOGLE_OAUTH_CLIENT_SECRET" -e OAUTHLIB_INSECURE_TRANSPORT="1" -- uvx workspace-mcp@latest --tools gmail calendar'
|
14
|
+
env_vars:
|
15
|
+
- GOOGLE_OAUTH_CLIENT_ID
|
16
|
+
- GOOGLE_OAUTH_CLIENT_SECRET
|
17
|
+
|
18
|
+
github:
|
19
|
+
description: "GitHub repository integration (requires Personal Access Token)"
|
20
|
+
command: 'claude mcp add github -e GITHUB_PERSONAL_ACCESS_TOKEN="$GITHUB_PERSONAL_ACCESS_TOKEN" -- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server'
|
21
|
+
env_vars:
|
22
|
+
- GITHUB_PERSONAL_ACCESS_TOKEN
|
23
|
+
|
24
|
+
ynab:
|
25
|
+
description: "You Need A Budget integration"
|
26
|
+
command: 'claude mcp add ynab -- npx -y ynab-mcp-server@latest -e YNAB_API_TOKEN=$YNAB_API_TOKEN -e YNAB_BUDGET_ID=$YNAB_BUDGET_ID'
|
27
|
+
env_vars:
|
28
|
+
- YNAB_API_TOKEN
|
29
|
+
- YNAB_BUDGET_ID
|
30
|
+
|
31
|
+
gemini-cli:
|
32
|
+
description: "Google's Gemini AI integration"
|
33
|
+
command: 'claude mcp add gemini-cli -- npx -y gemini-mcp-tool'
|
34
|
+
env_vars: []
|
35
|
+
|
36
|
+
context7:
|
37
|
+
description: "Up-to-date library documentation and code examples"
|
38
|
+
command: 'claude mcp add context7 -- npx -y context7-mcp'
|
39
|
+
env_vars: []
|
40
|
+
|
41
|
+
slack:
|
42
|
+
description: "Slack integration for team communication"
|
43
|
+
command: 'claude mcp add slack -s local -e SLACK_MCP_XOXC_TOKEN="$SLACK_MCP_XOXC_TOKEN" -e SLACK_MCP_XOXD_TOKEN="$SLACK_MCP_XOXD_TOKEN" -- npx -y slack-mcp-server@latest --transport stdio'
|
44
|
+
env_vars:
|
45
|
+
- SLACK_MCP_XOXC_TOKEN
|
46
|
+
- SLACK_MCP_XOXD_TOKEN
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
|
+
|
8
|
+
## [0.1.0] - 2025-08-28
|
9
|
+
|
10
|
+
### Added
|
11
|
+
- Initial release of mcp-manager, a command-line tool for managing MCP servers in Claude projects
|
12
|
+
- YAML-based configuration system (.mcp.yml)
|
13
|
+
- Support for installing and uninstalling MCP servers
|
14
|
+
- Environment variable validation and guidance
|
15
|
+
- List command to show available servers with descriptions
|
16
|
+
- Example configuration with popular MCP servers (GitHub, Asana, Google Workspace)
|
17
|
+
- Comprehensive documentation and usage examples
|
18
|
+
|
19
|
+
### Commands
|
20
|
+
- `mcp-manager install <server>` - Install an MCP server
|
21
|
+
- `mcp-manager uninstall <server>` - Remove an MCP server
|
22
|
+
- `mcp-manager list` - List all configured servers
|
23
|
+
- Command aliases: `add`, `remove`, `rm`
|
24
|
+
- Help and version flags
|
25
|
+
|
26
|
+
[0.1.0]: https://github.com/ben/mcp-manager/releases/tag/v0.1.0
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
mcp_manager (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
minitest (5.25.5)
|
10
|
+
minitest-rg (5.3.0)
|
11
|
+
minitest (~> 5.0)
|
12
|
+
ostruct (0.5.5)
|
13
|
+
rake (13.3.0)
|
14
|
+
|
15
|
+
PLATFORMS
|
16
|
+
arm64-darwin-22
|
17
|
+
ruby
|
18
|
+
|
19
|
+
DEPENDENCIES
|
20
|
+
bundler (~> 2.0)
|
21
|
+
mcp_manager!
|
22
|
+
minitest (~> 5.0)
|
23
|
+
minitest-rg (~> 5.0)
|
24
|
+
ostruct (~> 0.5.0)
|
25
|
+
rake (~> 13.0)
|
26
|
+
|
27
|
+
BUNDLED WITH
|
28
|
+
2.7.1
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2025 Benjamin Jackson
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,114 @@
|
|
1
|
+
# mcp-manager
|
2
|
+
|
3
|
+
A command-line tool for managing MCP (Model Context Protocol) servers in Claude projects using a simple YAML configuration file.
|
4
|
+
|
5
|
+
## What is this?
|
6
|
+
|
7
|
+
MCP servers extend Claude's capabilities by connecting it to external tools and data sources. However, managing multiple MCP servers with their different installation commands, environment variables, and configurations can be complex.
|
8
|
+
|
9
|
+
`mcp-manager` solves this by letting you define all your MCP servers in a single `.mcp.yml` file, then install or remove them with simple commands.
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Install the gem:
|
14
|
+
|
15
|
+
```bash
|
16
|
+
gem install mcp_manager
|
17
|
+
```
|
18
|
+
|
19
|
+
Copy the example configuration to your project:
|
20
|
+
|
21
|
+
```bash
|
22
|
+
cp .mcp.yml.example .mcp.yml
|
23
|
+
```
|
24
|
+
|
25
|
+
## Configuration
|
26
|
+
|
27
|
+
Create a `.mcp.yml` file in your project root. Here's the format:
|
28
|
+
|
29
|
+
```yaml
|
30
|
+
servers:
|
31
|
+
server-name:
|
32
|
+
description: "What this server does"
|
33
|
+
command: "claude mcp add server-name -e REQUIRED_ENV_VAR=\"$REQUIRED_ENV_VAR\" -- installation-command"
|
34
|
+
env_vars: ["REQUIRED_ENV_VAR"]
|
35
|
+
```
|
36
|
+
|
37
|
+
### Real Examples
|
38
|
+
|
39
|
+
From the included `.mcp.yml.example`:
|
40
|
+
|
41
|
+
```yaml
|
42
|
+
servers:
|
43
|
+
github:
|
44
|
+
description: "GitHub repository integration (requires Personal Access Token)"
|
45
|
+
command: 'claude mcp add github -s local -e GITHUB_PERSONAL_ACCESS_TOKEN="$GITHUB_PERSONAL_ACCESS_TOKEN" -- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server'
|
46
|
+
env_vars:
|
47
|
+
- GITHUB_PERSONAL_ACCESS_TOKEN
|
48
|
+
|
49
|
+
asana-remote:
|
50
|
+
description: "Asana task management (OAuth)"
|
51
|
+
command: "claude mcp add asana-remote -- npx -y mcp-remote https://mcp.asana.com/sse"
|
52
|
+
env_vars: []
|
53
|
+
|
54
|
+
google-workspace:
|
55
|
+
description: "Gmail/Calendar integration (requires OAuth credentials)"
|
56
|
+
command: 'claude mcp add google-workspace -s local -e GOOGLE_OAUTH_CLIENT_ID="$GOOGLE_OAUTH_CLIENT_ID" -e GOOGLE_OAUTH_CLIENT_SECRET="$GOOGLE_OAUTH_CLIENT_SECRET" -e OAUTHLIB_INSECURE_TRANSPORT="1" -- uvx workspace-mcp@latest --tools gmail calendar'
|
57
|
+
env_vars:
|
58
|
+
- GOOGLE_OAUTH_CLIENT_ID
|
59
|
+
- GOOGLE_OAUTH_CLIENT_SECRET
|
60
|
+
```
|
61
|
+
|
62
|
+
## Usage
|
63
|
+
|
64
|
+
### List available servers
|
65
|
+
```bash
|
66
|
+
mcp-manager list
|
67
|
+
```
|
68
|
+
|
69
|
+
### Install a server
|
70
|
+
```bash
|
71
|
+
# Set required environment variables first
|
72
|
+
export GITHUB_PERSONAL_ACCESS_TOKEN="your-token-here"
|
73
|
+
|
74
|
+
# Install the server
|
75
|
+
mcp-manager install github
|
76
|
+
```
|
77
|
+
|
78
|
+
### Remove a server
|
79
|
+
```bash
|
80
|
+
mcp-manager uninstall github
|
81
|
+
```
|
82
|
+
|
83
|
+
## Commands
|
84
|
+
|
85
|
+
| Command | Aliases | Description |
|
86
|
+
|---------|---------|-------------|
|
87
|
+
| `install <server>` | `add` | Install/add an MCP server |
|
88
|
+
| `uninstall <server>` | `remove`, `rm` | Uninstall/remove an MCP server |
|
89
|
+
| `list` | | List all available servers with descriptions |
|
90
|
+
| `--help` | `-h` | Show help message |
|
91
|
+
| `--version` | `-v` | Show version |
|
92
|
+
|
93
|
+
## Environment Variables
|
94
|
+
|
95
|
+
Many MCP servers require API keys or OAuth credentials. The tool will check for required environment variables before installation and guide you through setup:
|
96
|
+
|
97
|
+
```bash
|
98
|
+
# Example for GitHub integration
|
99
|
+
export GITHUB_PERSONAL_ACCESS_TOKEN="your-github-pat"
|
100
|
+
|
101
|
+
# Example for Google Workspace
|
102
|
+
export GOOGLE_OAUTH_CLIENT_ID="your-client-id"
|
103
|
+
export GOOGLE_OAUTH_CLIENT_SECRET="your-client-secret"
|
104
|
+
```
|
105
|
+
|
106
|
+
Add these to your shell profile (`.zshrc`, `.bashrc`, etc.) to persist them.
|
107
|
+
|
108
|
+
## Contributing
|
109
|
+
|
110
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ben/mcp-manager.
|
111
|
+
|
112
|
+
## License
|
113
|
+
|
114
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/mcp-manager
ADDED
@@ -0,0 +1,182 @@
|
|
1
|
+
require 'optparse'
|
2
|
+
|
3
|
+
module McpManager
|
4
|
+
class CLI
|
5
|
+
attr_reader :config
|
6
|
+
|
7
|
+
def initialize
|
8
|
+
@config = nil
|
9
|
+
end
|
10
|
+
|
11
|
+
def run(args = ARGV)
|
12
|
+
parser = OptionParser.new do |opts|
|
13
|
+
opts.banner = "Usage: mcp-manager [options] <command> [server_name]"
|
14
|
+
|
15
|
+
opts.on("-h", "--help", "Show this help message") do
|
16
|
+
puts opts
|
17
|
+
show_commands
|
18
|
+
exit 0
|
19
|
+
end
|
20
|
+
|
21
|
+
opts.on("-v", "--version", "Show version") do
|
22
|
+
puts VERSION
|
23
|
+
exit 0
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
begin
|
28
|
+
parser.parse!(args)
|
29
|
+
rescue OptionParser::InvalidOption => e
|
30
|
+
error e.message
|
31
|
+
puts parser
|
32
|
+
exit 1
|
33
|
+
end
|
34
|
+
|
35
|
+
if args.empty?
|
36
|
+
show_usage
|
37
|
+
exit 1
|
38
|
+
end
|
39
|
+
|
40
|
+
command = args[0]
|
41
|
+
server_name = args[1]
|
42
|
+
|
43
|
+
case command
|
44
|
+
when 'install', 'add'
|
45
|
+
install_server(server_name)
|
46
|
+
when 'uninstall', 'remove', 'rm'
|
47
|
+
remove_server(server_name)
|
48
|
+
when 'list'
|
49
|
+
list_available_servers
|
50
|
+
else
|
51
|
+
error "Unknown command: #{command}"
|
52
|
+
show_usage
|
53
|
+
exit 1
|
54
|
+
end
|
55
|
+
rescue Error => e
|
56
|
+
error e.message
|
57
|
+
exit 1
|
58
|
+
end
|
59
|
+
|
60
|
+
private
|
61
|
+
|
62
|
+
def config
|
63
|
+
@config ||= Config.new
|
64
|
+
end
|
65
|
+
|
66
|
+
def install_server(server_name)
|
67
|
+
if server_name.nil?
|
68
|
+
error "Server name required for install command"
|
69
|
+
show_available_servers
|
70
|
+
exit 1
|
71
|
+
end
|
72
|
+
|
73
|
+
server_config = config.get_server_config(server_name)
|
74
|
+
unless server_config
|
75
|
+
error "Unknown server: #{server_name}"
|
76
|
+
show_available_servers
|
77
|
+
exit 1
|
78
|
+
end
|
79
|
+
|
80
|
+
# Validate required environment variables
|
81
|
+
missing_vars = config.check_env_vars(server_config['env_vars'] || [])
|
82
|
+
unless missing_vars.empty?
|
83
|
+
error "Missing required environment variables: #{missing_vars.join(', ')}"
|
84
|
+
show_env_setup(missing_vars)
|
85
|
+
exit 1
|
86
|
+
end
|
87
|
+
|
88
|
+
server = Server.new(server_name, server_config)
|
89
|
+
exit 1 unless server.install
|
90
|
+
end
|
91
|
+
|
92
|
+
def remove_server(server_name)
|
93
|
+
if server_name.nil?
|
94
|
+
error "Server name required for uninstall command"
|
95
|
+
exit 1
|
96
|
+
end
|
97
|
+
|
98
|
+
unless config.server_exists?(server_name)
|
99
|
+
error "Unknown server: #{server_name}"
|
100
|
+
show_available_servers
|
101
|
+
exit 1
|
102
|
+
end
|
103
|
+
|
104
|
+
server_config = config.get_server_config(server_name)
|
105
|
+
server = Server.new(server_name, server_config)
|
106
|
+
exit 1 unless server.uninstall
|
107
|
+
end
|
108
|
+
|
109
|
+
def list_available_servers
|
110
|
+
puts "\nAvailable MCP servers:"
|
111
|
+
puts "====================="
|
112
|
+
|
113
|
+
config.servers.each do |name, config|
|
114
|
+
puts "\n#{name}:"
|
115
|
+
puts " Description: #{config['description']}"
|
116
|
+
|
117
|
+
env_vars = config['env_vars'] || []
|
118
|
+
if env_vars.any?
|
119
|
+
puts " Required env vars: #{env_vars.join(', ')}"
|
120
|
+
else
|
121
|
+
puts " Required env vars: none"
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
puts "\nUsage:"
|
126
|
+
puts " mcp-manager install <server_name>"
|
127
|
+
puts " mcp-manager uninstall <server_name>"
|
128
|
+
end
|
129
|
+
|
130
|
+
def show_available_servers
|
131
|
+
puts "\nAvailable servers: #{config.list_servers.join(', ')}"
|
132
|
+
puts "Use 'mcp-manager list' for details"
|
133
|
+
end
|
134
|
+
|
135
|
+
def show_env_setup(missing_vars)
|
136
|
+
puts "\nTo set up missing environment variables, add to your shell profile:"
|
137
|
+
missing_vars.each do |var|
|
138
|
+
puts "export #{var}=\"your_#{var.downcase}_here\""
|
139
|
+
end
|
140
|
+
puts "\nThen reload your shell: source ~/.zshrc (or similar)"
|
141
|
+
end
|
142
|
+
|
143
|
+
def show_usage
|
144
|
+
puts "MCP Server Manager"
|
145
|
+
puts "=================="
|
146
|
+
puts ""
|
147
|
+
puts "Usage:"
|
148
|
+
puts " mcp-manager [options] <command> [server_name]"
|
149
|
+
puts ""
|
150
|
+
puts "Options:"
|
151
|
+
puts " -h, --help Show this help message"
|
152
|
+
puts " -v, --version Show version"
|
153
|
+
puts ""
|
154
|
+
show_commands
|
155
|
+
end
|
156
|
+
|
157
|
+
def show_commands
|
158
|
+
puts "Commands:"
|
159
|
+
puts " install|add <server> Install/add a server"
|
160
|
+
puts " uninstall|remove|rm <server> Uninstall/remove a server"
|
161
|
+
puts " list List available servers"
|
162
|
+
puts ""
|
163
|
+
puts "Examples:"
|
164
|
+
puts " mcp-manager install asana-remote"
|
165
|
+
puts " mcp-manager uninstall google-workspace"
|
166
|
+
puts " mcp-manager list"
|
167
|
+
puts " mcp-manager --help"
|
168
|
+
end
|
169
|
+
|
170
|
+
def info(message)
|
171
|
+
puts "ℹ️ #{message}"
|
172
|
+
end
|
173
|
+
|
174
|
+
def success(message)
|
175
|
+
puts "✅ #{message}"
|
176
|
+
end
|
177
|
+
|
178
|
+
def error(message)
|
179
|
+
puts "❌ #{message}"
|
180
|
+
end
|
181
|
+
end
|
182
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
module McpManager
|
4
|
+
class Config
|
5
|
+
attr_reader :config_path, :servers
|
6
|
+
|
7
|
+
def initialize(config_path = nil)
|
8
|
+
@config_path = config_path || File.join(Dir.pwd, CONFIG_FILE)
|
9
|
+
load_config
|
10
|
+
end
|
11
|
+
|
12
|
+
def load_config
|
13
|
+
unless File.exist?(@config_path)
|
14
|
+
raise Error, "Configuration file #{CONFIG_FILE} not found in current directory"
|
15
|
+
end
|
16
|
+
|
17
|
+
@config = YAML.safe_load_file(@config_path)
|
18
|
+
@servers = @config['servers'] || {}
|
19
|
+
rescue Psych::SyntaxError => e
|
20
|
+
raise Error, "Invalid YAML in #{CONFIG_FILE}: #{e.message}"
|
21
|
+
end
|
22
|
+
|
23
|
+
def server_exists?(name)
|
24
|
+
@servers.key?(name)
|
25
|
+
end
|
26
|
+
|
27
|
+
def get_server_config(name)
|
28
|
+
@servers[name]
|
29
|
+
end
|
30
|
+
|
31
|
+
def list_servers
|
32
|
+
@servers.keys
|
33
|
+
end
|
34
|
+
|
35
|
+
def check_env_vars(required_vars)
|
36
|
+
missing = []
|
37
|
+
required_vars.each do |var|
|
38
|
+
# GEMINI_API_KEY is optional if using OAuth
|
39
|
+
next if var == 'GEMINI_API_KEY'
|
40
|
+
|
41
|
+
if ENV[var].nil? || ENV[var].empty?
|
42
|
+
missing << var
|
43
|
+
end
|
44
|
+
end
|
45
|
+
missing
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
module McpManager
|
2
|
+
class Server
|
3
|
+
attr_reader :name, :config
|
4
|
+
|
5
|
+
def initialize(name, config)
|
6
|
+
@name = name
|
7
|
+
@config = config
|
8
|
+
end
|
9
|
+
|
10
|
+
def description
|
11
|
+
@config['description']
|
12
|
+
end
|
13
|
+
|
14
|
+
def command
|
15
|
+
@config['command']
|
16
|
+
end
|
17
|
+
|
18
|
+
def env_vars
|
19
|
+
@config['env_vars'] || []
|
20
|
+
end
|
21
|
+
|
22
|
+
def install
|
23
|
+
puts "ℹ️ Installing MCP server: #{@name}"
|
24
|
+
puts "ℹ️ Description: #{description}"
|
25
|
+
puts "ℹ️ Executing: #{command}"
|
26
|
+
|
27
|
+
system(command, out: File::NULL, err: File::NULL)
|
28
|
+
if $CHILD_STATUS.success?
|
29
|
+
puts "✅ Successfully installed #{@name}"
|
30
|
+
true
|
31
|
+
else
|
32
|
+
puts "❌ Failed to install #{@name}"
|
33
|
+
false
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def uninstall
|
38
|
+
puts "ℹ️ Uninstalling MCP server: #{@name}"
|
39
|
+
|
40
|
+
uninstall_command = "claude mcp remove #{@name}"
|
41
|
+
puts "ℹ️ Executing: #{uninstall_command}"
|
42
|
+
|
43
|
+
system(uninstall_command, out: File::NULL, err: File::NULL)
|
44
|
+
if $CHILD_STATUS.success?
|
45
|
+
puts "✅ Successfully uninstalled #{@name}"
|
46
|
+
true
|
47
|
+
else
|
48
|
+
puts "❌ Failed to uninstall #{@name}"
|
49
|
+
false
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def to_s
|
54
|
+
"#{@name}: #{description}"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
data/lib/mcp_manager.rb
ADDED
data/mcp_manager.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
require_relative 'lib/mcp_manager/version'
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = "mcp_manager"
|
5
|
+
spec.version = McpManager::VERSION
|
6
|
+
spec.authors = ["Ben Jackson"]
|
7
|
+
spec.email = ["ben@hearmeout.co"]
|
8
|
+
|
9
|
+
spec.summary = %q{Utility for managing MCP servers in Claude projects}
|
10
|
+
spec.description = %q{A command-line tool for adding and removing MCP servers to a Claude project with a simple YAML config.}
|
11
|
+
spec.homepage = "https://github.com/benjaminjackson/mcp-manager"
|
12
|
+
spec.license = "MIT"
|
13
|
+
|
14
|
+
spec.metadata["source_code_uri"] = "https://github.com/benjaminjackson/mcp-manager"
|
15
|
+
spec.metadata["changelog_uri"] = "https://github.com/benjaminjackson/mcp-manager/blob/main/CHANGELOG.md"
|
16
|
+
|
17
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
18
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
19
|
+
end
|
20
|
+
spec.bindir = "bin"
|
21
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.required_ruby_version = '>= 2.6.0'
|
25
|
+
|
26
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
27
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
28
|
+
spec.add_development_dependency "minitest", "~> 5.0"
|
29
|
+
spec.add_development_dependency "minitest-rg", "~> 5.0"
|
30
|
+
spec.add_development_dependency "ostruct", "~> 0.5.0"
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mcp_manager
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ben Jackson
|
8
|
+
bindir: bin
|
9
|
+
cert_chain: []
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
|
+
dependencies:
|
12
|
+
- !ruby/object:Gem::Dependency
|
13
|
+
name: bundler
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - "~>"
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '2.0'
|
19
|
+
type: :development
|
20
|
+
prerelease: false
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
requirements:
|
23
|
+
- - "~>"
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: '2.0'
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: rake
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - "~>"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '13.0'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '13.0'
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: minitest
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '5.0'
|
47
|
+
type: :development
|
48
|
+
prerelease: false
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '5.0'
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: minitest-rg
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '5.0'
|
61
|
+
type: :development
|
62
|
+
prerelease: false
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '5.0'
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: ostruct
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 0.5.0
|
75
|
+
type: :development
|
76
|
+
prerelease: false
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: 0.5.0
|
82
|
+
description: A command-line tool for adding and removing MCP servers to a Claude project
|
83
|
+
with a simple YAML config.
|
84
|
+
email:
|
85
|
+
- ben@hearmeout.co
|
86
|
+
executables:
|
87
|
+
- mcp-manager
|
88
|
+
extensions: []
|
89
|
+
extra_rdoc_files: []
|
90
|
+
files:
|
91
|
+
- ".gitignore"
|
92
|
+
- ".mcp.yml.example"
|
93
|
+
- CHANGELOG.md
|
94
|
+
- Gemfile
|
95
|
+
- Gemfile.lock
|
96
|
+
- LICENSE
|
97
|
+
- README.md
|
98
|
+
- Rakefile
|
99
|
+
- bin/mcp-manager
|
100
|
+
- lib/mcp_manager.rb
|
101
|
+
- lib/mcp_manager/cli.rb
|
102
|
+
- lib/mcp_manager/config.rb
|
103
|
+
- lib/mcp_manager/server.rb
|
104
|
+
- lib/mcp_manager/version.rb
|
105
|
+
- mcp_manager.gemspec
|
106
|
+
homepage: https://github.com/benjaminjackson/mcp-manager
|
107
|
+
licenses:
|
108
|
+
- MIT
|
109
|
+
metadata:
|
110
|
+
source_code_uri: https://github.com/benjaminjackson/mcp-manager
|
111
|
+
changelog_uri: https://github.com/benjaminjackson/mcp-manager/blob/main/CHANGELOG.md
|
112
|
+
rdoc_options: []
|
113
|
+
require_paths:
|
114
|
+
- lib
|
115
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: 2.6.0
|
120
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
requirements: []
|
126
|
+
rubygems_version: 3.7.1
|
127
|
+
specification_version: 4
|
128
|
+
summary: Utility for managing MCP servers in Claude projects
|
129
|
+
test_files: []
|