mcpspan 0.7.0 → 0.8.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: 25cc72fce303e0fbb6aa636d4a50bba9f2c10756df307d965aab48476a94fb36
4
- data.tar.gz: 20b8cf13af0f6f24e9c40ac2ff0b4bdf9240c0f5ee7e7f436ec5b542c8f4f2d3
3
+ metadata.gz: 3888f3cee97d961023a23c24cf86dfdb54dcbb384b184059524d8a5996f5459d
4
+ data.tar.gz: 23ad781292bf7189838eb9de847fe7468301def79e220f43b907a622611d23f1
5
5
  SHA512:
6
- metadata.gz: 1fd550e46bba2af4c2d65bbaf6253f8835dd1773995fff00d1573422ca6eafda7fcb1a6c7c805009cb8ed2e45bbeb69625f46648a522fc25a7554032da283ffa
7
- data.tar.gz: 43df35e2670e3c746984df1075d08219e6ffc51d4304d1e9cf26ad165b96d4bad91307eaffdb4239fed51bc29d99e24b53413c34add6f5dd6eaa4d9b0f1f8a94
6
+ metadata.gz: fdda15380948b866168e7309939f1bfb586261a6c9a154dc8f5a6efb2e0e684c7cdfc7505d30ac6987f1d7465cf45c942f75cfb250cb1b55b02dfbf17860cc49
7
+ data.tar.gz: 22160e61a665c8dfd835cc2ae055bb44c84dc522b42f96337fd535cbbfbc014a79b41f6017b04b57f5a7790c890aa14e4afe66507efd0b1528626a396ad77154
@@ -39,10 +39,29 @@ module McpSpan
39
39
 
40
40
  server.singleton_class.prepend(ServerHooks)
41
41
  server.singleton_class.prepend(Primitives::ServerHooks) if Primitives.hookable?
42
+ rebind_handlers(server)
42
43
  watch_listings(server)
43
44
  server
44
45
  end
45
46
 
47
+ # The gem keeps its handlers as methods bound when the server was built, and from 1.10 tells its own
48
+ # `resources/read` handler from a developer's by comparing one with `method(:read_resource)`. A singleton class
49
+ # with modules prepended makes every later `method` a different object, so the comparison fails and the gem calls
50
+ # its own reader the way it calls a developer's, without the arguments it needs. Binding them again, after the
51
+ # hooks, keeps them equal to what the gem compares them with.
52
+ def rebind_handlers(server)
53
+ handlers = server.instance_variable_get(:@handlers)
54
+ return unless handlers.is_a?(Hash)
55
+
56
+ handlers.each do |name, handler|
57
+ next unless handler.is_a?(::Method) && handler.receiver.equal?(server)
58
+
59
+ handlers[name] = server.method(handler.name)
60
+ end
61
+ rescue StandardError
62
+ nil
63
+ end
64
+
46
65
  # Notes the tools each `tools/list` answer describes (contract, 3.8). The gem binds its handlers when the server
47
66
  # is built, so the bound handler is wrapped where the server keeps it, taking the server's context only if the
48
67
  # handler it wraps asks for it, as the gem decides from the handler's own parameters.
@@ -2,5 +2,5 @@
2
2
 
3
3
  module McpSpan
4
4
  # The SDK's own version, reported with every event.
5
- VERSION = "0.7.0"
5
+ VERSION = "0.8.2"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mcpspan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kacper Zatoń
@@ -31,10 +31,11 @@ files:
31
31
  - lib/mcpspan/text.rb
32
32
  - lib/mcpspan/transport.rb
33
33
  - lib/mcpspan/version.rb
34
- homepage: https://github.com/mcpspan/mcpspan
34
+ homepage: https://mcpspan.com
35
35
  licenses:
36
36
  - MIT
37
37
  metadata:
38
+ documentation_uri: https://mcpspan.com/docs/ruby/
38
39
  source_code_uri: https://github.com/mcpspan/mcpspan/tree/main/packages/mcpspan-ruby
39
40
  bug_tracker_uri: https://github.com/mcpspan/mcpspan/issues
40
41
  rubygems_mfa_required: 'true'
@@ -54,6 +55,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
55
  requirements: []
55
56
  rubygems_version: 4.0.20
56
57
  specification_version: 4
57
- summary: 'Self-hosted analytics for MCP servers: which tools, resources and prompts
58
+ summary: 'Open-source analytics for MCP servers: which tools, resources and prompts
58
59
  get used, by which client, how fast, and why they fail.'
59
60
  test_files: []