Documentation
¶
Index ¶
- func Dial(network, address string) (*rpc.Client, error)
- func NewClient(conn Connection) *rpc.Client
- type Connection
- type Error
- type ErrorCode
- type ErrorInternalError
- type ErrorInvalidParams
- type ErrorInvalidRequest
- type ErrorMethodNotFound
- type ErrorParseError
- type ErrorServerError
- type Response
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient(conn Connection) *rpc.Client
Types ¶
type Connection ¶
type Connection interface {
io.ReadWriteCloser
}
type ErrorInternalError ¶
type ErrorInternalError error
type ErrorInvalidParams ¶
type ErrorInvalidParams error
type ErrorInvalidRequest ¶
type ErrorInvalidRequest error
type ErrorMethodNotFound ¶
type ErrorMethodNotFound error
type ErrorParseError ¶
type ErrorParseError error
type ErrorServerError ¶
type ErrorServerError error
type Response ¶
type Response struct {
JSONRPC string `json:"jsonrpc"`
Result any `json:"result"`
Error *Error `json:"error"`
ID *json.RawMessage `json:"id"`
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server embeds the rpc.Server. server is not exported, which inherently limits access to the server API. This is a deliberate and opinionated design decision to make the mcp implementation easier to understand and maintain.
func NewServer ¶
func NewServer() *Server
NewServer creates a new json RPC server. The default codec is used to ensure that the server is compatible with the json RPC 2.0 spec. Again, this is a rigid, but intentional decision.
Click to show internal directories.
Click to hide internal directories.