ask-rails-mcp 0.1.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0735b5cd8de91ba218011330ce945aaf843cb2b84d1a98e382b54cbe3f7ef51f
4
- data.tar.gz: 6cec7455ddc917a6b3482fe5cb9e72c2ffefd168f3f1310b93fbf6570ad0ece3
3
+ metadata.gz: 773a252d6ae9d0d904684e3596629d581ae895d6f8d93f350e6454b9a2b55d6f
4
+ data.tar.gz: e8a5b894f4fc6df93fe4354c6eb4f387e5a855e018533189e5776f8cc14b32a0
5
5
  SHA512:
6
- metadata.gz: 972281e304211d8939710ef5c6167313fcd0945b7d30204642d5be58f6c8f7c4f41fc3ea1159d4c04cb013059ad7b803fe455d086175e5383327e90709a1f970
7
- data.tar.gz: 61f31bccee0eb59227266ea2e23637fe4b5f616db9d4a6d40d6b2df56c3251a951e8c31294503ba5b3209e8c59635a78c897852b125c93046371ef1a831ab24e
6
+ metadata.gz: e2231837d2de97ad7b4e872238d9afb76a7eaf0d586040b8d3cfe3e3eaa50bfeaf6856618540b2ef8c07bc154ad667800e60afb0d3a761c154758159ae66164e
7
+ data.tar.gz: 64ae6358166ea51a76203be254be5dc2f155b0151fda344bf305edcb84c7b8094b2912f814bfbf6c9bb7db45812143eb0c49d8fd52016a767e5ceadcaeb83aa3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [0.2.0] — 2026-07-23
2
+
3
+ ### Added
4
+
5
+ - **stdio transport** — `Ask::Rails::MCP.start` boots the Rails app and starts a stdio MCP server. Run `ask-rails-mcp` from your Rails app root.
6
+ - **`bin/ask-rails-mcp`** — CLI entry point for local development. No web server needed.
7
+
1
8
  ## [0.1.0] — 2026-07-23
2
9
 
3
10
  ### Added
data/README.md CHANGED
@@ -12,6 +12,33 @@ bundle add ask-rails-mcp
12
12
 
13
13
  ## Usage
14
14
 
15
+ ### Option 1: stdio (local development — recommended)
16
+
17
+ Run from your Rails app root:
18
+
19
+ ```bash
20
+ cd my-rails-app
21
+ ask-rails-mcp
22
+ ```
23
+
24
+ This boots your Rails app and starts an MCP stdio server. Configure in `~/.zcode/cli/config.json` (or your agent's MCP config):
25
+
26
+ ```json
27
+ {
28
+ "mcp": {
29
+ "servers": {
30
+ "ask-rails-mcp": {
31
+ "type": "stdio",
32
+ "command": "ask-rails-mcp",
33
+ "args": []
34
+ }
35
+ }
36
+ }
37
+ }
38
+ ```
39
+
40
+ ### Option 2: HTTP endpoint (remote/production)
41
+
15
42
  Mount in `config/routes.rb` behind your existing auth:
16
43
 
17
44
  ```ruby
@@ -22,14 +49,14 @@ Rails.application.routes.draw do
22
49
  end
23
50
  ```
24
51
 
25
- Then configure any MCP-compatible agent to connect to your app. For example, in Claude Code's `~/.claude/settings.json`:
52
+ Then configure any MCP-compatible agent:
26
53
 
27
54
  ```json
28
55
  {
29
56
  "mcp": {
30
57
  "servers": {
31
58
  "ask-rails-mcp": {
32
- "type": "url",
59
+ "type": "http",
33
60
  "url": "https://myapp.com/ask/mcp"
34
61
  }
35
62
  }
data/bin/ask-rails-mcp ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "ask-rails-mcp"
5
+
6
+ Ask::Rails::MCP.start
@@ -3,7 +3,7 @@
3
3
  module Ask
4
4
  module Rails
5
5
  module MCP
6
- VERSION = "0.1.0"
6
+ VERSION = "0.2.0"
7
7
  end
8
8
  end
9
9
  end
data/lib/ask/rails/mcp.rb CHANGED
@@ -82,6 +82,34 @@ module Ask
82
82
  success_response(id, result)
83
83
  end
84
84
 
85
+ # Start the MCP stdio server, auto-loading the Rails app.
86
+ #
87
+ # $ ask-rails-mcp
88
+ #
89
+ # The server will listen for JSON-RPC messages on stdin and write
90
+ # responses to stdout — the standard MCP stdio transport. Register
91
+ # this executable as an MCP server in your client configuration:
92
+ #
93
+ # "mcp": {
94
+ # "servers": {
95
+ # "ask-rails-mcp": {
96
+ # "type": "stdio",
97
+ # "command": "ask-rails-mcp",
98
+ # "args": []
99
+ # }
100
+ # }
101
+ # }
102
+ def start
103
+ load_rails_app
104
+
105
+ Ask::MCP::Server.start_stdio(
106
+ name: "ask-rails-mcp",
107
+ tools: tools,
108
+ capabilities: { tools: {} },
109
+ debug: ENV["DEBUG"] == "1"
110
+ )
111
+ end
112
+
85
113
  # Get or clear the cache (useful in tests).
86
114
  def reset!
87
115
  @tools = nil
@@ -91,6 +119,14 @@ module Ask
91
119
 
92
120
  private
93
121
 
122
+ def load_rails_app
123
+ return if defined?(::Rails) && ::Rails.application
124
+ require File.expand_path("config/environment")
125
+ rescue LoadError
126
+ warn "ask-rails-mcp: must be run from your Rails app root (config/environment.rb not found)"
127
+ exit 1
128
+ end
129
+
94
130
  def success_response(id, result)
95
131
  { "jsonrpc" => "2.0", "id" => id, "result" => deep_stringify_keys(result) }
96
132
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ask-rails-mcp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto
@@ -100,12 +100,14 @@ description: |
100
100
  connect to inspect your schema, query your database, read models, and more.
101
101
  email:
102
102
  - kaka@myrrlabs.com
103
- executables: []
103
+ executables:
104
+ - ask-rails-mcp
104
105
  extensions: []
105
106
  extra_rdoc_files: []
106
107
  files:
107
108
  - CHANGELOG.md
108
109
  - README.md
110
+ - bin/ask-rails-mcp
109
111
  - lib/ask-rails-mcp.rb
110
112
  - lib/ask/rails/mcp.rb
111
113
  - lib/ask/rails/mcp/version.rb