rails-mcp-server 1.2.0 → 1.2.2

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: d223ba6b32da76211f1b0316c76156453acfc25f86a2b2750949b5747cf4c2b2
4
- data.tar.gz: c3bfbaa694738d88186f761c6053edffed7324d3a68a9168c91b63757250ad49
3
+ metadata.gz: 74a6004be8b59bdcb7faf865784f2873a6d2cd4c7d7a4e2efd359c6a7f07a00a
4
+ data.tar.gz: ab9986826c087ccda8bad64e749ce3382e73b7a895e151318415951abc3f0b95
5
5
  SHA512:
6
- metadata.gz: '08cf5e172f3ad00d8e8fbcca061bd5c06fd3a6dfcac6610849f3cf9dda86a10a4bfa6c254804309e421bc64370382fe4a90e0456b82c3aa1aa14214d5f0a8be8'
7
- data.tar.gz: 6c8a18e379e46f5c3a55554f244b48b1f01477dc1283911f198c0876cbeeaa6fccb8dccb6a972cdc2a7a218b42a8e07e9928a3a2d8a457eafad4b33f625e995d
6
+ metadata.gz: 8b1b210dd639c42add909b9b406de1fd5b9d82404df40cd8416320173e31f95adb41d1390a3c50f758c6c57acfc9d213200045e0d4ae3907cd217d458f54f86e
7
+ data.tar.gz: 51892b54ef22115b922d69bf71d0f34f0809fc58b949ddb2c3afaf521c87b7ae71cd5ef2575bc3347af6252d012bb3ab4a650fbe0a44d29dfd08d0b837dfd937
data/CHANGELOG.md CHANGED
@@ -5,6 +5,35 @@ 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
+ ## [1.2.2] - 2025-07-21
9
+
10
+ ### Added
11
+
12
+ - **Network Access Support**: New `--bind-all` flag for HTTP mode to allow access from local network
13
+ - Binds to `0.0.0.0` instead of `localhost` when enabled
14
+ - Allows connections from local network IP ranges (192.168.x.x, 10.x.x.x)
15
+ - Accepts connections from `.local` domain names (e.g., `my-computer.local`)
16
+ - Maintains security features with origin validation and IP filtering
17
+
18
+ ### Improved
19
+
20
+ - **Security Configuration**: Enhanced allowed origins and IP configuration when using `--bind-all`
21
+ - Automatically configures appropriate security settings for local network access
22
+ - Preserves localhost-only mode by default for security
23
+ - Clear documentation of security implications
24
+
25
+ ### Changed
26
+
27
+ - HTTP server binding address is now configurable via `--bind-all` flag
28
+ - Updated help text to include new network access option
29
+
30
+ ## [1.2.1] - 2025-06-09
31
+
32
+ ### Fixed
33
+
34
+ - Fix a debug message generating invalid STDIO output.
35
+ - Fix tool name spelling.
36
+
8
37
  ## [1.2.0] - 2025-06-03
9
38
 
10
39
  ### Added
@@ -114,7 +143,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
114
143
  - `list_files`: Browse project files with glob pattern matching
115
144
  - `get_file`: Retrieve file contents with syntax highlighting
116
145
  - `get_routes`: Display all Rails routes (equivalent to `rails routes`)
117
- - `analize_models`: Analyze Active Record models, associations, and relationships
146
+ - `analyze_models`: Analyze Active Record models, associations, and relationships
118
147
  - `get_schema`: Retrieve database schema information and table structures
119
148
  - Basic file and project analysis capabilities
120
149
  - **Project Management System**:
@@ -163,6 +192,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
163
192
 
164
193
  ## Version History Summary
165
194
 
195
+ - **v1.2.2** (2025-07-21): Network access support with --bind-all flag
196
+ - **v1.2.1** (2025-06-09): Bug fixes for STDIO output and tool naming
166
197
  - **v1.2.0** (2025-06-03): Major documentation and resource system addition
167
198
  - **v1.1.4** (2025-05-02): Critical bug fixes for HTTP mode and Rails commands
168
199
  - **v1.1.0** (2025-04-20): HTTP SSE support and new analysis tools with FastMCP migration
@@ -183,9 +214,9 @@ This project follows [Semantic Versioning](https://semver.org/):
183
214
  1. Update version in `lib/rails-mcp-server/version.rb`
184
215
  2. Update this CHANGELOG.md with new features and changes
185
216
  3. Update README.md and documentation if needed
186
- 4. Create a git tag: `git tag -a v1.2.0 -m "Release version 1.2.0"`
217
+ 4. Create a git tag: `git tag -a v1.2.2 -m "Release version 1.2.2"`
187
218
  5. Push tags: `git push origin --tags`
188
- 6. Build and publish gem: `gem build rails-mcp-server.gemspec && gem push rails-mcp-server-1.2.0.gem`
219
+ 6. Build and publish gem: `gem build rails-mcp-server.gemspec && gem push rails-mcp-server-1.2.2.gem`
189
220
 
190
221
  ### Changelog Categories
191
222
 
data/README.md CHANGED
@@ -70,6 +70,9 @@ rails-mcp-server --mode http
70
70
 
71
71
  # Start in HTTP mode on a custom port
72
72
  rails-mcp-server --mode http -p 8080
73
+
74
+ # Start in HTTP mode binding to all interfaces (for local network access)
75
+ rails-mcp-server --mode http --bind-all
73
76
  ```
74
77
 
75
78
  When running in HTTP mode, the server provides two endpoints:
@@ -77,6 +80,27 @@ When running in HTTP mode, the server provides two endpoints:
77
80
  - JSON-RPC endpoint: `http://localhost:<port>/mcp/messages`
78
81
  - SSE endpoint: `http://localhost:<port>/mcp/sse`
79
82
 
83
+ ### Network Access (HTTP Mode)
84
+
85
+ By default, the HTTP server only binds to localhost for security. If you need to access the server from other machines on your local network (e.g., for testing with multiple devices), you can use the `--bind-all` flag:
86
+
87
+ ```bash
88
+ # Allow access from any machine on your local network
89
+ rails-mcp-server --mode http --bind-all
90
+
91
+ # With a custom port
92
+ rails-mcp-server --mode http --bind-all -p 8080
93
+ ```
94
+
95
+ When using `--bind-all`:
96
+
97
+ - The server binds to `0.0.0.0` instead of `localhost`
98
+ - Access is allowed from local network IP ranges (192.168.x.x, 10.x.x.x)
99
+ - The server accepts connections from `.local` domain names (e.g., `my-computer.local`)
100
+ - Security features remain active to prevent unauthorized access
101
+
102
+ **Security Note**: Only use `--bind-all` on trusted networks. The server includes built-in security features to validate origins and IP addresses, but exposing any service to your network increases the attack surface.
103
+
80
104
  ### Logging Options
81
105
 
82
106
  The server logs to a file in the `./log` directory by default. You can customize logging with these options:
@@ -137,10 +161,17 @@ After running the script, restart Claude Desktop to apply the changes.
137
161
 
138
162
  Claude Desktop launches the MCP server using your system's default Ruby environment, bypassing version manager initialization (e.g., rbenv, RVM). The MCP server needs to use the same Ruby version where it was installed, as MCP server startup failures can occur when using an incompatible Ruby version.
139
163
 
140
- If you are using a Ruby version manager such as rbenv, you can create a symbolic link to your Ruby shim to ensure the correct version is used:
164
+ If you are using a Ruby version manager such as rbenv, you can use the Ruby shim path to ensure the correct version is used:
141
165
 
142
- ```bash
143
- sudo ln -s /home/your_user/.rbenv/shims/ruby /usr/local/bin/ruby
166
+ ```json
167
+ {
168
+ "mcpServers": {
169
+ "railsMcpServer": {
170
+ "command": "/home/your_user/.rbenv/shims/ruby",
171
+ "args": ["/full/path/to/rails-mcp-server/exe/rails-mcp-server"]
172
+ }
173
+ }
174
+ }
144
175
  ```
145
176
 
146
177
  Replace "/home/your_user/.rbenv/shims/ruby" with your actual path for the Ruby shim.
@@ -308,7 +339,7 @@ I need to understand the API endpoints available in this project. Can you list t
308
339
  Show me the routing configuration for this Rails app so I can see how the URLs are structured.
309
340
  ```
310
341
 
311
- ### 6. `analize_models`
342
+ ### 6. `analyze_models`
312
343
 
313
344
  **Description:** Retrieve detailed information about Active Record models in the project. When called without parameters, lists all model files. When a specific model is specified, returns its schema, associations (has_many, belongs_to, has_one), and complete source code.
314
345
 
data/exe/rails-mcp-server CHANGED
@@ -13,9 +13,6 @@ require "puma/configuration"
13
13
  require "puma/launcher"
14
14
  require_relative "../lib/rails_mcp_server"
15
15
 
16
- # Debug information
17
- puts "Extensions loaded: #{RailsMcpServer.extensions_loaded?}\n\n"
18
-
19
16
  if ARGV[0] == "version"
20
17
  puts "Rails MCP Server version #{RailsMcpServer::VERSION}"
21
18
  exit 0
@@ -31,11 +28,13 @@ if ARGV[0] == "--help" || ARGV[0] == "-h"
31
28
  puts " --log-level LEVEL Log level: debug, info, warn, error (default: info)"
32
29
  puts " --mode MODE Server mode: http or stdio (default: stdio)"
33
30
  puts " -p, --port PORT Port to listen on (default: 6029)"
31
+ puts " --bind-all Bind to 0.0.0.0 instead of localhost (HTTP mode only)"
34
32
  puts " version Display version information"
35
33
  puts " --help, -h Display this help message"
36
34
  puts ""
37
35
  puts "Example:"
38
36
  puts " #{File.basename($0)} --log-level debug -p 6060"
37
+ puts " #{File.basename($0)} --mode http --bind-all"
39
38
  puts " #{File.basename($0)} --mode stdio"
40
39
  exit 0
41
40
  end
@@ -43,6 +42,7 @@ end
43
42
  # Default values
44
43
  port = 6029
45
44
  mode = "stdio"
45
+ bind_all = false
46
46
 
47
47
  # Parse command-line arguments
48
48
  i = 0
@@ -61,6 +61,9 @@ while i < ARGV.length
61
61
  exit 1
62
62
  end
63
63
  i += 2
64
+ when "--bind-all"
65
+ bind_all = true
66
+ i += 1
64
67
  else
65
68
  i += 1
66
69
  end
@@ -84,10 +87,12 @@ end
84
87
 
85
88
  case mode
86
89
  when "http"
87
- puts "Starting Rack application with MCP middleware on http://localhost:#{port}"
90
+ bind_address = bind_all ? "0.0.0.0" : "localhost"
91
+
92
+ puts "Starting Rack application with MCP middleware on http://#{bind_address}:#{port}"
88
93
  puts "MCP endpoints:"
89
- puts " - http://localhost:#{port}/mcp/sse (SSE endpoint)"
90
- puts " - http://localhost:#{port}/mcp/messages (JSON-RPC endpoint)"
94
+ puts " - http://#{bind_address}:#{port}/mcp/sse (SSE endpoint)"
95
+ puts " - http://#{bind_address}:#{port}/mcp/messages (JSON-RPC endpoint)"
91
96
  puts ""
92
97
  puts "Version #{RailsMcpServer::VERSION}"
93
98
  puts ""
@@ -99,12 +104,15 @@ when "http"
99
104
  mcp_app = FastMcp.rack_middleware(
100
105
  rack_app,
101
106
  name: "rails-mcp-server", version: RailsMcpServer::VERSION,
107
+ allowed_origins: bind_all ? ["127.0.0.1", "localhost"] : ["127.0.0.1", "localhost", /.*\.local$/],
108
+ localhost_only: !bind_all,
109
+ allowed_ips: bind_all ? ["192.168.68.0/24", "10.0.0.0/8"] : ["127.0.0.1", "::1"],
102
110
  logger: RailsMcpServer.logger
103
111
  ) { |server| setup_mcp_tools(server) }
104
112
 
105
113
  app = Rack::Builder.new { run mcp_app }
106
114
  config = Puma::Configuration.new do |user_config|
107
- user_config.bind "tcp://localhost:#{port}"
115
+ user_config.bind "tcp://#{bind_address}:#{port}"
108
116
  user_config.app app
109
117
  end
110
118
 
@@ -1,6 +1,6 @@
1
1
  module RailsMcpServer
2
2
  class AnalyzeModels < BaseTool
3
- tool_name "analize_models"
3
+ tool_name "analyze_models"
4
4
 
5
5
  description "Retrieve detailed information about Active Record models in the project. When called without parameters, lists all model files. When a specific model is specified, returns its schema, associations (has_many, belongs_to, has_one), and complete source code."
6
6
 
@@ -1,3 +1,3 @@
1
1
  module RailsMcpServer
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.2"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-mcp-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mario Alberto Chávez Cárdenas
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
10
+ date: 2025-07-22 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: addressable
@@ -98,8 +98,8 @@ email:
98
98
  - mario.chavez@gmail.com
99
99
  executables:
100
100
  - rails-mcp-server
101
- - rails-mcp-server-download-resources
102
101
  - rails-mcp-setup-claude
102
+ - rails-mcp-server-download-resources
103
103
  extensions: []
104
104
  extra_rdoc_files: []
105
105
  files:
@@ -171,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
171
  - !ruby/object:Gem::Version
172
172
  version: '0'
173
173
  requirements: []
174
- rubygems_version: 3.6.8
174
+ rubygems_version: 3.6.2
175
175
  specification_version: 4
176
176
  summary: MCP server for Rails projects
177
177
  test_files: []