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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +1 -28
- data/lib/rubygems_mcp/client.rb +22 -4
- data/lib/rubygems_mcp/server.rb +24 -1
- data/lib/rubygems_mcp/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a457f8426c2139f86ee038c95ceaca65c6b58ae60505f3f7c20e01f6d8df0b01
|
|
4
|
+
data.tar.gz: d8076f2259213d6a4737bbf4c3e1ec9f479354fc24a15bec3c3cdf7bd343bcbe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
[](https://badge.fury.io/rb/rubygems_mcp) [](https://github.com/amkisko/rubygems_mcp.rb/actions/workflows/test.yml)
|
|
3
|
+
[](https://badge.fury.io/rb/rubygems_mcp) [](https://github.com/amkisko/rubygems_mcp.rb/actions/workflows/test.yml) [](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": {
|
data/lib/rubygems_mcp/client.rb
CHANGED
|
@@ -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 (
|
|
18
|
-
MAX_RESPONSE_SIZE = 1024 * 1024 #
|
|
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
|
-
|
|
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]
|
data/lib/rubygems_mcp/server.rb
CHANGED
|
@@ -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
|
|
data/lib/rubygems_mcp/version.rb
CHANGED