mcp

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultWorkspace = "mcp-agents"
	ServerName       = "termtile"
	ServerVersion    = "1.0.0"
)
View Source
const (
	// DefaultArtifactCapBytes is the maximum size of a stored artifact per slot.
	// Artifacts are kept in memory only.
	DefaultArtifactCapBytes = 1 << 20 // 1MB
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentInfo

type AgentInfo struct {
	Slot           int    `json:"slot"`
	AgentType      string `json:"agent_type"`
	SessionName    string `json:"session_name"`
	CurrentCommand string `json:"current_command"`
	IsIdle         bool   `json:"is_idle"`
	Exists         bool   `json:"exists"`
	SpawnMode      string `json:"spawn_mode"`
}

AgentInfo describes a single running agent.

type Artifact

type Artifact struct {
	Workspace      string    `json:"workspace"`
	Slot           int       `json:"slot"`
	Output         string    `json:"output"`
	Truncated      bool      `json:"truncated"`
	Warning        string    `json:"warning,omitempty"`
	OriginalBytes  int       `json:"original_bytes"`
	StoredBytes    int       `json:"stored_bytes"`
	LastUpdatedUTC time.Time `json:"last_updated_utc"`
}

Artifact is a captured output blob for a given workspace slot.

type ArtifactStore

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

ArtifactStore holds slot artifacts in memory with a per-artifact size cap. It is safe for concurrent access.

func NewArtifactStore

func NewArtifactStore(capBytes int) *ArtifactStore

func (*ArtifactStore) Clear

func (s *ArtifactStore) Clear(workspace string, slot int)

func (*ArtifactStore) Get

func (s *ArtifactStore) Get(workspace string, slot int) (Artifact, bool)

func (*ArtifactStore) Set

func (s *ArtifactStore) Set(workspace string, slot int, output string) Artifact

type GetArtifactArgs

type GetArtifactArgs struct {
	Slot      int    `json:"slot" jsonschema:"required,Slot index to fetch artifact from"`
	Workspace string `` /* 149-byte string literal not displayed */
	// SourceWorkspace is an optional request-scoped hint used when workspace is omitted.
	SourceWorkspace string `` /* 131-byte string literal not displayed */
}

GetArtifactArgs is the input for the get_artifact tool.

type GetArtifactOutput

type GetArtifactOutput struct {
	Workspace      string    `json:"workspace"`
	Slot           int       `json:"slot"`
	Output         string    `json:"output"`
	Truncated      bool      `json:"truncated"`
	Warning        string    `json:"warning,omitempty"`
	OriginalBytes  int       `json:"original_bytes"`
	StoredBytes    int       `json:"stored_bytes"`
	LastUpdatedUTC time.Time `json:"last_updated_utc"`
}

GetArtifactOutput is the output for the get_artifact tool.

type KillAgentInput

type KillAgentInput struct {
	Slot      int    `json:"slot" jsonschema:"required,Slot index of agent to kill"`
	Workspace string `` /* 149-byte string literal not displayed */
	// SourceWorkspace is an optional request-scoped hint used when workspace is omitted.
	SourceWorkspace string `` /* 131-byte string literal not displayed */
}

KillAgentInput is the input for the kill_agent tool.

type KillAgentOutput

type KillAgentOutput struct {
	SessionName string `json:"session_name"`
	Killed      bool   `json:"killed"`
}

KillAgentOutput is the output for the kill_agent tool.

type ListAgentsInput

type ListAgentsInput struct {
	Workspace string `` /* 149-byte string literal not displayed */
	// SourceWorkspace is an optional request-scoped hint used when workspace is omitted.
	SourceWorkspace string `` /* 131-byte string literal not displayed */
}

ListAgentsInput is the input for the list_agents tool.

type ListAgentsOutput

type ListAgentsOutput struct {
	Workspace string      `json:"workspace"`
	Agents    []AgentInfo `json:"agents"`
}

ListAgentsOutput is the output for the list_agents tool.

type MoveTerminalInput

type MoveTerminalInput struct {
	Slot      int    `json:"slot" jsonschema:"required,Slot index of the terminal to move"`
	Workspace string `json:"workspace,omitempty" jsonschema:"Source workspace name (default: active workspace on current desktop)"`
	// SourceWorkspace is an optional request-scoped hint used when workspace is omitted.
	SourceWorkspace string `` /* 131-byte string literal not displayed */
	TargetWorkspace string `json:"target_workspace" jsonschema:"required,Destination workspace name"`
}

MoveTerminalInput is the input for the move_terminal tool.

type MoveTerminalOutput

type MoveTerminalOutput struct {
	SourceWorkspace string `json:"source_workspace"`
	TargetWorkspace string `json:"target_workspace"`
	SourceSlot      int    `json:"source_slot"`
	TargetSlot      int    `json:"target_slot"`
	SessionName     string `json:"session_name"`
	Moved           bool   `json:"moved"`
}

MoveTerminalOutput is the output for the move_terminal tool.

type ReadFromAgentInput

type ReadFromAgentInput struct {
	Slot      int    `json:"slot" jsonschema:"required,Slot index to read from"`
	Lines     int    `json:"lines,omitempty" jsonschema:"Number of lines to capture (default: 50, max: 100)"`
	Clean     bool   `json:"clean,omitempty" jsonschema:"When true, strip TUI chrome and control characters from output (default: false)"`
	SinceLast bool   `` /* 161-byte string literal not displayed */
	Workspace string `` /* 149-byte string literal not displayed */
	// SourceWorkspace is an optional request-scoped hint used when workspace is omitted.
	SourceWorkspace string `` /* 131-byte string literal not displayed */
	Pattern         string `json:"pattern,omitempty" jsonschema:"Optional text pattern to wait for. When set, polls until pattern appears or timeout."`
	Timeout         int    `` /* 127-byte string literal not displayed */
}

ReadFromAgentInput is the input for the read_from_agent tool.

type ReadFromAgentOutput

type ReadFromAgentOutput struct {
	Output      string `json:"output"`
	SessionName string `json:"session_name"`
	Found       *bool  `json:"found,omitempty"`
}

ReadFromAgentOutput is the output for the read_from_agent tool.

type SendToAgentInput

type SendToAgentInput struct {
	Slot      int    `json:"slot" jsonschema:"required,Slot index of the target agent"`
	Text      string `json:"text" jsonschema:"required,Text to send to the agent"`
	Workspace string `` /* 149-byte string literal not displayed */
	// SourceWorkspace is an optional request-scoped hint used when workspace is omitted.
	SourceWorkspace string `` /* 131-byte string literal not displayed */
}

SendToAgentInput is the input for the send_to_agent tool.

type Server

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

Server is the MCP server for termtile agent orchestration.

func NewServer

func NewServer(cfg *config.Config) (*Server, error)

NewServer creates a new MCP server backed by tmux.

func (*Server) Close

func (s *Server) Close() error

Close releases server resources.

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run starts the MCP server on stdio transport, blocking until done.

type SpawnAgentInput

type SpawnAgentInput struct {
	AgentType string `json:"agent_type" jsonschema:"required,The agent type from config (e.g. claude, codex, aider)"`
	Workspace string `` /* 162-byte string literal not displayed */
	// SourceWorkspace is an optional request-scoped hint used when workspace is omitted.
	SourceWorkspace string  `` /* 131-byte string literal not displayed */
	Cwd             string  `json:"cwd,omitempty" jsonschema:"Working directory for the agent"`
	Task            string  `` /* 249-byte string literal not displayed */
	Model           *string `` /* 149-byte string literal not displayed */
	Window          *bool   `` /* 157-byte string literal not displayed */
	DependsOn       []int   `` /* 174-byte string literal not displayed */
	// DependsOnTimeout is only used when DependsOn is set.
	// Value is seconds; default is 300.
	DependsOnTimeout int `` /* 161-byte string literal not displayed */
}

SpawnAgentInput is the input for the spawn_agent tool.

type SpawnAgentOutput

type SpawnAgentOutput struct {
	Slot        int    `json:"slot"`
	SessionName string `json:"session_name"`
	AgentType   string `json:"agent_type"`
	Workspace   string `json:"workspace"`
	SpawnMode   string `json:"spawn_mode"`
}

SpawnAgentOutput is the output for the spawn_agent tool.

type WaitForIdleInput

type WaitForIdleInput struct {
	Slot      int    `json:"slot" jsonschema:"required,Slot index to monitor"`
	Timeout   int    `json:"timeout,omitempty" jsonschema:"Timeout in seconds (default: 120)"`
	Lines     int    `json:"lines,omitempty" jsonschema:"Number of lines to capture when idle (default: 100)"`
	Workspace string `` /* 149-byte string literal not displayed */
	// SourceWorkspace is an optional request-scoped hint used when workspace is omitted.
	SourceWorkspace string `` /* 131-byte string literal not displayed */
}

WaitForIdleInput is the input for the wait_for_idle tool.

type WaitForIdleOutput

type WaitForIdleOutput struct {
	IsIdle      bool   `json:"is_idle"`
	Output      string `json:"output"`
	SessionName string `json:"session_name"`
}

WaitForIdleOutput is the output for the wait_for_idle tool.

Jump to

Keyboard shortcuts

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