# LibTmuxMCP.Application

- **Module:** LibTmuxMCP
- **Package:** LibTmuxMCP
- **Language:** Julia
- **Kind:** struct
- **Source:** https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/packages/LibTmuxMCP/src/tools.jl#L48
- **Page:** https://libtmux.org/en/julia/latest/mcp/reference/libtmuxmcp-application/

```
LibTmuxMCP.Application(
    server::LibTmux.Server,
    caller::Union{Nothing, LibTmux.PaneRef},
    allowed_tools::Tuple{Vararg{String}},
    allow_create::Bool,
    timeout::Float64,
    max_capture_bytes::Int64,
    max_result_bytes::Int64,
    _allowed_panes::Union{Nothing, Vector{LibTmux.PaneRef}},
    _condition::Base.GenericCondition{ReentrantLock},
    _state::Base.RefValue{Symbol},
    _next::Base.RefValue{UInt64},
    _active::Dict{UInt64, LibTmuxMCP._ApplicationCall},
    _owned::Dict{LibTmux.SessionRef, Vector{LibTmux.PaneRef}},
    _creating::Base.RefValue{Int64}
)

LibTmuxMCP.Application(
    server::LibTmux.Server;
    caller,
    allowed_tools,
    allowed_panes,
    allow_create,
    timeout,
    max_capture_bytes,
    max_result_bytes
)

LibTmuxMCP.Application(
    server,
    caller,
    allowed_tools,
    allow_create,
    timeout,
    max_capture_bytes,
    max_result_bytes,
    _allowed_panes,
    _condition,
    _state,
    _next,
    _active,
    _owned,
    _creating
)
```

Configure an MCP application without I/O. `server` is an explicit borrowed endpoint. Omitted pane targets use only `caller`; there is no ambient/current pane fallback. `allowed_panes=nothing` permits any explicitly addressed pane; otherwise copy the supplied generation-bound references as the allowlist. Tool names and pane policy also apply to each item in `run_operations`.

```julia
Application(server; caller=nothing, allowed_tools=("list_panes", "capture_pane", "send_keys"),
            allowed_panes=nothing, allow_create=false, timeout=5.0,
            max_capture_bytes=65536, max_result_bytes=1048576)
```



Creation requires both an enabled `create_session` tool and `allow_create=true`. The application owns those sessions and their observed panes, and tears down its sessions on `close`. It never owns the borrowed daemon or caller session.

## Methods

### `Application` (overload 1)

```julia
LibTmuxMCP.Application(
    server::LibTmux.Server,
    caller::Union{Nothing, LibTmux.PaneRef},
    allowed_tools::Tuple{Vararg{String}},
    allow_create::Bool,
    timeout::Float64,
    max_capture_bytes::Int64,
    max_result_bytes::Int64,
    _allowed_panes::Union{Nothing, Vector{LibTmux.PaneRef}},
    _condition::Base.GenericCondition{ReentrantLock},
    _state::Base.RefValue{Symbol},
    _next::Base.RefValue{UInt64},
    _active::Dict{UInt64, LibTmuxMCP._ApplicationCall},
    _owned::Dict{LibTmux.SessionRef, Vector{LibTmux.PaneRef}},
    _creating::Base.RefValue{Int64}
)
```

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/packages/LibTmuxMCP/src/tools.jl#L64).

### `Application` (overload 2)

```julia
LibTmuxMCP.Application(
    server::LibTmux.Server;
    caller,
    allowed_tools,
    allowed_panes,
    allow_create,
    timeout,
    max_capture_bytes,
    max_result_bytes
)
```

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/packages/LibTmuxMCP/src/tools.jl#L80).

### `Application` (overload 3)

```julia
LibTmuxMCP.Application(
    server,
    caller,
    allowed_tools,
    allow_create,
    timeout,
    max_capture_bytes,
    max_result_bytes,
    _allowed_panes,
    _condition,
    _state,
    _next,
    _active,
    _owned,
    _creating
)
```

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/packages/LibTmuxMCP/src/tools.jl#L64).

## Parameters

- `server` (`LibTmux.Server`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 1]`; `Application(server, caller, allowed_tools, allowed_panes, allow_create, timeout, max_capture_bytes, max_result_bytes)`)
- `caller` (`Union{Nothing, LibTmux.PaneRef}`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 1]`)
- `allowed_tools` (`Tuple{Vararg{String}}`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 1]`)
- `allow_create` (`Bool`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 1]`)
- `timeout` (`Float64`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 1]`)
- `max_capture_bytes` (`Int64`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 1]`)
- `max_result_bytes` (`Int64`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 1]`)
- `_allowed_panes` (`Union{Nothing, Base.Vector{LibTmux.PaneRef}}`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 1]`)
- `_condition` (`Base.GenericCondition{Base.ReentrantLock}`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 1]`)
- `_state` (`Base.RefValue{Symbol}`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 1]`)
- `_next` (`Base.RefValue{UInt64}`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 1]`)
- `_active` (`Base.Dict{UInt64, LibTmuxMCP._ApplicationCall}`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 1]`)
- `_owned` (`Base.Dict{LibTmux.SessionRef, Base.Vector{LibTmux.PaneRef}}`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 1]`)
- `_creating` (`Base.RefValue{Int64}`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 1]`)
- `caller` (`Union{Nothing, LibTmux.PaneRef}`) (for `Application(server, caller, allowed_tools, allowed_panes, allow_create, timeout, max_capture_bytes, max_result_bytes)`)
  Default: `nothing`.
- `allowed_tools` (for `Application(server, caller, allowed_tools, allowed_panes, allow_create, timeout, max_capture_bytes, max_result_bytes)`)
  Default: `_ROUTINE_TOOLS`.
- `allowed_panes` (for `Application(server, caller, allowed_tools, allowed_panes, allow_create, timeout, max_capture_bytes, max_result_bytes)`)
  Default: `nothing`.
- `allow_create` (`Bool`) (for `Application(server, caller, allowed_tools, allowed_panes, allow_create, timeout, max_capture_bytes, max_result_bytes)`)
  Default: `false`.
- `timeout` (`Real`) (for `Application(server, caller, allowed_tools, allowed_panes, allow_create, timeout, max_capture_bytes, max_result_bytes)`)
  Default: `5.0`.
- `max_capture_bytes` (`Int`) (for `Application(server, caller, allowed_tools, allowed_panes, allow_create, timeout, max_capture_bytes, max_result_bytes)`)
  Default: `65536`.
- `max_result_bytes` (`Int`) (for `Application(server, caller, allowed_tools, allowed_panes, allow_create, timeout, max_capture_bytes, max_result_bytes)`)
  Default: `1048576`.
- `server` (`Any`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 3]`)
- `caller` (`Any`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 3]`)
- `allowed_tools` (`Any`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 3]`)
- `allow_create` (`Any`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 3]`)
- `timeout` (`Any`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 3]`)
- `max_capture_bytes` (`Any`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 3]`)
- `max_result_bytes` (`Any`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 3]`)
- `_allowed_panes` (`Any`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 3]`)
- `_condition` (`Any`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 3]`)
- `_state` (`Any`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 3]`)
- `_next` (`Any`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 3]`)
- `_active` (`Any`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 3]`)
- `_owned` (`Any`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 3]`)
- `_creating` (`Any`) (for `Application(server, caller, allowed_tools, allow_create, timeout, max_capture_bytes, max_result_bytes, _allowed_panes, _condition, _state, _next, _active, _owned, _creating) [overload 3]`)

## Members

### Other members

- `allow_create` (property)
- `allowed_tools` (property)
- `caller` (property)
- `max_capture_bytes` (property)
- `max_result_bytes` (property)
- `server` (property)
- `timeout` (property)
- `_active` (property)
- `_allowed_panes` (property)
- `_condition` (property)
- `_creating` (property)
- `_next` (property)
- `_owned` (property)
- `_state` (property)
