class ActionController::MCPServer::Transport

Overview

implements the Streamable HTTP transport

Defined in:

action-controller/mcp/transport.cr

Constant Summary

KEEPALIVE = 25.seconds
RESOURCE_METADATA_PATH = "/.well-known/oauth-protected-resource"
SESSION_HEADER = "Mcp-Session-Id"
VERSION_HEADER = "MCP-Protocol-Version"

Constructors

Instance Method Summary

Constructor Detail

def self.new(route_handler : Router::RouteHandler, path : String = "/mcp", endpoint : Bool = false) #

endpoint: true serves the controller endpoint mounted at #path


[View source]

Instance Method Detail

def auth_cache : AuthCache #

[View source]
def bound : Array(String) #

the path params bound from the URL, for controller endpoints


[View source]

terminates the session


[View source]
def get(context : HTTP::Server::Context, head_request : Bool) : HTTP::Server::Context #

opens an event stream for server to client messages


[View source]
def path : String #

the path the transport is mounted at, a template for controller endpoints


[View source]

client to server messages


[View source]
def protocol : Protocol #

[View source]
def resource_metadata(context : HTTP::Server::Context) : HTTP::Server::Context #

OAuth 2.0 protected resource metadata, see MCPServer.resource_metadata


[View source]
def sessions : SessionStore #

[View source]