Documentation
¶
Overview ¶
Package mcpserver exposes TUICast terminal automation as MCP tools.
Index ¶
- func NewMCPServer(service *Service, version string) (*mcp.Server, error)
- type CloseInfo
- type ConnectionInfo
- type CursorInfo
- type Profile
- type ProfileInfo
- type ScreenInfo
- type Service
- func (s *Service) Close() error
- func (s *Service) CloseConnection(connectionID uint64) (CloseInfo, error)
- func (s *Service) CloseSession(sessionID uint64) (CloseInfo, error)
- func (s *Service) Connect(ctx context.Context, profileName string) (ConnectionInfo, error)
- func (s *Service) OpenSession(ctx context.Context, connectionID uint64) (SessionInfo, error)
- func (s *Service) Press(sessionID uint64, key tuicast.Key, modifiers ...tuicast.KeyModifier) error
- func (s *Service) Profiles() []ProfileInfo
- func (s *Service) Screen(sessionID uint64) (ScreenInfo, error)
- func (s *Service) Type(sessionID uint64, text string) error
- func (s *Service) WaitForText(ctx context.Context, sessionID uint64, text string, timeout time.Duration) (ScreenInfo, error)
- type SessionInfo
- type TerminalFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CloseInfo ¶
type CloseInfo struct {
Closed bool `json:"closed"`
}
CloseInfo reports whether a live object was closed. Closing an already absent object is successful and returns false.
type ConnectionInfo ¶
type ConnectionInfo struct {
ConnectionID uint64 `json:"connectionId"`
Profile string `json:"profile"`
}
ConnectionInfo identifies an opened TUICast connection.
type CursorInfo ¶
type CursorInfo struct {
Column int `json:"column"`
Row int `json:"row"`
Visible bool `json:"visible"`
}
CursorInfo is the zero-based cursor location and visibility state.
type Profile ¶
type Profile struct {
Name string
Description string
Protocol string
Terminal tuicast.TerminalProfile
Width int
Height int
Connector tuicast.Connector
}
Profile is one operator-approved terminal endpoint available to MCP clients. Connector may contain resolved credentials; those values are never exposed by the service or its MCP tools.
type ProfileInfo ¶
type ProfileInfo struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Protocol string `json:"protocol"`
Terminal string `json:"terminal"`
Width int `json:"width"`
Height int `json:"height"`
}
ProfileInfo is the non-sensitive profile metadata returned to MCP clients.
type ScreenInfo ¶
type ScreenInfo struct {
SessionID uint64 `json:"sessionId"`
Text string `json:"text"`
Width int `json:"width"`
Height int `json:"height"`
Cursor CursorInfo `json:"cursor"`
Revision uint64 `json:"revision"`
}
ScreenInfo is a detached text representation of a terminal screen.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service owns terminal connections and sessions used by one MCP server.
func (*Service) CloseConnection ¶
CloseConnection closes a connection and its sessions. Repeated cleanup succeeds with Closed false.
func (*Service) CloseSession ¶
CloseSession closes a session. Repeated cleanup succeeds with Closed false.
func (*Service) OpenSession ¶
OpenSession opens a terminal using the selected profile's fixed terminal and dimensions.
func (*Service) Profiles ¶
func (s *Service) Profiles() []ProfileInfo
Profiles returns sorted, non-sensitive metadata for approved endpoints.
func (*Service) Screen ¶
func (s *Service) Screen(sessionID uint64) (ScreenInfo, error)
Screen returns the current detached screen for a session.
type SessionInfo ¶
type SessionInfo struct {
SessionID uint64 `json:"sessionId"`
ConnectionID uint64 `json:"connectionId"`
Terminal string `json:"terminal"`
Width int `json:"width"`
Height int `json:"height"`
}
SessionInfo identifies an opened TUICast terminal session.
type TerminalFactory ¶
TerminalFactory creates the terminal configured for a connection profile.