Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Network.MCP.Transport.Types
Synopsis
- class Transport t where
- data Message
- data Request = Request {}
- data Response = Response {}
- data Notification = Notification {}
- data ErrorResponse = ErrorResponse {}
- data TransportError = TransportError String
- newtype JSONRPC = JSONRPC {}
Documentation
class Transport t where Source #
Transport interface for all transport implementations
Methods
handleMessages :: t -> (Message -> IO (Maybe Message)) -> IO () Source #
Keep processing messages using the provided handler. Will only return if the transport mechanism signals termination; e.g. EOF on a socket or similar.
Instances
Transport STDIOTransport Source # | A simple, synchronous transport implementation using standard input/output. |
Defined in Network.MCP.Transport.StdIO Methods handleMessages :: STDIOTransport -> (Message -> IO (Maybe Message)) -> IO () Source # |
Combined message type for the transport layer
JSON-RPC Request
Constructors
Request | |
Fields
|
Instances
FromJSON Request Source # | |
ToJSON Request Source # | |
Defined in Network.MCP.Transport.Types | |
Generic Request Source # | |
Show Request Source # | |
Eq Request Source # | |
type Rep Request Source # | |
Defined in Network.MCP.Transport.Types type Rep Request = D1 ('MetaData "Request" "Network.MCP.Transport.Types" "hs-mcp-0.1.1.0-5LuL8VDW0V2BNhAWDlOXoI" 'False) (C1 ('MetaCons "Request" 'PrefixI 'True) ((S1 ('MetaSel ('Just "requestJsonrpc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSONRPC) :*: S1 ('MetaSel ('Just "requestId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value)) :*: (S1 ('MetaSel ('Just "requestMethod") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "requestParams") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Value))))) |
JSON-RPC Response
Constructors
Response | |
Fields |
Instances
FromJSON Response Source # | |
ToJSON Response Source # | |
Defined in Network.MCP.Transport.Types | |
Generic Response Source # | |
Show Response Source # | |
Eq Response Source # | |
type Rep Response Source # | |
Defined in Network.MCP.Transport.Types type Rep Response = D1 ('MetaData "Response" "Network.MCP.Transport.Types" "hs-mcp-0.1.1.0-5LuL8VDW0V2BNhAWDlOXoI" 'False) (C1 ('MetaCons "Response" 'PrefixI 'True) ((S1 ('MetaSel ('Just "responseJsonrpc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSONRPC) :*: S1 ('MetaSel ('Just "responseId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value)) :*: (S1 ('MetaSel ('Just "responseResult") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Value)) :*: S1 ('MetaSel ('Just "responseError") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ErrorResponse))))) |
data Notification Source #
JSON-RPC Notification (no ID)
Constructors
Notification | |
Fields |
Instances
data ErrorResponse Source #
JSON-RPC Error Response
Constructors
ErrorResponse | |
Instances
data TransportError Source #
Transport error
Constructors
TransportError String |
Instances
Exception TransportError Source # | |
Defined in Network.MCP.Transport.Types Methods toException :: TransportError -> SomeException # | |
Show TransportError Source # | |
Defined in Network.MCP.Transport.Types Methods showsPrec :: Int -> TransportError -> ShowS # show :: TransportError -> String # showList :: [TransportError] -> ShowS # | |
Eq TransportError Source # | |
Defined in Network.MCP.Transport.Types Methods (==) :: TransportError -> TransportError -> Bool # (/=) :: TransportError -> TransportError -> Bool # |