rpc

package
v0.4.8-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package rpc provides an RPC server for code execution to call MCP tools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MCPRPCRequest

type MCPRPCRequest struct {
	Server    string         `json:"server"`
	Tool      string         `json:"tool"`
	Arguments map[string]any `json:"arguments"`
}

MCPRPCRequest represents a request to call an MCP tool

type MCPRPCResponse

type MCPRPCResponse struct {
	Content           []map[string]any `json:"content"`
	StructuredContent any              `json:"structuredContent,omitempty"`
	IsError           bool             `json:"isError"`
}

MCPRPCResponse represents the response from an MCP tool call

type MCPRPCServer

type MCPRPCServer struct {
	// contains filtered or unexported fields
}

MCPRPCServer provides an RPC endpoint for code execution to call MCP tools

func NewMCPHTTPRPCServer

func NewMCPHTTPRPCServer(mcpManager *tools.MCPManager, bearerToken string) (*MCPRPCServer, error)

NewMCPHTTPRPCServer creates a new MCP RPC server bound to localhost over HTTP.

func NewMCPRPCServer

func NewMCPRPCServer(mcpManager *tools.MCPManager, socketPath string) (*MCPRPCServer, error)

NewMCPRPCServer creates a new MCP RPC server

func (*MCPRPCServer) BearerToken

func (s *MCPRPCServer) BearerToken() string

BearerToken returns the HTTP bearer token.

func (*MCPRPCServer) EndpointURL

func (s *MCPRPCServer) EndpointURL() string

EndpointURL returns the HTTP endpoint URL.

func (*MCPRPCServer) Shutdown

func (s *MCPRPCServer) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the RPC server

func (*MCPRPCServer) SocketPath

func (s *MCPRPCServer) SocketPath() string

SocketPath returns the path to the Unix socket.

func (*MCPRPCServer) Start

func (s *MCPRPCServer) Start(ctx context.Context) error

Start starts the RPC server

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL