Documentation
¶
Index ¶
- func GetMCPClientImplementation() *mcp.Implementation
- type MATLABInfo
- type MCPClient
- type MCPClientSession
- func (s *MCPClientSession) CallTool(ctx context.Context, name string, args map[string]any) (*mcp.CallToolResult, error)
- func (s *MCPClientSession) CheckCode(ctx context.Context, scriptPath string) ([]string, error)
- func (s *MCPClientSession) Close() error
- func (s *MCPClientSession) DetectToolboxes(ctx context.Context) (string, error)
- func (s *MCPClientSession) EvaluateCode(ctx context.Context, code string, projectPath ...string) (string, error)
- func (*MCPClientSession) GetTextContent(result *mcp.CallToolResult) (string, error)
- func (s *MCPClientSession) InitializeResult() *mcp.InitializeResult
- func (s *MCPClientSession) NewSessionManager() *SessionManager
- func (s *MCPClientSession) ReadResource(ctx context.Context, uri string) (string, error)
- func (s *MCPClientSession) RunFile(ctx context.Context, scriptPath string) (string, error)
- func (s *MCPClientSession) RunTestFile(ctx context.Context, scriptPath string) (string, error)
- func (s *MCPClientSession) Stderr() string
- func (*MCPClientSession) UnmarshalStructuredContent(result *mcp.CallToolResult, target interface{}) error
- type SessionManager
- func (sm *SessionManager) CleanupSession(ctx context.Context, sessionID int)
- func (sm *SessionManager) EvaluateInSession(ctx context.Context, sessionID int, code string, projectPath ...string) (string, error)
- func (sm *SessionManager) ListAvailableMATLABs(ctx context.Context) ([]MATLABInfo, error)
- func (sm *SessionManager) StartSession(ctx context.Context, matlabRoot ...string) (int, error)
- func (sm *SessionManager) StopSession(ctx context.Context, sessionID int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMCPClientImplementation ¶
func GetMCPClientImplementation() *mcp.Implementation
Types ¶
type MATLABInfo ¶
MATLABInfo represents information about a MATLAB installation
type MCPClient ¶
type MCPClient struct {
// contains filtered or unexported fields
}
MCPClient wraps MCP session with helper methods Lifecycle: NewClient -> CreateSession -> [operations] -> Close
func (*MCPClient) CreateSession ¶
func (c *MCPClient) CreateSession(ctx context.Context) (*MCPClientSession, error)
type MCPClientSession ¶
type MCPClientSession struct {
// contains filtered or unexported fields
}
MCPClientSession represents an active MCP session
func (*MCPClientSession) CallTool ¶
func (s *MCPClientSession) CallTool(ctx context.Context, name string, args map[string]any) (*mcp.CallToolResult, error)
CallTool calls an MCP tool and asserts it doesn't error
func (*MCPClientSession) Close ¶
func (s *MCPClientSession) Close() error
func (*MCPClientSession) DetectToolboxes ¶
func (s *MCPClientSession) DetectToolboxes(ctx context.Context) (string, error)
DetectToolboxes detects installed MATLAB toolboxes
func (*MCPClientSession) EvaluateCode ¶
func (s *MCPClientSession) EvaluateCode(ctx context.Context, code string, projectPath ...string) (string, error)
EvaluateCode evaluates MATLAB code
func (*MCPClientSession) GetTextContent ¶
func (*MCPClientSession) GetTextContent(result *mcp.CallToolResult) (string, error)
GetTextContent extracts text content from a tool result
func (*MCPClientSession) InitializeResult ¶ added in v0.5.0
func (s *MCPClientSession) InitializeResult() *mcp.InitializeResult
InitializeResult returns the result of the Initialize call.
func (*MCPClientSession) NewSessionManager ¶
func (s *MCPClientSession) NewSessionManager() *SessionManager
NewSessionManager creates a new session manager for multi-session workflows
func (*MCPClientSession) ReadResource ¶
ReadResource reads an MCP resource by URI and returns its text content
func (*MCPClientSession) RunTestFile ¶
RunTestFile runs a MATLAB test file
func (*MCPClientSession) Stderr ¶
func (s *MCPClientSession) Stderr() string
Stderr returns the captured stderr output from the MCP server process. This is useful for debugging test failures.
func (*MCPClientSession) UnmarshalStructuredContent ¶
func (*MCPClientSession) UnmarshalStructuredContent(result *mcp.CallToolResult, target interface{}) error
UnmarshalStructuredContent unmarshals structured content into a target
type SessionManager ¶
type SessionManager struct {
// contains filtered or unexported fields
}
SessionManager helps manage MATLAB sessions
func (*SessionManager) CleanupSession ¶
func (sm *SessionManager) CleanupSession(ctx context.Context, sessionID int)
CleanupSession stops a MATLAB session for cleanup, ignoring errors if the session is already gone
func (*SessionManager) EvaluateInSession ¶
func (sm *SessionManager) EvaluateInSession(ctx context.Context, sessionID int, code string, projectPath ...string) (string, error)
EvaluateInSession evaluates code in a specific session
func (*SessionManager) ListAvailableMATLABs ¶
func (sm *SessionManager) ListAvailableMATLABs(ctx context.Context) ([]MATLABInfo, error)
ListAvailableMATLABs lists available MATLAB installations
func (*SessionManager) StartSession ¶
StartSession starts a new MATLAB session
func (*SessionManager) StopSession ¶
func (sm *SessionManager) StopSession(ctx context.Context, sessionID int) error
StopSession stops a MATLAB session