shared_tools 0.7.0 → 0.7.1
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 +2 -0
- data/lib/shared_tools/mcp/brave_search_client.rb +2 -0
- data/lib/shared_tools/mcp/chart_client.rb +2 -0
- data/lib/shared_tools/mcp/client_support.rb +19 -0
- data/lib/shared_tools/mcp/github_client.rb +2 -0
- data/lib/shared_tools/mcp/hugging_face_client.rb +2 -0
- data/lib/shared_tools/mcp/memory_client.rb +2 -0
- data/lib/shared_tools/mcp/notion_client.rb +2 -0
- data/lib/shared_tools/mcp/playwright_client.rb +2 -0
- data/lib/shared_tools/mcp/sequential_thinking_client.rb +2 -0
- data/lib/shared_tools/mcp/slack_client.rb +2 -0
- data/lib/shared_tools/mcp/tavily_client.rb +2 -0
- data/lib/shared_tools/version.rb +1 -1
- metadata +17 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 34cacf7e0ae9289b41abac0941cd1123ff725d8dbac4d8ed8d793e7a01fdac88
|
|
4
|
+
data.tar.gz: cba8ee56b7c22b41847ce844c09edffb2e29a49844cd79a6eab1ccab758b25a3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 94dde27edb4d0b7e4d6df7537012df4bdb9d5f06a1e7e3839610d08b85ea3524056dd4eb6b3bc7cddf49791c9af9f7159fde9ed567c9a135d9fcb3653f633352
|
|
7
|
+
data.tar.gz: 3cb75f11a57a07a41695f46ad02e70d70af52506fe0778ae11bae53388fb12ffed06ceb524d9060e0b483d89b7c1f690d8949389b2d7d6732ada3917c1015b80
|
data/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
- **Breaking:** Requiring a client file no longer has side effects. It does not check environment variables, does not run `brew`/`apt`/`dnf`, and does not connect; environment variables are read when the server process starts. Use `Klass.available?` / `missing_envars` / `verify!` (raises `LoadError` like before) and `Klass.install_packages!`. `require 'shared_tools/mcp'` loads every definition, records availability for `SharedTools.mcp_status`, and `SharedTools::MCP.available` lists the usable classes.
|
|
9
9
|
- **Breaking:** MCP server names are now symbol-friendly: `brave-search` → `brave_search`, `hugging-face` → `hugging_face`, `sequential-thinking` → `sequential_thinking` (others unchanged). These are the names in `SharedTools.mcp_status` and `chat.mcp[...]`.
|
|
10
10
|
- Removed `lib/shared_tools/mcp/streamable_http_patch.rb`; it patched a `ruby_llm-mcp` internal. ruby_llm 2.1's spec-compliant SSE parser already handles mixed CRLF/LF line endings.
|
|
11
|
+
- Added `description` to `SharedTools::MCP::ClientSupport` (class macro plus instance reader; subclasses inherit it) and gave every MCP client one. robot_lab's `mcp_discovery: true` scores servers by name plus description, so it can now pick e.g. `SharedTools::MCP::GitHub` for "open a pull request" and `Playwright` for "take a screenshot of the page".
|
|
12
|
+
- Added `csv` as a runtime dependency. It is a bundled (not default) gem since Ruby 3.4, so `CsvReadTool`/`CsvWriteTool` -- and `SharedTools.tools` / `load_all_tools`, which eager-load them -- raised `LoadError: cannot load such file -- csv` in any bundle that did not list it.
|
|
11
13
|
- Added `test/shared_tools/tool_classes_test.rb`: every shipped `RubyLLM::Tool` subclass must define its own `#execute`, expose an object `parameters_schema` whose properties `#execute` accepts, and no 1.x `params do` / `param :` may remain in `lib/`. It also calls `current_date_time`, `system_info` and `dns` (used by aia's demo 18) through `Tool#call` and checks the data they return. Added `test/shared_tools/mcp/clients_test.rb` (class-level only; no servers are started).
|
|
12
14
|
- Updated the MCP examples, `lib/shared_tools/mcp/README.md`, `README.md` and `docs/` for the new MCP classes.
|
|
13
15
|
|
|
@@ -30,6 +30,8 @@ module SharedTools
|
|
|
30
30
|
class BraveSearch < ::RubyLLM::MCP
|
|
31
31
|
extend ClientSupport
|
|
32
32
|
|
|
33
|
+
description "Brave web search: current web pages, news, and local results"
|
|
34
|
+
|
|
33
35
|
requires_envars "BRAVE_API_KEY"
|
|
34
36
|
|
|
35
37
|
command "npx", "-y", "@modelcontextprotocol/server-brave-search"
|
|
@@ -50,10 +50,29 @@ module SharedTools
|
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
module ClientSupport
|
|
53
|
+
# Instance-side reader, so a server instance answers #description the
|
|
54
|
+
# way robot_lab's RobotLab::MCP::Server does.
|
|
55
|
+
module InstanceMethods
|
|
56
|
+
def description
|
|
57
|
+
self.class.description.to_s
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
53
61
|
def self.extended(klass)
|
|
62
|
+
klass.include(InstanceMethods)
|
|
54
63
|
SharedTools::MCP.register(klass)
|
|
55
64
|
end
|
|
56
65
|
|
|
66
|
+
# Declares (or, with no argument, returns) a short description of what
|
|
67
|
+
# the server offers. robot_lab's mcp_discovery scores servers by name
|
|
68
|
+
# plus description, so a description lets it pick this server for
|
|
69
|
+
# relevant messages. Subclasses inherit their parent's description.
|
|
70
|
+
def description(text = nil)
|
|
71
|
+
return @description || (superclass.description if superclass.respond_to?(:description)) if text.nil?
|
|
72
|
+
|
|
73
|
+
@description = text.to_s
|
|
74
|
+
end
|
|
75
|
+
|
|
57
76
|
# Declares (or, with no arguments, returns) the environment variables
|
|
58
77
|
# the server needs. All of them must be set for #available? to be true.
|
|
59
78
|
def requires_envars(*names)
|
|
@@ -30,6 +30,8 @@ module SharedTools
|
|
|
30
30
|
class GitHub < ::RubyLLM::MCP
|
|
31
31
|
extend ClientSupport
|
|
32
32
|
|
|
33
|
+
description "GitHub repositories, issues, pull requests, code search, commits, branches, and releases"
|
|
34
|
+
|
|
33
35
|
self.default_name = "github"
|
|
34
36
|
|
|
35
37
|
requires_envars "GITHUB_PERSONAL_ACCESS_TOKEN"
|
|
@@ -30,6 +30,8 @@ module SharedTools
|
|
|
30
30
|
class Memory < ::RubyLLM::MCP
|
|
31
31
|
extend ClientSupport
|
|
32
32
|
|
|
33
|
+
description "Persistent knowledge graph memory: remember and recall facts, entities, and relations across conversations"
|
|
34
|
+
|
|
33
35
|
command "npx", "-y", "@modelcontextprotocol/server-memory"
|
|
34
36
|
# An unset MEMORY_FILE_PATH resolves to "", which the server treats as unset.
|
|
35
37
|
env "MEMORY_FILE_PATH" => env_from("MEMORY_FILE_PATH")
|
|
@@ -30,6 +30,8 @@ module SharedTools
|
|
|
30
30
|
class SequentialThinking < ::RubyLLM::MCP
|
|
31
31
|
extend ClientSupport
|
|
32
32
|
|
|
33
|
+
description "Step-by-step chain-of-thought reasoning for complex, multi-stage problems"
|
|
34
|
+
|
|
33
35
|
command "npx", "-y", "@modelcontextprotocol/server-sequential-thinking"
|
|
34
36
|
end
|
|
35
37
|
end
|
|
@@ -39,6 +39,8 @@ module SharedTools
|
|
|
39
39
|
class Slack < ::RubyLLM::MCP
|
|
40
40
|
extend ClientSupport
|
|
41
41
|
|
|
42
|
+
description "Slack channels, messages, threads, users, and search"
|
|
43
|
+
|
|
42
44
|
TOKEN_ENVARS = %w[SLACK_MCP_XOXP_TOKEN SLACK_MCP_XOXB_TOKEN].freeze
|
|
43
45
|
|
|
44
46
|
requires_packages "slack-mcp-server"
|
data/lib/shared_tools/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: shared_tools
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dewayne VanHoozer
|
|
@@ -65,6 +65,22 @@ dependencies:
|
|
|
65
65
|
- ">="
|
|
66
66
|
- !ruby/object:Gem::Version
|
|
67
67
|
version: "0"
|
|
68
|
+
- !ruby/object:Gem::Dependency
|
|
69
|
+
name: csv
|
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
|
71
|
+
requirements:
|
|
72
|
+
-
|
|
73
|
+
- ">="
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: "0"
|
|
76
|
+
type: :runtime
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
-
|
|
81
|
+
- ">="
|
|
82
|
+
- !ruby/object:Gem::Version
|
|
83
|
+
version: "0"
|
|
68
84
|
- !ruby/object:Gem::Dependency
|
|
69
85
|
name: bigdecimal
|
|
70
86
|
requirement: !ruby/object:Gem::Requirement
|