foobara-mcp-connector-generator 0.0.4 → 0.0.6

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: 629c9fe7769061b89317afd70520324a568c476186c7bb8bbacd5f6a0e8e6e9f
4
- data.tar.gz: 446e4df029d02a5c1097a74fa1b333e3d6d84487dc1ddc4b52161fcc2ce4bae1
3
+ metadata.gz: 7d05889eef4ad70418a84df1bc66053e5de76381dc9e47d6d878032268c75c1e
4
+ data.tar.gz: 435239dde70d883248d5fa41c9a773b4189dd48420e2f4ffeddbee74a8b999da
5
5
  SHA512:
6
- metadata.gz: 0e8d4061ceb68f140e1f5a003086cd838b8caab7a77e16ac682436356d4200af0a1a9c4c655bf7fbfbf8c6480dc682d809d4c5f2fa58f84bab3f23f9a27e65f8
7
- data.tar.gz: dc73ccf0e0e21fcdadc8de7acbd842745924a10805adebb26ada2e5e7d60021ef716d5bb2b9424aebe4f4d29e878baec421f7ac148dda7823edc23c2a59e6c39
6
+ metadata.gz: 6889dd6ca11138dcb8c4f38d556ffe2ba6c59690faec544df03dc51c3eca11faf68f1224ac4b9991e7f5b59ecae1041c7de99862acfe776a28a0f8f2a3440575
7
+ data.tar.gz: d6fd2e58d0c5d5d0661fa54b5d51cb1b58c40005b2b1b59f664a7bd2bf26286780a869c24db6608d017a0ffe08d932501eeeefaef90402e37875c7f73289b138
data/CHANGELOG.md CHANGED
@@ -1,13 +1,10 @@
1
- ## [0.0.4] - 2025-04-14
1
+ ## [0.0.6] - 2025-04-14
2
2
 
3
+ - Don't bother running bundle or rubocop if they are not configured
4
+ - Make sure server can be run even if it's not in PATH
5
+ - Add an example command to the generated mcp-server file for demo purposes
3
6
  - Fix bug generating .mcp.json with wrong file extension
4
-
5
- ## [0.0.3] - 2025-04-14
6
-
7
7
  - Do not require a Gemfile to be present to generate the other files
8
-
9
- ## [0.0.2] - 2025-04-14
10
-
11
8
  - Include templates in gem
12
9
 
13
10
  ## [0.0.1] - 2025-04-11
@@ -24,7 +24,7 @@ module Foobara
24
24
  new_entry = %(
25
25
  "#{mcp_server_name}": {
26
26
  "type": "stdio",
27
- "command": "#{program_path}",
27
+ "command": "#{executable_program_path}",
28
28
  "args": [],
29
29
  "env": {}
30
30
  },)
@@ -14,6 +14,18 @@ module Foobara
14
14
  def program_name
15
15
  @program_name ||= File.basename(program_path)
16
16
  end
17
+
18
+ def executable_program_path
19
+ return @executable_program_path if @executable_program_path
20
+
21
+ @executable_program_path = program_path
22
+
23
+ if program_path =~ /^\w/
24
+ @executable_program_path = "./#{@executable_program_path}"
25
+ end
26
+
27
+ @executable_program_path
28
+ end
17
29
  end
18
30
  end
19
31
  end
@@ -70,6 +70,10 @@ module Foobara
70
70
  end
71
71
 
72
72
  def bundle_install
73
+ unless File.exist?("Gemfile")
74
+ return
75
+ end
76
+
73
77
  puts "bundling..."
74
78
  cmd = "bundle install"
75
79
 
@@ -87,6 +91,10 @@ module Foobara
87
91
  end
88
92
 
89
93
  def rubocop_autocorrect
94
+ unless File.exist?(".rubocop.yml")
95
+ return
96
+ end
97
+
90
98
  puts "linting..."
91
99
  cmd = "bundle exec rubocop --no-server -A"
92
100
 
@@ -2,7 +2,7 @@
2
2
  "mcpServers": {
3
3
  "<%= mcp_server_name %>": {
4
4
  "type": "stdio",
5
- "command": "<%= program_path %>",
5
+ "command": "<%= executable_program_path %>",
6
6
  "args": [],
7
7
  "env": {}
8
8
  }
@@ -9,6 +9,25 @@ end
9
9
 
10
10
  require "foobara/mcp_connector"
11
11
 
12
+ # Just a sample command. Delete this.
13
+ class BuildSuperDuperSecret < Foobara::Command
14
+ inputs do
15
+ seed :integer, :required
16
+ end
17
+ result :integer
18
+
19
+ def execute
20
+ build_secret
21
+ secret
22
+ end
23
+
24
+ attr_accessor :secret
25
+
26
+ def build_secret
27
+ self.secret = seed * seed * seed
28
+ end
29
+ end
30
+
12
31
  mcp_connector = Foobara::McpConnector.new
13
- mcp_connector.connect(SomeCommand)
32
+ mcp_connector.connect(BuildSuperDuperSecret)
14
33
  mcp_connector.run_stdio_server
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-mcp-connector-generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi