rubygems_mcp 0.1.1 → 0.1.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: 1a2188f3290de5f410a66437e48bacda1dfd194b7c8446ce6f7db4b6dbb5d644
4
- data.tar.gz: 1d6604125b76ed9493535466306d64d0f948b921d437b86faaa95016df2314b5
3
+ metadata.gz: a457f8426c2139f86ee038c95ceaca65c6b58ae60505f3f7c20e01f6d8df0b01
4
+ data.tar.gz: d8076f2259213d6a4737bbf4c3e1ec9f479354fc24a15bec3c3cdf7bd343bcbe
5
5
  SHA512:
6
- metadata.gz: be31aff229ddfd131b59e52fe42db7af5d9787e0833bf066baa90c7155f0973e5e2f17e7dd42e443650098464212b9c832671e5b7e01b22e3f9aa185eb13682f
7
- data.tar.gz: 38237f1b2c2f1ead4ebf0e72c0587bd005eec054a153db2081c5211ab86f7e00b0b4ad2d0b4c349d4828850a457b748b9f2a4fee5cb2507522f11368cb62ab02
6
+ metadata.gz: 52e7b9d695199beeabd3becceaf587c30e2d5b8b862a6a5648c3d290ef9a5a365c3709f2d43547dac81d3366beef9d23a3d12d32ad7bbec4208bf90c12b89704
7
+ data.tar.gz: 5730b35728600a1b2f1526cd2d18d87167b62054910c4b3c026481743bd1bbaa36c4f05aa0722b51fc62439b40322d81aca96a57dc7687abff8a00beba4e67d8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.1.2 (2025-11-21)
4
+
5
+ - Enhance Ruby version changelog retrieval and increase maximum response size
6
+ - Rename rubygems key to rubygems-dev in mcp.json configuration for development environment setup
7
+
3
8
  ## 0.1.1 (2025-11-21)
4
9
 
5
10
  - Update fast-mcp dependency version constraints to allow versions >= 0.1 and < 2.0
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # rubygems_mcp
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/rubygems_mcp.svg)](https://badge.fury.io/rb/rubygems_mcp) [![Test Status](https://github.com/amkisko/rubygems_mcp.rb/actions/workflows/test.yml/badge.svg)](https://github.com/amkisko/rubygems_mcp.rb/actions/workflows/test.yml)
3
+ [![Gem Version](https://badge.fury.io/rb/rubygems_mcp.svg?v=0.1.1)](https://badge.fury.io/rb/rubygems_mcp) [![Test Status](https://github.com/amkisko/rubygems_mcp.rb/actions/workflows/test.yml/badge.svg)](https://github.com/amkisko/rubygems_mcp.rb/actions/workflows/test.yml) [![codecov](https://codecov.io/gh/amkisko/rubygems_mcp.rb/graph/badge.svg?token=APQ6AK7EC9)](https://codecov.io/gh/amkisko/rubygems_mcp.rb)
4
4
 
5
5
  Ruby gem providing RubyGems and Ruby version information via MCP (Model Context Protocol) server tools. Integrates with MCP-compatible clients like Cursor IDE, Claude Desktop, and other MCP-enabled tools.
6
6
 
@@ -26,19 +26,6 @@ gem install rubygems_mcp
26
26
 
27
27
  For Cursor IDE, create or update `.cursor/mcp.json` in your project:
28
28
 
29
- ```json
30
- {
31
- "mcpServers": {
32
- "rubygems": {
33
- "command": "bundle",
34
- "args": ["exec", "rubygems_mcp"]
35
- }
36
- }
37
- }
38
- ```
39
-
40
- Or if installed globally:
41
-
42
29
  ```json
43
30
  {
44
31
  "mcpServers": {
@@ -56,20 +43,6 @@ For Claude Desktop, edit the MCP configuration file:
56
43
  **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
57
44
  **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
58
45
 
59
- ```json
60
- {
61
- "mcpServers": {
62
- "rubygems": {
63
- "command": "bundle",
64
- "args": ["exec", "rubygems_mcp"],
65
- "cwd": "/path/to/your/project"
66
- }
67
- }
68
- }
69
- ```
70
-
71
- Or if installed globally:
72
-
73
46
  ```json
74
47
  {
75
48
  "mcpServers": {
@@ -14,8 +14,8 @@ module RubygemsMcp
14
14
  # all_versions = client.get_gem_versions("rails")
15
15
  # ruby_version = client.get_latest_ruby_version
16
16
  class Client
17
- # Maximum response size (1MB) to protect against crawler protection pages
18
- MAX_RESPONSE_SIZE = 1024 * 1024 # 1MB
17
+ # Maximum response size (5MB) to protect against crawler protection pages
18
+ MAX_RESPONSE_SIZE = 5 * 1024 * 1024 # 5MB
19
19
 
20
20
  # Custom exception for corrupted data
21
21
  class CorruptedDataError < StandardError
@@ -351,12 +351,30 @@ module RubygemsMcp
351
351
 
352
352
  # Get full changelog content for a Ruby version from release notes
353
353
  #
354
- # @param version [String] Ruby version (e.g., "3.4.7")
354
+ # @param version [String] Ruby version (e.g., "3.4.7" or "4.0.0-preview2")
355
355
  # @return [Hash] Hash with :version, :release_notes_url, and :content (full content)
356
356
  def get_ruby_version_changelog(version)
357
357
  # First get the release notes URL for this version
358
358
  versions = get_ruby_versions
359
- version_data = versions.find { |v| v[:version] == version }
359
+
360
+ # Normalize the input version for comparison (handles formats like "4.0.0-preview2" -> "4.0.0.pre.preview2")
361
+ normalized_input = begin
362
+ Gem::Version.new(version).to_s
363
+ rescue ArgumentError
364
+ version
365
+ end
366
+
367
+ # Try exact match first, then normalized match
368
+ version_data = versions.find do |v|
369
+ v[:version] == version ||
370
+ v[:version] == normalized_input ||
371
+ begin
372
+ Gem::Version.new(v[:version]).to_s == normalized_input
373
+ rescue ArgumentError
374
+ false
375
+ end
376
+ end
377
+
360
378
  return {version: version, release_notes_url: nil, content: nil, error: "Version not found"} unless version_data
361
379
 
362
380
  release_notes_url = version_data[:release_notes_url]
@@ -240,7 +240,30 @@ module RubygemsMcp
240
240
  end
241
241
 
242
242
  def call(version:)
243
- get_client.get_ruby_version_changelog(version)
243
+ result = get_client.get_ruby_version_changelog(version)
244
+ # Convert content to MCP-compliant format
245
+ # MCP expects content to be an array of content items with type and text fields
246
+ if result.is_a?(Hash)
247
+ if result[:content].is_a?(String) && !result[:content].empty?
248
+ result[:content] = [{type: "text", text: result[:content]}]
249
+ elsif result[:content].is_a?(String) && result[:content].empty?
250
+ result[:content] = []
251
+ elsif result[:content].nil?
252
+ result[:content] = []
253
+ elsif result[:content].is_a?(Array)
254
+ # Ensure array elements have the correct format
255
+ result[:content] = result[:content].map do |item|
256
+ if item.is_a?(String)
257
+ {type: "text", text: item}
258
+ elsif item.is_a?(Hash) && !item.key?(:type)
259
+ item.merge(type: "text")
260
+ else
261
+ item
262
+ end
263
+ end
264
+ end
265
+ end
266
+ result
244
267
  end
245
268
  end
246
269
 
@@ -1,3 +1,3 @@
1
1
  module RubygemsMcp
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygems_mcp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Makarov