mcp_on_ruby 1.0.0 → 2.0.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.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +42 -4
  3. data/LICENSE.txt +1 -1
  4. data/README.md +350 -163
  5. data/config/routes.rb +5 -0
  6. data/lib/generators/mcp_on_ruby/expose/expose_generator.rb +108 -0
  7. data/lib/generators/mcp_on_ruby/install/install_generator.rb +37 -0
  8. data/lib/generators/mcp_on_ruby/install/templates/initializer.rb +22 -0
  9. data/lib/mcp_on_ruby/call_context.rb +29 -0
  10. data/lib/mcp_on_ruby/configuration.rb +63 -59
  11. data/lib/mcp_on_ruby/controller.rb +60 -0
  12. data/lib/mcp_on_ruby/declaration.rb +24 -0
  13. data/lib/mcp_on_ruby/dispatcher.rb +97 -0
  14. data/lib/mcp_on_ruby/doctor.rb +67 -0
  15. data/lib/mcp_on_ruby/endpoint.rb +43 -0
  16. data/lib/mcp_on_ruby/engine.rb +34 -0
  17. data/lib/mcp_on_ruby/registry.rb +146 -0
  18. data/lib/mcp_on_ruby/result.rb +83 -0
  19. data/lib/mcp_on_ruby/rspec.rb +8 -0
  20. data/lib/mcp_on_ruby/schema.rb +149 -0
  21. data/lib/mcp_on_ruby/server_factory.rb +70 -0
  22. data/lib/mcp_on_ruby/stdio.rb +42 -0
  23. data/lib/mcp_on_ruby/test_helper.rb +86 -0
  24. data/lib/mcp_on_ruby/tool_spec.rb +87 -0
  25. data/lib/mcp_on_ruby/tool_table.rb +31 -0
  26. data/lib/mcp_on_ruby/version.rb +2 -3
  27. data/lib/mcp_on_ruby/warden_hook.rb +21 -0
  28. data/lib/mcp_on_ruby.rb +44 -122
  29. data/lib/tasks/mcp_on_ruby.rake +20 -0
  30. metadata +65 -136
  31. data/CODE_OF_CONDUCT.md +0 -56
  32. data/CONTRIBUTING.md +0 -86
  33. data/bin/console +0 -11
  34. data/bin/setup +0 -6
  35. data/docs/advanced-usage.md +0 -132
  36. data/docs/api-reference.md +0 -35
  37. data/docs/testing.md +0 -55
  38. data/examples/claude/README.md +0 -171
  39. data/examples/claude/claude-bridge.js +0 -122
  40. data/lib/mcp_on_ruby/errors.rb +0 -137
  41. data/lib/mcp_on_ruby/generators/install_generator.rb +0 -46
  42. data/lib/mcp_on_ruby/generators/resource_generator.rb +0 -63
  43. data/lib/mcp_on_ruby/generators/templates/README +0 -31
  44. data/lib/mcp_on_ruby/generators/templates/application_resource.rb +0 -20
  45. data/lib/mcp_on_ruby/generators/templates/application_tool.rb +0 -18
  46. data/lib/mcp_on_ruby/generators/templates/initializer.rb +0 -41
  47. data/lib/mcp_on_ruby/generators/templates/resource.rb +0 -50
  48. data/lib/mcp_on_ruby/generators/templates/resource_spec.rb +0 -67
  49. data/lib/mcp_on_ruby/generators/templates/sample_resource.rb +0 -57
  50. data/lib/mcp_on_ruby/generators/templates/sample_tool.rb +0 -59
  51. data/lib/mcp_on_ruby/generators/templates/tool.rb +0 -38
  52. data/lib/mcp_on_ruby/generators/templates/tool_spec.rb +0 -55
  53. data/lib/mcp_on_ruby/generators/tool_generator.rb +0 -51
  54. data/lib/mcp_on_ruby/railtie.rb +0 -108
  55. data/lib/mcp_on_ruby/resource.rb +0 -161
  56. data/lib/mcp_on_ruby/server.rb +0 -378
  57. data/lib/mcp_on_ruby/tool.rb +0 -134
  58. 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: ac6effb14117c29ebe4aab9f0178aa7ded445b448c80f7438956cbfc088c1934
4
+ data.tar.gz: 052b0c6053db07aee0ebe0991949bae91ec268d9911b5512527b54fb2fb7c503
5
5
  SHA512:
6
- metadata.gz: a3927a0dbfba3cc726868a3f05690340d90bbd6a0715be53880bec3611f861bbf1cc7f817167e4df3373d6fd76e013575745a00c625e7a119f839683c7aa9166
7
- data.tar.gz: 4e9b2179b6c709597b0fe6d8327f8e7d1539107d32d2f76c237a82e3e1d06c86dcc0ea1d17e2f226e5524cb1772e91fc0478c7e188d977252db9de51a57708a1
6
+ metadata.gz: deafb7ff0545ab491e495fba46d21d27ff66e9c397d7466c1800b74206c98aa19569855148f4b0015e9cd5ce3a78bdc29b591a7599ca95b2afdf97d191b54054
7
+ data.tar.gz: 5da7f45bc3087d683a1f17283709f14b3e020b8f69ab270fa00156953abec498593e843c01278644ee57bf08fca227e2df1a9745ea9e747cb9b79974e1727a9e
data/CHANGELOG.md CHANGED
@@ -1,9 +1,47 @@
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/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
+ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Entries from 2.0.0 onward
6
+ are generated by [release-please](https://github.com/googleapis/release-please) from Conventional Commit PR titles.
7
+
8
+ ## [2.0.1](https://github.com/nagstler/mcp_on_ruby/compare/v2.0.0...v2.0.1) (2026-10-31)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * reuse tool classes when writes are disabled ([#33](https://github.com/nagstler/mcp_on_ruby/issues/33)) ([44be48c](https://github.com/nagstler/mcp_on_ruby/commit/44be48cafcb508a559b718f676e27990277bd41b))
14
+ * validate declarations once routes are loaded ([#32](https://github.com/nagstler/mcp_on_ruby/issues/32)) ([bf96834](https://github.com/nagstler/mcp_on_ruby/commit/bf968346f9131c6f898bdcf152726973079f3429))
15
+
16
+ ## [2.0.0](https://github.com/nagstler/mcp_on_ruby/compare/v1.0.0...v2.0.0) (2026-10-31)
17
+
18
+ MCP on Ruby is now a Rails engine that exposes existing controller actions as MCP tools,
19
+ built on the official [`mcp`](https://github.com/modelcontextprotocol/ruby-sdk) gem.
20
+
21
+ ### Added
22
+
23
+ - `mcp_tool` controller macro with a compact parameter schema DSL (nested objects, arrays, unions, nullable)
24
+ - Route-aware registry: path params become required arguments, annotations come from the HTTP verb, and
25
+ misconfiguration (unrouted declarations, unflagged writes, duplicate names) raises at boot
26
+ - Dispatch of tool calls as in-process requests through the full middleware stack, forwarding the caller's
27
+ `Authorization` header and cookies
28
+ - Result mapping from HTTP responses to MCP tool results, including structured JSON and agent-readable errors
29
+ - Stateless Streamable HTTP endpoint via `mount McpOnRuby::Engine, at: "/mcp"`
30
+ - `bin/rails mcp:stdio` with `stdio_user` (Devise/Warden) and `stdio_headers` (token auth) identities
31
+ - `bin/rails mcp:tools` and `bin/rails mcp:doctor`
32
+ - `mcp_on_ruby:install` and `mcp_on_ruby:expose` generators
33
+ - `McpOnRuby::TestHelper` (`mcp_call`, `mcp_tools`) and `mcp_on_ruby/rspec`
34
+ - `tool_call.mcp_on_ruby` instrumentation event
35
+ - `allow_writes` kill switch and `allowed_origins` for browser clients
36
+
37
+ ### Changed
38
+
39
+ - Requires Ruby 3.2+ and Rails 7.1+
40
+ - The protocol layer is provided by the official `mcp` gem
41
+
42
+ ### Removed
43
+
44
+ - The hand-written JSON-RPC server, Rack middleware, SSE transport, and `app/tools`/`app/resources` classes
7
45
 
8
46
  ## [1.0.0] - 2025-01-28
9
47
 
@@ -66,4 +104,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66
104
  - Tool definition and execution
67
105
  - Resource management
68
106
  - Prompt handling
69
- - Root filesystem access
107
+ - Root filesystem access
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2024
3
+ Copyright (c) 2024-present Nagendra Dhanakeerthi
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal