Class: MCP::Server::Http
- Inherits:
-
Object
- Object
- MCP::Server::Http
- Defined in:
- lib/mcp/server/http.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize ⇒ Http
constructor
A new instance of Http.
Constructor Details
#initialize ⇒ Http
Returns a new instance of Http.
7 8 9 10 |
# File 'lib/mcp/server/http.rb', line 7 def initialize @request_handler = RequestHandler.new @clients = {} end |
Instance Method Details
#call(env) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/mcp/server/http.rb', line 12 def call(env) req = Rack::Request.new(env) path = req.path_info case path when "/sse", "/", "" sse(req, env) else [404, {"content-type" => "application/json"}, [{"error": "Not Found"}.to_json]] end end |