| Safe Haskell | None |
|---|---|
| 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
JSON-RPC Response
Constructors
| Response | |
Fields | |
Instances
| FromJSON Response Source # | |||||
Defined in Network.MCP.Transport.Types | |||||
| ToJSON Response Source # | |||||
| Generic Response Source # | |||||
Defined in Network.MCP.Transport.Types Associated Types
| |||||
| 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-JLoh9r68iDo86RtGS2ufDf" '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
| FromJSON Notification Source # | |||||
Defined in Network.MCP.Transport.Types | |||||
| ToJSON Notification Source # | |||||
Defined in Network.MCP.Transport.Types Methods toJSON :: Notification -> Value # toEncoding :: Notification -> Encoding # toJSONList :: [Notification] -> Value # toEncodingList :: [Notification] -> Encoding # omitField :: Notification -> Bool # | |||||
| Generic Notification Source # | |||||
Defined in Network.MCP.Transport.Types Associated Types
| |||||
| Show Notification Source # | |||||
Defined in Network.MCP.Transport.Types Methods showsPrec :: Int -> Notification -> ShowS # show :: Notification -> String # showList :: [Notification] -> ShowS # | |||||
| Eq Notification Source # | |||||
Defined in Network.MCP.Transport.Types | |||||
| type Rep Notification Source # | |||||
Defined in Network.MCP.Transport.Types type Rep Notification = D1 ('MetaData "Notification" "Network.MCP.Transport.Types" "hs-mcp-0.1.1.0-JLoh9r68iDo86RtGS2ufDf" 'False) (C1 ('MetaCons "Notification" 'PrefixI 'True) (S1 ('MetaSel ('Just "notificationJsonrpc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSONRPC) :*: (S1 ('MetaSel ('Just "notificationMethod") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "notificationParams") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Value))))) | |||||
data ErrorResponse Source #
JSON-RPC Error Response
Constructors
| ErrorResponse | |
Instances
| FromJSON ErrorResponse Source # | |||||
Defined in Network.MCP.Transport.Types Methods parseJSON :: Value -> Parser ErrorResponse # parseJSONList :: Value -> Parser [ErrorResponse] # | |||||
| ToJSON ErrorResponse Source # | |||||
Defined in Network.MCP.Transport.Types Methods toJSON :: ErrorResponse -> Value # toEncoding :: ErrorResponse -> Encoding # toJSONList :: [ErrorResponse] -> Value # toEncodingList :: [ErrorResponse] -> Encoding # omitField :: ErrorResponse -> Bool # | |||||
| Generic ErrorResponse Source # | |||||
Defined in Network.MCP.Transport.Types Associated Types
| |||||
| Show ErrorResponse Source # | |||||
Defined in Network.MCP.Transport.Types Methods showsPrec :: Int -> ErrorResponse -> ShowS # show :: ErrorResponse -> String # showList :: [ErrorResponse] -> ShowS # | |||||
| Eq ErrorResponse Source # | |||||
Defined in Network.MCP.Transport.Types Methods (==) :: ErrorResponse -> ErrorResponse -> Bool # (/=) :: ErrorResponse -> ErrorResponse -> Bool # | |||||
| type Rep ErrorResponse Source # | |||||
Defined in Network.MCP.Transport.Types type Rep ErrorResponse = D1 ('MetaData "ErrorResponse" "Network.MCP.Transport.Types" "hs-mcp-0.1.1.0-JLoh9r68iDo86RtGS2ufDf" 'False) (C1 ('MetaCons "ErrorResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "errorCode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: (S1 ('MetaSel ('Just "errorMessage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "errorData") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Value))))) | |||||
data TransportError Source #
Transport error
Constructors
| TransportError String |
Instances
| Exception TransportError Source # | |
Defined in Network.MCP.Transport.Types Methods toException :: TransportError -> SomeException # fromException :: SomeException -> Maybe TransportError # displayException :: TransportError -> String # backtraceDesired :: TransportError -> Bool # | |
| 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 # | |
Instances
| FromJSON JSONRPC Source # | |||||
Defined in Network.MCP.Transport.Types | |||||
| ToJSON JSONRPC Source # | |||||
| Generic JSONRPC Source # | |||||
Defined in Network.MCP.Transport.Types Associated Types
| |||||
| Show JSONRPC Source # | |||||
| Eq JSONRPC Source # | |||||
| type Rep JSONRPC Source # | |||||
Defined in Network.MCP.Transport.Types | |||||