Module: ActionModelContext::Server
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/action_model_context/server.rb
Overview
Controller concern that serves MCP over the SDK's Streamable HTTP transport, stateless with JSON responses.
It discovers the primitives through ApplicationTool, ApplicationResource and ApplicationPrompt.
Instance Method Summary collapse
-
#mcp_access_token ⇒ MCP::Server::OAuth::AccessToken?
Gives the token verified through
config.action_model_context.oauth.token_verifier. -
#mcp_context ⇒ Object
Gives every primitive its
contextfor the request: override this private method in the controller. -
#mcp_server_options ⇒ Hash
Gives the keyword arguments of
MCP::Server.new: override this private method in the controller. -
#mcp_transport_options ⇒ Hash
Gives the keyword arguments of
MCP::Server::Transports::StreamableHTTPTransport.new: override this private method in the controller. -
#request_mcp_authentication ⇒ void
Answers the SDK's 401 challenge.
Instance Method Details
#mcp_access_token ⇒ MCP::Server::OAuth::AccessToken?
Gives the token verified through config.action_model_context.oauth.token_verifier.
#mcp_context ⇒ Object
Gives every primitive its context for the request: override this private method in the controller.
#mcp_server_options ⇒ Hash
Gives the keyword arguments of MCP::Server.new: override this private method in the controller.
#mcp_transport_options ⇒ Hash
Gives the keyword arguments of MCP::Server::Transports::StreamableHTTPTransport.new: override this private
method in the controller. stateless, enable_json_response and serve_subscriptions_listen stay pinned.
#request_mcp_authentication ⇒ void
This method returns an undefined value.
Answers the SDK's 401 challenge. Call this private method when the app itself rejects a request.