hs-mcp-0.1.1.0: Library with tools for creating an MCP server implementation.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.MCP.Transport.Types

Synopsis

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

Instances details
Transport STDIOTransport Source #

A simple, synchronous transport implementation using standard input/output.

Instance details

Defined in Network.MCP.Transport.StdIO

data Message Source #

Combined message type for the transport layer

Instances

Instances details
FromJSON Message Source # 
Instance details

Defined in Network.MCP.Transport.Types

ToJSON Message Source # 
Instance details

Defined in Network.MCP.Transport.Types

Show Message Source # 
Instance details

Defined in Network.MCP.Transport.Types

Eq Message Source # 
Instance details

Defined in Network.MCP.Transport.Types

Methods

(==) :: Message -> Message -> Bool #

(/=) :: Message -> Message -> Bool #

data Request Source #

JSON-RPC Request

Instances

Instances details
FromJSON Request Source # 
Instance details

Defined in Network.MCP.Transport.Types

ToJSON Request Source # 
Instance details

Defined in Network.MCP.Transport.Types

Generic Request Source # 
Instance details

Defined in Network.MCP.Transport.Types

Associated Types

type Rep Request :: Type -> Type #

Methods

from :: Request -> Rep Request x #

to :: Rep Request x -> Request #

Show Request Source # 
Instance details

Defined in Network.MCP.Transport.Types

Eq Request Source # 
Instance details

Defined in Network.MCP.Transport.Types

Methods

(==) :: Request -> Request -> Bool #

(/=) :: Request -> Request -> Bool #

type Rep Request Source # 
Instance details

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)))))

data Response Source #

JSON-RPC Response

Instances

Instances details
FromJSON Response Source # 
Instance details

Defined in Network.MCP.Transport.Types

ToJSON Response Source # 
Instance details

Defined in Network.MCP.Transport.Types

Generic Response Source # 
Instance details

Defined in Network.MCP.Transport.Types

Associated Types

type Rep Response :: Type -> Type #

Methods

from :: Response -> Rep Response x #

to :: Rep Response x -> Response #

Show Response Source # 
Instance details

Defined in Network.MCP.Transport.Types

Eq Response Source # 
Instance details

Defined in Network.MCP.Transport.Types

type Rep Response Source # 
Instance details

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)

Instances

Instances details
FromJSON Notification Source # 
Instance details

Defined in Network.MCP.Transport.Types

ToJSON Notification Source # 
Instance details

Defined in Network.MCP.Transport.Types

Generic Notification Source # 
Instance details

Defined in Network.MCP.Transport.Types

Associated Types

type Rep Notification :: Type -> Type #

Show Notification Source # 
Instance details

Defined in Network.MCP.Transport.Types

Eq Notification Source # 
Instance details

Defined in Network.MCP.Transport.Types

type Rep Notification Source # 
Instance details

Defined in Network.MCP.Transport.Types

type Rep Notification = D1 ('MetaData "Notification" "Network.MCP.Transport.Types" "hs-mcp-0.1.1.0-5LuL8VDW0V2BNhAWDlOXoI" '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

Instances

Instances details
FromJSON ErrorResponse Source # 
Instance details

Defined in Network.MCP.Transport.Types

ToJSON ErrorResponse Source # 
Instance details

Defined in Network.MCP.Transport.Types

Generic ErrorResponse Source # 
Instance details

Defined in Network.MCP.Transport.Types

Associated Types

type Rep ErrorResponse :: Type -> Type #

Show ErrorResponse Source # 
Instance details

Defined in Network.MCP.Transport.Types

Eq ErrorResponse Source # 
Instance details

Defined in Network.MCP.Transport.Types

type Rep ErrorResponse Source # 
Instance details

Defined in Network.MCP.Transport.Types

type Rep ErrorResponse = D1 ('MetaData "ErrorResponse" "Network.MCP.Transport.Types" "hs-mcp-0.1.1.0-5LuL8VDW0V2BNhAWDlOXoI" '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)))))

newtype JSONRPC Source #

Constructors

JSONRPC 

Fields

Instances

Instances details
FromJSON JSONRPC Source # 
Instance details

Defined in Network.MCP.Transport.Types

ToJSON JSONRPC Source # 
Instance details

Defined in Network.MCP.Transport.Types

Generic JSONRPC Source # 
Instance details

Defined in Network.MCP.Transport.Types

Associated Types

type Rep JSONRPC :: Type -> Type #

Methods

from :: JSONRPC -> Rep JSONRPC x #

to :: Rep JSONRPC x -> JSONRPC #

Show JSONRPC Source # 
Instance details

Defined in Network.MCP.Transport.Types

Eq JSONRPC Source # 
Instance details

Defined in Network.MCP.Transport.Types

Methods

(==) :: JSONRPC -> JSONRPC -> Bool #

(/=) :: JSONRPC -> JSONRPC -> Bool #

type Rep JSONRPC Source # 
Instance details

Defined in Network.MCP.Transport.Types

type Rep JSONRPC = D1 ('MetaData "JSONRPC" "Network.MCP.Transport.Types" "hs-mcp-0.1.1.0-5LuL8VDW0V2BNhAWDlOXoI" 'True) (C1 ('MetaCons "JSONRPC" 'PrefixI 'True) (S1 ('MetaSel ('Just "unJSONRPC") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))