rails-pg-extras-mcp 0.1.3 → 0.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: a92bb63a916da728e0e31267dc0914bd6a680ca57546c4f4a6846d32f138112d
4
- data.tar.gz: ee68888ab60111cda67848bb545aa3346c00978b6d1a9044b60d7a314a1ddc7d
3
+ metadata.gz: 3d49b854cf56a160369f69fbc1d237e6ffc5ece9a82216c8689346927bc5f93f
4
+ data.tar.gz: 935a608f0ff2f97d597e07dcd7301ddb44bef0251ebe08e23edf4626729cc3a4
5
5
  SHA512:
6
- metadata.gz: 1513e087434334a1e09c5f1f14f7e805b62f60f5af9ae76a46f762f41ba378480d768720a0448cc594f5998a34450705299d20b85a1c4a1cd5c3c6dc05e41164
7
- data.tar.gz: 71a415e4871a366a58a4cc8506fb224e226fb0510d7c01b425342b18d9b14968720ab52654a4ba4be1551ea234f791005727d5617d39c75142a246bb0d6e60de
6
+ metadata.gz: 17963ea878ccb01318f4437dce9730fa6133f2bce70e6abee35366fc29bb67982c69c4c1523ecc4fc9018bf5253d4c3a03166160cba8af1b84cc851ed8245232
7
+ data.tar.gz: 016f5702235ba3b59502213327d0d44937958ba1a984b92d82f696c95ae431c752e9715a2fb41285add7c8631fe684d57341c6bdf6e5edf0119a5c9779bd738a
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Rails PG Extras MCP [![Gem Version](https://badge.fury.io/rb/rails-pg-extras-mcp.svg)](https://badge.fury.io/rb/rails-pg-extras-mcp) [![GH Actions](https://github.com/pawurb/rails-pg-extras-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/pawurb/rails-pg-extras-mcp/actions)
2
2
 
3
- MCP ([Model Context Protocol](https://modelcontextprotocol.io/introduction)) interface for [rails-pg-extras](https://github.com/pawurb/rails-pg-extras) gem. It enables PostgreSQL metadata and performance analysis with a simple LLM prompt.
3
+ MCP ([Model Context Protocol](https://modelcontextprotocol.io/introduction)) interface for [rails-pg-extras](https://github.com/pawurb/rails-pg-extras) gem. Easily explore PostgreSQL performance and metadata. Check for table bloat, slow queries, unused indexes, and more. Run `EXPLAIN ANALYZE` on bottlenecks and get clear, LLM-powered insights to optimize your database.
4
4
 
5
5
  ![LLM interface](https://github.com/pawurb/rails-pg-extras/raw/main/pg-extras-mcp.png)
6
6
 
@@ -16,16 +16,19 @@ The library supports MCP protocol via HTTP SSE interface.
16
16
  `config/routes.rb`
17
17
 
18
18
  ```ruby
19
- mount RailsPgExtras.mcp_app, at: "pg-extras-mcp"
19
+ mount RailsPgExtrasMcp::App.build, at: "pg-extras-mcp"
20
20
  ```
21
21
 
22
22
  with optional authorization:
23
23
 
24
24
  ```ruby
25
- mount RailsPgExtras.mcp_app(auth_token: "secret"), at: "pg-extras-mcp"
25
+ opts = { auth_token: "secret" }
26
+ mount RailsPgExtrasMcp::App.build(opts), at: "pg-extras-mcp"
26
27
  ```
27
28
 
28
- Install [mcp-remote](https://github.com/geelen/mcp-remote):
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 real-world deployments, you'll likely need to configure the `:allowed_origins` setting.
30
+
31
+ Next, install [mcp-remote](https://github.com/geelen/mcp-remote):
29
32
 
30
33
  ```bash
31
34
  npm install -g mcp-remote
@@ -139,24 +139,22 @@ end
139
139
 
140
140
  module RailsPgExtrasMcp
141
141
  class App
142
- def self.build(auth_token: nil)
142
+ def self.build(opts = {})
143
143
  app = lambda do |_env|
144
144
  [200, { "Content-Type" => "text/html" },
145
145
  ["<html><body><h1>Hello from Rack!</h1><p>This is a simple Rack app with MCP middleware.</p></body></html>"]]
146
146
  end
147
147
 
148
- opts = {
148
+ default_opts = {
149
149
  name: "rails-pg-extras-mcp",
150
150
  version: RailsPgExtrasMcp::VERSION,
151
151
  path_prefix: "/pg-extras-mcp",
152
152
  logger: Logger.new($stdout),
153
153
  }
154
154
 
155
- if auth_token.present?
156
- opts[:auth_token] = auth_token
157
- end
155
+ opts = default_opts.merge(opts)
158
156
 
159
- rack_method_name = auth_token.present? ? :authenticated_rack_middleware : :rack_middleware
157
+ rack_method_name = opts[:auth_token].present? ? :authenticated_rack_middleware : :rack_middleware
160
158
 
161
159
  # Create the MCP middleware
162
160
  mcp_app = FastMcp.public_send(rack_method_name,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsPgExtrasMcp
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  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.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - pawurb
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-06-23 00:00:00.000000000 Z
11
+ date: 2025-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails-pg-extras