# LibTmuxMCP.serve

- **Module:** LibTmuxMCP
- **Package:** LibTmuxMCP
- **Language:** Julia
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/packages/LibTmuxMCP/src/cli.jl#L124
- **Page:** https://libtmux.org/en/julia/latest/mcp/reference/libtmuxmcp-serve/

```
serve(app::LibTmuxMCP.Application; input, output, workers, capacity, logger)
```

## Methods

Serve the application's tools using the admitted MCP stdio profiles. This call owns and closes both streams and `app`, including after EOF, cancellation or failure. It joins request work before cleaning up application-owned sessions. Protocol output is serialized; tool logs use the supplied task-local logger. The borrowed tmux daemon and pre-existing sessions remain caller-owned.

```julia
serve(app; input=stdin, output=stdout, workers=4, capacity=16, logger=...)
```

## Parameters

- `app` (`LibTmuxMCP.Application`)
- `input` (`IO`)
  Default: `stdin`.
- `output` (`IO`)
  Default: `stdout`.
- `workers` (`Int`)
  Default: `4`.
- `capacity` (`Int`)
  Default: `16`.
- `logger` (`AbstractLogger`)
  Default: `SimpleLogger(stderr, Logging.Warn)`.
