rails-pg-extras-mcp 0.1.4 → 0.2.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/README.md +9 -5
- data/lib/rails-pg-extras-mcp.rb +4 -6
- data/lib/rails_pg_extras_mcp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51a70e772cecedb41e510b12575566f177b9e70fd374ae62dfb8f99bc8c04f87
|
4
|
+
data.tar.gz: b26aef4c74f6bde11aa077435f174ea7325cf8642b86c354ad9b09210849abcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdbcd8cdd983d36e0db3eef92c2a7db89168bc581d2e98fcb6b0d131713f7dc8fbb531a23a90d3f009c089a97bb21273e61313daa6951507c8005b2078b9f83c
|
7
|
+
data.tar.gz: 6e413fbfd0edd16253d5b2196a2608a42a00e31513fa68c50c33cf9a9959aa88a455bf62a922a49c782cf2bf41058268f6af8e253bed5655110892a15ce47da4
|
data/README.md
CHANGED
@@ -7,7 +7,6 @@ MCP ([Model Context Protocol](https://modelcontextprotocol.io/introduction)) int
|
|
7
7
|
## Installation
|
8
8
|
|
9
9
|
```bash
|
10
|
-
bundle add rails-pg-extras
|
11
10
|
bundle add rails-pg-extras-mcp
|
12
11
|
```
|
13
12
|
|
@@ -16,17 +15,22 @@ The library supports MCP protocol via HTTP SSE interface.
|
|
16
15
|
`config/routes.rb`
|
17
16
|
|
18
17
|
```ruby
|
19
|
-
mount RailsPgExtrasMcp::App.build, at: "
|
18
|
+
mount RailsPgExtrasMcp::App.build, at: "pg_extras_mcp"
|
20
19
|
```
|
21
20
|
|
22
21
|
with optional authorization:
|
23
22
|
|
24
23
|
```ruby
|
25
24
|
opts = { auth_token: "secret" }
|
26
|
-
mount RailsPgExtrasMcp::App.build(opts), at: "
|
25
|
+
mount RailsPgExtrasMcp::App.build(opts), at: "pg_extras_mcp"
|
27
26
|
```
|
28
27
|
|
29
|
-
Refer to the [fast-mcp docs](https://github.com/yjacquin/fast-mcp) for a complete list of supported options (the `opts` hash is passed directly as-is). For
|
28
|
+
Refer to the [fast-mcp docs](https://github.com/yjacquin/fast-mcp) for a complete list of supported options (the `opts` hash is passed directly as-is). For production deployments, you'll likely need a similar config:
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
opts = { allowed_origins: [ /.*./ ], allowed_ips: [ "*" ], auth_token: "secret", localhost_only: false }
|
32
|
+
mount RailsPgExtrasMcp::App.build(opts) at: "pg_extras_mcp"
|
33
|
+
```
|
30
34
|
|
31
35
|
Next, install [mcp-remote](https://github.com/geelen/mcp-remote):
|
32
36
|
|
@@ -43,7 +47,7 @@ and in your LLM of choice:
|
|
43
47
|
"command": "npx",
|
44
48
|
"args": [
|
45
49
|
"mcp-remote",
|
46
|
-
"http://localhost:3000/
|
50
|
+
"http://localhost:3000/pg_extras_mcp/sse",
|
47
51
|
"--header",
|
48
52
|
"Authorization: secret"
|
49
53
|
]
|
data/lib/rails-pg-extras-mcp.rb
CHANGED
@@ -148,7 +148,7 @@ module RailsPgExtrasMcp
|
|
148
148
|
default_opts = {
|
149
149
|
name: "rails-pg-extras-mcp",
|
150
150
|
version: RailsPgExtrasMcp::VERSION,
|
151
|
-
path_prefix: "/
|
151
|
+
path_prefix: "/pg_extras_mcp",
|
152
152
|
logger: Logger.new($stdout),
|
153
153
|
}
|
154
154
|
|
@@ -157,9 +157,9 @@ module RailsPgExtrasMcp
|
|
157
157
|
rack_method_name = opts[:auth_token].present? ? :authenticated_rack_middleware : :rack_middleware
|
158
158
|
|
159
159
|
# Create the MCP middleware
|
160
|
-
|
161
|
-
|
162
|
-
|
160
|
+
FastMcp.public_send(rack_method_name,
|
161
|
+
app,
|
162
|
+
**opts) do |server|
|
163
163
|
server.register_tools(DiagnoseTool)
|
164
164
|
server.register_tools(MissingFkConstraintsTool)
|
165
165
|
server.register_tools(MissingFkIndexesTool)
|
@@ -168,8 +168,6 @@ module RailsPgExtrasMcp
|
|
168
168
|
server.register_tools(ExplainAnalyzeTool) if ENV["PG_EXTRAS_MCP_EXPLAIN_ANALYZE_ENABLED"] == "true"
|
169
169
|
|
170
170
|
server.register_resource(ReadmeResource)
|
171
|
-
|
172
|
-
Rack::Builder.new { run mcp_app }
|
173
171
|
end
|
174
172
|
end
|
175
173
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-pg-extras-mcp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pawurb
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails-pg-extras
|