active_mcp 0.10.5 → 0.10.7

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: f7a6dec91d1f48ced13dc1699bf78b251961a4dfaf41b1c95531465c618c3ba2
4
- data.tar.gz: e21b02b26027a3d87c44231f4cf7076febd82746e4a222fe1112a8b6b650ba12
3
+ metadata.gz: 44984b9388215cac9356b583bb1ad5a51f4704a3b962a767511fa388fec54a97
4
+ data.tar.gz: 1da490ee543533d22cf415c5643d7526ae4f4f6c391263ebf684f12833fecacf
5
5
  SHA512:
6
- metadata.gz: eace2e1b1abdfca71fe7884d654e8d698a07e0c1f175462db46a80f798e2b8a31d2561a8b3c95f558ed3d3f374ab3013f341d3eb3733e79d6f9650617ac05137
7
- data.tar.gz: 231879557b7ec110bf2810e0ee66566cbd1bc791d695bff869b9ac197c67cfdba16e3aea1aa1fd5b2821517c99726f50d3698cdd27d499d76fa165584d7e6b72
6
+ metadata.gz: 753e739d05030c32407d95d608e4e47341bf615f18b3d114716f2174bd75d397f2db1dfd70423e3f009de99433c33a39b39deab827900dbb70bb8a31c381f8d7
7
+ data.tar.gz: f5947091cb8ecf33994e5768c9748d7a9bdee4dc9df5548279dbd368a7c094c06abcf2fa8d4f0b9816f4ab92a6b0f3df6b2e353cabb5a004e49841f61cb1ed5e
data/README.md CHANGED
@@ -350,6 +350,12 @@ Resources are Ruby classes `**Resource`:
350
350
 
351
351
  ```ruby
352
352
  class UserResource < ActiveMcp::Resource::Base
353
+ class << self
354
+ def mime_type
355
+ "application/json"
356
+ end
357
+ end
358
+
353
359
  def initialize(id:)
354
360
  @user = User.find(id)
355
361
  end
@@ -362,10 +368,6 @@ class UserResource < ActiveMcp::Resource::Base
362
368
  "data://localhost/users/#{@user.id}"
363
369
  end
364
370
 
365
- def mime_type
366
- "application/json"
367
- end
368
-
369
371
  def description
370
372
  @user.profile
371
373
  end
@@ -6,14 +6,11 @@ module ActiveMcp
6
6
  [
7
7
  Rails.root.join("app", "mcp", "tools"),
8
8
  Rails.root.join("app", "mcp", "resources"),
9
- Rails.root.join("app", "mcp", "resource_templates"),
10
9
  Rails.root.join("app", "mcp", "prompts"),
11
10
  Rails.root.join("app", "mcp", "schemas")
12
- ].each do |tools_path|
13
- if Dir.exist?(tools_path)
14
- Dir[tools_path.join("*.rb")].sort.each do |file|
15
- require_dependency file
16
- end
11
+ ].each do |path|
12
+ if Dir.exist?(path)
13
+ app.autoloaders.main.push_dir(path)
17
14
  end
18
15
  end
19
16
  end
@@ -7,6 +7,18 @@ module ActiveMcp
7
7
  @context = context
8
8
  end
9
9
 
10
+ def tools
11
+ []
12
+ end
13
+
14
+ def resources
15
+ []
16
+ end
17
+
18
+ def prompts
19
+ []
20
+ end
21
+
10
22
  def visible_resources
11
23
  resources&.filter do |resource|
12
24
  !resource.respond_to?(:visible?) || resource.visible?(context: @context)
@@ -39,6 +39,7 @@ module ActiveMcp
39
39
  request = Net::HTTP::Post.new(uri)
40
40
  request.body = JSON.generate(params)
41
41
  request["Content-Type"] = "application/json"
42
+ request["Accept"] = "application/json"
42
43
  request["Authorization"] = @auth_header
43
44
 
44
45
  begin
@@ -1,3 +1,3 @@
1
1
  module ActiveMcp
2
- VERSION = "0.10.5"
2
+ VERSION = "0.10.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_mcp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.5
4
+ version: 0.10.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moeki Kawakami
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-04-09 00:00:00.000000000 Z
11
+ date: 2025-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails