Class: Rasti::AI::MCP::Server
- Inherits:
-
Object
- Object
- Rasti::AI::MCP::Server
- Extended by:
- ClassConfig
- Defined in:
- lib/rasti/ai/mcp/server.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Server
constructor
A new instance of Server.
Constructor Details
#initialize(app) ⇒ Server
Returns a new instance of Server.
24 25 26 |
# File 'lib/rasti/ai/mcp/server.rb', line 24 def initialize(app) @app = app end |
Class Method Details
.authenticate(&block) ⇒ Object
19 20 21 |
# File 'lib/rasti/ai/mcp/server.rb', line 19 def authenticate(&block) self.authenticator = block end |
.load_tools(&block) ⇒ Object
15 16 17 |
# File 'lib/rasti/ai/mcp/server.rb', line 15 def load_tools(&block) self.tools_loader = block end |
Instance Method Details
#call(env) ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/rasti/ai/mcp/server.rb', line 28 def call(env) request = Rack::Request.new env if request.post? && request.path == self.class.relative_path handle_mcp_request request else app.call env end end |