mcp-rb 0.3.2 → 0.3.3
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 +7 -0
 - data/lib/mcp/app/resource.rb +1 -1
 - data/lib/mcp/app/resource_template.rb +1 -1
 - data/lib/mcp/app/tool.rb +2 -1
 - data/lib/mcp/server.rb +5 -1
 - data/lib/mcp/version.rb +1 -1
 - metadata +4 -7
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 89a4d1cb8ae8957cb8a1d3a867e93218215dc4224eb2e03ab81baf81c0a1c6ba
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 5f16964ddf22038d610967d3ae8781fcf7a7f91b17d0b7b749a5c1d38251a967
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 9f743d921b897ae532ee48343ab3b318c0688e740a90b7b8a2e23fda1a3996669b5385ab49f59027c1c9d5333d57c65c54baa577c71970d6e5fa32e7ca209c75
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 441afb473c07c345647a036ae778dd7e36dad5cab6ad3bbad010a97d1ecc863d28bca0b4f5c6898cc86750566f8e0aabe99c93409f3f93c43d68b194c3aea973
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. 
     | 
|
| 
       5 
5 
     | 
    
         
             
            The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
         
     | 
| 
       6 
6 
     | 
    
         
             
            and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
         
     | 
| 
       7 
7 
     | 
    
         | 
| 
      
 8 
     | 
    
         
            +
            ## [0.3.3] - 2025-03-12
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            ### Fixed
         
     | 
| 
      
 11 
     | 
    
         
            +
            - Fix error response style: https://github.com/funwarioisii/mcp-rb/pull/12
         
     | 
| 
      
 12 
     | 
    
         
            +
              - Follow the return style of `handle_*` methods
         
     | 
| 
      
 13 
     | 
    
         
            +
            - Omit `nextCursor` key when no additional pages exist: https://github.com/funwarioisii/mcp-rb/pull/13
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
       8 
15 
     | 
    
         
             
            ## [0.3.2] - 2025-03-07
         
     | 
| 
       9 
16 
     | 
    
         | 
| 
       10 
17 
     | 
    
         
             
            ### Added
         
     | 
    
        data/lib/mcp/app/resource.rb
    CHANGED
    
    
    
        data/lib/mcp/app/tool.rb
    CHANGED
    
    | 
         @@ -112,8 +112,9 @@ module MCP 
     | 
|
| 
       112 
112 
     | 
    
         
             
                  def list_tools(cursor: nil, page_size: 10)
         
     | 
| 
       113 
113 
     | 
    
         
             
                    start = cursor ? cursor.to_i : 0
         
     | 
| 
       114 
114 
     | 
    
         
             
                    paginated = tools.values[start, page_size]
         
     | 
| 
      
 115 
     | 
    
         
            +
             
     | 
| 
       115 
116 
     | 
    
         
             
                    next_cursor = (start + page_size < tools.length) ? (start + page_size).to_s : nil
         
     | 
| 
       116 
     | 
    
         
            -
                    {tools: paginated.map { |t| {name: t[:name], description: t[:description], inputSchema: t[:input_schema]} }, nextCursor: next_cursor}
         
     | 
| 
      
 117 
     | 
    
         
            +
                    {tools: paginated.map { |t| {name: t[:name], description: t[:description], inputSchema: t[:input_schema]} }, nextCursor: next_cursor}.compact
         
     | 
| 
       117 
118 
     | 
    
         
             
                  end
         
     | 
| 
       118 
119 
     | 
    
         | 
| 
       119 
120 
     | 
    
         
             
                  # Calls a tool with the provided arguments
         
     | 
    
        data/lib/mcp/server.rb
    CHANGED
    
    | 
         @@ -169,7 +169,11 @@ module MCP 
     | 
|
| 
       169 
169 
     | 
    
         
             
                  arguments = request.dig(:params, :arguments)
         
     | 
| 
       170 
170 
     | 
    
         
             
                  begin
         
     | 
| 
       171 
171 
     | 
    
         
             
                    result = @app.call_tool(name, **arguments.transform_keys(&:to_sym))
         
     | 
| 
       172 
     | 
    
         
            -
                     
     | 
| 
      
 172 
     | 
    
         
            +
                    if result[:isError]
         
     | 
| 
      
 173 
     | 
    
         
            +
                      error_response(request[:id], Constants::ErrorCodes::INVALID_REQUEST, result[:content].first[:text])
         
     | 
| 
      
 174 
     | 
    
         
            +
                    else
         
     | 
| 
      
 175 
     | 
    
         
            +
                      success_response(request[:id], result)
         
     | 
| 
      
 176 
     | 
    
         
            +
                    end
         
     | 
| 
       173 
177 
     | 
    
         
             
                  rescue ArgumentError => e
         
     | 
| 
       174 
178 
     | 
    
         
             
                    error_response(request[:id], Constants::ErrorCodes::INVALID_REQUEST, e.message)
         
     | 
| 
       175 
179 
     | 
    
         
             
                  end
         
     | 
    
        data/lib/mcp/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,13 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: mcp-rb
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.3. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.3.3
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - funwarioisii
         
     | 
| 
       8 
     | 
    
         
            -
            autorequire:
         
     | 
| 
       9 
8 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
9 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2025-03- 
     | 
| 
      
 10 
     | 
    
         
            +
            date: 2025-03-12 00:00:00.000000000 Z
         
     | 
| 
       12 
11 
     | 
    
         
             
            dependencies: []
         
     | 
| 
       13 
12 
     | 
    
         
             
            description: MCP-RB is a Ruby framework that provides a Sinatra-like DSL for implementing
         
     | 
| 
       14 
13 
     | 
    
         
             
              Model Context Protocol servers.
         
     | 
| 
         @@ -38,7 +37,6 @@ metadata: 
     | 
|
| 
       38 
37 
     | 
    
         
             
              homepage_uri: https://github.com/funwarioisii/mcp-rb
         
     | 
| 
       39 
38 
     | 
    
         
             
              source_code_uri: https://github.com/funwarioisii/mcp-rb
         
     | 
| 
       40 
39 
     | 
    
         
             
              changelog_uri: https://github.com/funwarioisii/mcp-rb/blob/main/CHANGELOG.md
         
     | 
| 
       41 
     | 
    
         
            -
            post_install_message:
         
     | 
| 
       42 
40 
     | 
    
         
             
            rdoc_options: []
         
     | 
| 
       43 
41 
     | 
    
         
             
            require_paths:
         
     | 
| 
       44 
42 
     | 
    
         
             
            - lib
         
     | 
| 
         @@ -46,15 +44,14 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       46 
44 
     | 
    
         
             
              requirements:
         
     | 
| 
       47 
45 
     | 
    
         
             
              - - ">="
         
     | 
| 
       48 
46 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       49 
     | 
    
         
            -
                  version: 3. 
     | 
| 
      
 47 
     | 
    
         
            +
                  version: 3.3.0
         
     | 
| 
       50 
48 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       51 
49 
     | 
    
         
             
              requirements:
         
     | 
| 
       52 
50 
     | 
    
         
             
              - - ">="
         
     | 
| 
       53 
51 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       54 
52 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       55 
53 
     | 
    
         
             
            requirements: []
         
     | 
| 
       56 
     | 
    
         
            -
            rubygems_version: 3. 
     | 
| 
       57 
     | 
    
         
            -
            signing_key:
         
     | 
| 
      
 54 
     | 
    
         
            +
            rubygems_version: 3.6.2
         
     | 
| 
       58 
55 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       59 
56 
     | 
    
         
             
            summary: A lightweight Ruby framework for implementing MCP (Model Context Protocol)
         
     | 
| 
       60 
57 
     | 
    
         
             
              servers
         
     |