mcp_on_ruby 1.0.0 → 2.0.0

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.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +39 -3
  3. data/README.md +359 -163
  4. data/config/routes.rb +5 -0
  5. data/lib/generators/mcp_on_ruby/expose/expose_generator.rb +108 -0
  6. data/lib/generators/mcp_on_ruby/install/install_generator.rb +37 -0
  7. data/lib/generators/mcp_on_ruby/install/templates/initializer.rb +22 -0
  8. data/lib/mcp_on_ruby/call_context.rb +29 -0
  9. data/lib/mcp_on_ruby/configuration.rb +63 -59
  10. data/lib/mcp_on_ruby/controller.rb +60 -0
  11. data/lib/mcp_on_ruby/declaration.rb +24 -0
  12. data/lib/mcp_on_ruby/dispatcher.rb +97 -0
  13. data/lib/mcp_on_ruby/doctor.rb +67 -0
  14. data/lib/mcp_on_ruby/endpoint.rb +43 -0
  15. data/lib/mcp_on_ruby/engine.rb +29 -0
  16. data/lib/mcp_on_ruby/registry.rb +146 -0
  17. data/lib/mcp_on_ruby/result.rb +83 -0
  18. data/lib/mcp_on_ruby/rspec.rb +8 -0
  19. data/lib/mcp_on_ruby/schema.rb +149 -0
  20. data/lib/mcp_on_ruby/server_factory.rb +66 -0
  21. data/lib/mcp_on_ruby/stdio.rb +42 -0
  22. data/lib/mcp_on_ruby/test_helper.rb +86 -0
  23. data/lib/mcp_on_ruby/tool_spec.rb +87 -0
  24. data/lib/mcp_on_ruby/tool_table.rb +31 -0
  25. data/lib/mcp_on_ruby/version.rb +2 -3
  26. data/lib/mcp_on_ruby/warden_hook.rb +21 -0
  27. data/lib/mcp_on_ruby.rb +44 -122
  28. data/lib/tasks/mcp_on_ruby.rake +20 -0
  29. metadata +65 -136
  30. data/CODE_OF_CONDUCT.md +0 -56
  31. data/CONTRIBUTING.md +0 -86
  32. data/bin/console +0 -11
  33. data/bin/setup +0 -6
  34. data/docs/advanced-usage.md +0 -132
  35. data/docs/api-reference.md +0 -35
  36. data/docs/testing.md +0 -55
  37. data/examples/claude/README.md +0 -171
  38. data/examples/claude/claude-bridge.js +0 -122
  39. data/lib/mcp_on_ruby/errors.rb +0 -137
  40. data/lib/mcp_on_ruby/generators/install_generator.rb +0 -46
  41. data/lib/mcp_on_ruby/generators/resource_generator.rb +0 -63
  42. data/lib/mcp_on_ruby/generators/templates/README +0 -31
  43. data/lib/mcp_on_ruby/generators/templates/application_resource.rb +0 -20
  44. data/lib/mcp_on_ruby/generators/templates/application_tool.rb +0 -18
  45. data/lib/mcp_on_ruby/generators/templates/initializer.rb +0 -41
  46. data/lib/mcp_on_ruby/generators/templates/resource.rb +0 -50
  47. data/lib/mcp_on_ruby/generators/templates/resource_spec.rb +0 -67
  48. data/lib/mcp_on_ruby/generators/templates/sample_resource.rb +0 -57
  49. data/lib/mcp_on_ruby/generators/templates/sample_tool.rb +0 -59
  50. data/lib/mcp_on_ruby/generators/templates/tool.rb +0 -38
  51. data/lib/mcp_on_ruby/generators/templates/tool_spec.rb +0 -55
  52. data/lib/mcp_on_ruby/generators/tool_generator.rb +0 -51
  53. data/lib/mcp_on_ruby/railtie.rb +0 -108
  54. data/lib/mcp_on_ruby/resource.rb +0 -161
  55. data/lib/mcp_on_ruby/server.rb +0 -378
  56. data/lib/mcp_on_ruby/tool.rb +0 -134
  57. data/lib/mcp_on_ruby/transport.rb +0 -330
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 41b083ae138856bff622b5bbdcaa2112ee08961b1eda6acec5a4bb5a7a6f0b04
4
- data.tar.gz: e67b154ece12257fd300fd4824d25392a1a103de5ef0c8b0654fe17af970dd97
3
+ metadata.gz: 611ceb54904a193a5ac06d7fc7d223d835067a3d2232b05fc8a46dd1b14b96ac
4
+ data.tar.gz: 8d368c37165bf816104cb32345f7576b95e6e36ff5a01e3b2ecf7a07e497172a
5
5
  SHA512:
6
- metadata.gz: a3927a0dbfba3cc726868a3f05690340d90bbd6a0715be53880bec3611f861bbf1cc7f817167e4df3373d6fd76e013575745a00c625e7a119f839683c7aa9166
7
- data.tar.gz: 4e9b2179b6c709597b0fe6d8327f8e7d1539107d32d2f76c237a82e3e1d06c86dcc0ea1d17e2f226e5524cb1772e91fc0478c7e188d977252db9de51a57708a1
6
+ metadata.gz: 1c0528601bea68540a356a143abc104267e3b3bd8972c38544f13d0a1dd49696ab2d62d571ca6f51a9bdc0b5088e8f0eac4bebd18cef307759babfeaadc1e4d0
7
+ data.tar.gz: 183338a617d68e0e7fd963d627439e62cfdf66045f80f621b778cd12294ab34bf015f2ccf813ca3b747ce74c7bf1ef01e193e785423f6e94e4fac2e8b7918804
data/CHANGELOG.md CHANGED
@@ -1,10 +1,42 @@
1
1
  # Changelog
2
2
 
3
- All notable changes to this project will be documented in this file.
3
+ All notable changes to this project are documented in this file.
4
4
 
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [Unreleased]
9
+
10
+ ## [2.0.0] - 2026-10-31
11
+
12
+ MCP on Ruby is now a Rails engine that exposes existing controller actions as MCP tools,
13
+ built on the official [`mcp`](https://github.com/modelcontextprotocol/ruby-sdk) gem.
14
+
15
+ ### Added
16
+
17
+ - `mcp_tool` controller macro with a compact parameter schema DSL (nested objects, arrays, unions, nullable)
18
+ - Route-aware registry: path params become required arguments, annotations come from the HTTP verb, and
19
+ misconfiguration (unrouted declarations, unflagged writes, duplicate names) raises at boot
20
+ - Dispatch of tool calls as in-process requests through the full middleware stack, forwarding the caller's
21
+ `Authorization` header and cookies
22
+ - Result mapping from HTTP responses to MCP tool results, including structured JSON and agent-readable errors
23
+ - Stateless Streamable HTTP endpoint via `mount McpOnRuby::Engine, at: "/mcp"`
24
+ - `bin/rails mcp:stdio` with `stdio_user` (Devise/Warden) and `stdio_headers` (token auth) identities
25
+ - `bin/rails mcp:tools` and `bin/rails mcp:doctor`
26
+ - `mcp_on_ruby:install` and `mcp_on_ruby:expose` generators
27
+ - `McpOnRuby::TestHelper` (`mcp_call`, `mcp_tools`) and `mcp_on_ruby/rspec`
28
+ - `tool_call.mcp_on_ruby` instrumentation event
29
+ - `allow_writes` kill switch and `allowed_origins` for browser clients
30
+
31
+ ### Changed
32
+
33
+ - Requires Ruby 3.2+ and Rails 7.1+
34
+ - The protocol layer is provided by the official `mcp` gem
35
+
36
+ ### Removed
37
+
38
+ - The hand-written JSON-RPC server, Rack middleware, SSE transport, and `app/tools`/`app/resources` classes
39
+
8
40
  ## [1.0.0] - 2025-01-28
9
41
 
10
42
  ### Added
@@ -66,4 +98,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66
98
  - Tool definition and execution
67
99
  - Resource management
68
100
  - Prompt handling
69
- - Root filesystem access
101
+ - Root filesystem access
102
+
103
+ [Unreleased]: https://github.com/nagstler/mcp_on_ruby/compare/v2.0.0...HEAD
104
+ [2.0.0]: https://github.com/nagstler/mcp_on_ruby/compare/v1.0.0...v2.0.0
105
+ [1.0.0]: https://github.com/nagstler/mcp_on_ruby/releases/tag/v1.0.0