micro_mcp 0.1.4-arm64-darwin → 0.1.5.pre.1-arm64-darwin
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 +3 -0
- data/ext/micro_mcp/AGENTS.md +31 -0
- data/lib/micro_mcp/3.2/micro_mcp.bundle +0 -0
- data/lib/micro_mcp/3.3/micro_mcp.bundle +0 -0
- data/lib/micro_mcp/3.4/micro_mcp.bundle +0 -0
- data/lib/micro_mcp/prompt_registry.rb +11 -0
- data/lib/micro_mcp/version.rb +1 -1
- data/lib/micro_mcp.rb +2 -1
- data/scripts/build_platforms.rb +44 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a874fc674a2a0a9a8a81cbaa2643009bb2a1088c5e9b44330b3edd0aead253f7
|
|
4
|
+
data.tar.gz: c4c2af7cda0550e984e1a2b6b868315a24a8ecbb0b3b054b585dd6806237a371
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: be5603a550a676e482789faecc7afeb3eb004a2df0e499348ad610f3618db57225614942ac2fb2fb363ccfc4da7326e4f67ab538c847df480f4217c90e0af280
|
|
7
|
+
data.tar.gz: 9084e154af92c82eb1ad4be9ece3a987d463de65149bf6e1e013d0587944d0f95a43edda4d2416344e694cf007ed6f71b64ad2884dbb655e6abfeae46a797e71
|
data/CHANGELOG.md
CHANGED
|
@@ -6,11 +6,14 @@
|
|
|
6
6
|
- Argument support for tools
|
|
7
7
|
- Exposed `client_supports_sampling` on runtime
|
|
8
8
|
- Exposed `create_message` on runtime
|
|
9
|
+
- Prompt registry for registering prompts with arguments and runtime access
|
|
9
10
|
|
|
10
11
|
### Changed
|
|
11
12
|
- Gem renamed from `mcp_lite` to `micro_mcp`
|
|
12
13
|
- Tool handling uses a dynamic registry
|
|
13
14
|
- Improved server error handling
|
|
15
|
+
- Updated dependency `rust-mcp-sdk` to 0.5.0
|
|
16
|
+
- Rooted stored Ruby `Proc` objects to avoid GC issues
|
|
14
17
|
|
|
15
18
|
## [0.1.0] - 2025-06-17
|
|
16
19
|
|
data/ext/micro_mcp/AGENTS.md
CHANGED
|
@@ -64,3 +64,34 @@ cargo metadata --format-version 1 --no-deps \
|
|
|
64
64
|
- Memory management between Rust and Ruby
|
|
65
65
|
- Proper error handling across language boundaries
|
|
66
66
|
- Thread safety considerations
|
|
67
|
+
|
|
68
|
+
## Ruby & Rust GC Rules
|
|
69
|
+
|
|
70
|
+
- Ruby's GC can't see values stored in ordinary Rust memory. Anything kept in a
|
|
71
|
+
`Vec`, `HashMap`, `OnceCell`, or static variable must be rooted or pinned.
|
|
72
|
+
- Use `value::BoxValue<T>` to pin individual Ruby `Value`s. `BoxValue::new` will
|
|
73
|
+
`rb_gc_register_address` the object so it stays valid.
|
|
74
|
+
- Expose Rust structs to Ruby with `#[magnus::wrap]`/`#[derive(TypedData)]` and
|
|
75
|
+
`Obj<T>`. `Obj<T>` is just a typed handle, so wrap it again in `BoxValue` (or
|
|
76
|
+
register it) if you keep it on the Rust side.
|
|
77
|
+
- For containers of many Ruby values, wrap the container itself in a `TypedData`
|
|
78
|
+
struct and implement a `mark` method to mark each entry. Root that single
|
|
79
|
+
wrapper instead of each entry.
|
|
80
|
+
- When using globals, prefer a wrapper similar to:
|
|
81
|
+
|
|
82
|
+
```rust
|
|
83
|
+
static REG: OnceCell<Obj<Registry>> = OnceCell::new();
|
|
84
|
+
let reg = REG.get_or_init(|| {
|
|
85
|
+
let obj = Obj::wrap(Registry::new());
|
|
86
|
+
magnus::gc::register_mark_object(obj); // root the wrapper
|
|
87
|
+
obj
|
|
88
|
+
});
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Testing Checklist
|
|
92
|
+
|
|
93
|
+
1. Call `GC.start` and `GC.compact` after each Ruby call in tests to stress the
|
|
94
|
+
garbage collector.
|
|
95
|
+
2. Run `cargo miri` (or valgrind) to detect use-after-free in unsafe code.
|
|
96
|
+
3. Remember `Obj<T>` is not `Send`/`Sync`; `BoxValue<T>` is. Convert or guard
|
|
97
|
+
before crossing threads.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module MicroMcp
|
|
4
|
+
module PromptRegistry
|
|
5
|
+
def self.register_prompt(name:, description: nil, arguments: nil, &block)
|
|
6
|
+
raise ArgumentError, "block required" unless block
|
|
7
|
+
|
|
8
|
+
MicroMcpNative.register_prompt(name, description, arguments, block)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
data/lib/micro_mcp/version.rb
CHANGED
data/lib/micro_mcp.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require_relative "micro_mcp/version"
|
|
4
|
-
ruby_version =
|
|
4
|
+
ruby_version = RUBY_VERSION[/\d+\.\d+/].to_s
|
|
5
5
|
begin
|
|
6
6
|
require_relative "micro_mcp/micro_mcp"
|
|
7
7
|
rescue LoadError
|
|
@@ -13,6 +13,7 @@ rescue LoadError
|
|
|
13
13
|
end
|
|
14
14
|
require_relative "micro_mcp/schema"
|
|
15
15
|
require_relative "micro_mcp/tool_registry"
|
|
16
|
+
require_relative "micro_mcp/prompt_registry"
|
|
16
17
|
require_relative "micro_mcp/server"
|
|
17
18
|
require_relative "micro_mcp/runtime_helpers"
|
|
18
19
|
require_relative "micro_mcp/validation_helpers"
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
# Script to build MicroMcp gem for multiple platforms using rb-sys-dock
|
|
5
|
+
# This script calls rb-sys-dock for each platform with the specified Ruby versions
|
|
6
|
+
|
|
7
|
+
PLATFORMS = %w[arm64-darwin x86_64-darwin x86_64-linux].freeze
|
|
8
|
+
RUBY_VERSIONS = "3.2,3.3,3.4"
|
|
9
|
+
|
|
10
|
+
def run_command(command)
|
|
11
|
+
puts "Running: #{command}"
|
|
12
|
+
success = system(command)
|
|
13
|
+
unless success
|
|
14
|
+
puts "ERROR: Command failed: #{command}"
|
|
15
|
+
exit 1
|
|
16
|
+
end
|
|
17
|
+
puts "✓ Command completed successfully\n"
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def main
|
|
21
|
+
puts "Building MicroMcp gem for multiple platforms..."
|
|
22
|
+
puts "Platforms: #{PLATFORMS.join(", ")}"
|
|
23
|
+
puts "Ruby versions: #{RUBY_VERSIONS}"
|
|
24
|
+
puts
|
|
25
|
+
|
|
26
|
+
run_command("bundle exec rake build")
|
|
27
|
+
|
|
28
|
+
PLATFORMS.each do |platform|
|
|
29
|
+
puts "=" * 60
|
|
30
|
+
puts "Building for platform: #{platform}"
|
|
31
|
+
puts "=" * 60
|
|
32
|
+
|
|
33
|
+
command = "bundle exec rb-sys-dock --platform #{platform} --ruby-versions #{RUBY_VERSIONS} --build"
|
|
34
|
+
run_command(command)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
puts "=" * 60
|
|
38
|
+
puts "All platforms built successfully! 🎉"
|
|
39
|
+
puts "=" * 60
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
if __FILE__ == $PROGRAM_NAME
|
|
43
|
+
main
|
|
44
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: micro_mcp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.5.pre.1
|
|
5
5
|
platform: arm64-darwin
|
|
6
6
|
authors:
|
|
7
7
|
- Erwin Kroon
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-08-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: ''
|
|
14
14
|
email:
|
|
@@ -32,12 +32,14 @@ files:
|
|
|
32
32
|
- lib/micro_mcp/3.2/micro_mcp.bundle
|
|
33
33
|
- lib/micro_mcp/3.3/micro_mcp.bundle
|
|
34
34
|
- lib/micro_mcp/3.4/micro_mcp.bundle
|
|
35
|
+
- lib/micro_mcp/prompt_registry.rb
|
|
35
36
|
- lib/micro_mcp/runtime_helpers.rb
|
|
36
37
|
- lib/micro_mcp/schema.rb
|
|
37
38
|
- lib/micro_mcp/server.rb
|
|
38
39
|
- lib/micro_mcp/tool_registry.rb
|
|
39
40
|
- lib/micro_mcp/validation_helpers.rb
|
|
40
41
|
- lib/micro_mcp/version.rb
|
|
42
|
+
- scripts/build_platforms.rb
|
|
41
43
|
homepage: https://github.com/ekroon/micro_mcp
|
|
42
44
|
licenses:
|
|
43
45
|
- MIT
|