rails-active-mcp 3.1.3 → 3.1.4
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9ffb5b6aa939b08d7b36865cdd2fc0f8d8e11d4284204291a1b12df98b1ac924
|
|
4
|
+
data.tar.gz: b8aef125e7fa0e41c84761b9f01f6b7e27db5bd22ccdb58369ba3eed3b265218
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 74a929edbc48349b135449a9579ecd3c40a623e7a9ba7e05438f36d38acedd68b84ae2b5b13078a88c6d811fbb70bd1716f051f104ce925af108b69734eeab83
|
|
7
|
+
data.tar.gz: 4d73e8c4f26772cc4f3642d22e07f45e6e3ff87a7e3fd9f102a05ec75a04a393f48597d0bcc12fbf89364e9b01b1d1115bbb05bab3efcdf7532e933b6de50e32
|
|
@@ -1,89 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
3
|
# Rails Active MCP Wrapper Script
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
4
|
+
# Re-execs through the user's login shell to pick up Ruby version manager
|
|
5
|
+
# configuration (rbenv, asdf, mise, rvm, chruby, etc.) that MCP hosts
|
|
6
|
+
# don't load automatically.
|
|
7
7
|
|
|
8
|
-
# Get the directory where this script is located
|
|
9
8
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
10
9
|
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
|
|
10
|
+
USER_SHELL="${SHELL:-/bin/bash}"
|
|
11
11
|
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
exit 1
|
|
16
|
-
}
|
|
12
|
+
# Save real stdout to fd 3, redirect stdout to stderr during shell init
|
|
13
|
+
# to prevent profile output from corrupting MCP protocol
|
|
14
|
+
exec 3>&1 1>&2
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
# without requiring full shell initialization (eval, source, etc.).
|
|
21
|
-
# This works reliably even in non-interactive contexts like MCP hosts.
|
|
22
|
-
setup_ruby_path() {
|
|
23
|
-
# rbenv: shims directory handles version switching
|
|
24
|
-
local rbenv_root="${RBENV_ROOT:-$HOME/.rbenv}"
|
|
25
|
-
if [ -d "$rbenv_root/shims" ]; then
|
|
26
|
-
export PATH="$rbenv_root/shims:$PATH"
|
|
27
|
-
return
|
|
28
|
-
fi
|
|
29
|
-
|
|
30
|
-
# asdf: shims directory handles version switching
|
|
31
|
-
local asdf_data="${ASDF_DATA_DIR:-$HOME/.asdf}"
|
|
32
|
-
if [ -d "$asdf_data/shims" ]; then
|
|
33
|
-
export PATH="$asdf_data/shims:$PATH"
|
|
34
|
-
return
|
|
35
|
-
fi
|
|
16
|
+
exec "$USER_SHELL" -l -c '
|
|
17
|
+
exec 1>&3 3>&- # restore real stdout for MCP server
|
|
36
18
|
|
|
37
|
-
|
|
38
|
-
local mise_data="${MISE_DATA_DIR:-$HOME/.local/share/mise}"
|
|
39
|
-
if [ -d "$mise_data/shims" ]; then
|
|
40
|
-
export PATH="$mise_data/shims:$PATH"
|
|
41
|
-
return
|
|
42
|
-
fi
|
|
43
|
-
|
|
44
|
-
# rvm: requires sourcing but check for it
|
|
45
|
-
if [ -d "$HOME/.rvm/rubies" ]; then
|
|
46
|
-
if [ -f "$HOME/.rvm/scripts/rvm" ]; then
|
|
47
|
-
source "$HOME/.rvm/scripts/rvm"
|
|
48
|
-
fi
|
|
49
|
-
return
|
|
50
|
-
fi
|
|
19
|
+
cd "$1" || { echo "Error: Cannot cd to $1" >&2; exit 1; }
|
|
51
20
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
source /usr/local/share/chruby/chruby.sh
|
|
55
|
-
[ -f /usr/local/share/chruby/auto.sh ] && source /usr/local/share/chruby/auto.sh
|
|
56
|
-
return
|
|
21
|
+
if [ ! -f "Gemfile" ]; then
|
|
22
|
+
echo "Error: Gemfile not found" >&2; exit 1
|
|
57
23
|
fi
|
|
58
|
-
if [ -f /opt/homebrew/share/chruby/chruby.sh ]; then
|
|
59
|
-
source /opt/homebrew/share/chruby/chruby.sh
|
|
60
|
-
[ -f /opt/homebrew/share/chruby/auto.sh ] && source /opt/homebrew/share/chruby/auto.sh
|
|
61
|
-
return
|
|
62
|
-
fi
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
setup_ruby_path
|
|
66
|
-
|
|
67
|
-
# Verify we have the necessary files
|
|
68
|
-
if [ ! -f "Gemfile" ]; then
|
|
69
|
-
echo "Error: Gemfile not found in $PROJECT_ROOT" >&2
|
|
70
|
-
echo "Please ensure you're running this from a Rails application root" >&2
|
|
71
|
-
exit 1
|
|
72
|
-
fi
|
|
73
|
-
|
|
74
|
-
if [ ! -f "config/environment.rb" ]; then
|
|
75
|
-
echo "Warning: config/environment.rb not found. This may not be a Rails application." >&2
|
|
76
|
-
fi
|
|
77
|
-
|
|
78
|
-
# Set default environment if not specified
|
|
79
|
-
export RAILS_ENV="${RAILS_ENV:-development}"
|
|
80
|
-
|
|
81
|
-
# Ensure we have the rails-active-mcp gem available
|
|
82
|
-
if ! bundle list 2>/dev/null | grep -q "rails-active-mcp"; then
|
|
83
|
-
echo "Error: rails-active-mcp gem not found in bundle" >&2
|
|
84
|
-
echo "Please run: bundle install" >&2
|
|
85
|
-
exit 1
|
|
86
|
-
fi
|
|
87
24
|
|
|
88
|
-
|
|
89
|
-
exec bundle exec rails-active-mcp-server "$@"
|
|
25
|
+
export RAILS_ENV="${RAILS_ENV:-development}"
|
|
26
|
+
exec bundle exec rails-active-mcp-server "$@"
|
|
27
|
+
' _ "$PROJECT_ROOT" "$@"
|