# MCPService

- **Package:** LibTmuxMCP
- **Language:** Swift
- **Kind:** struct
- **Source:** https://github.com/libtmux/libtmux-swift/blob/254f8b2be7eb60cacc3ffcb3ea8e456784f582df/Sources/LibTmuxMCP/Serve.swift#L10
- **Page:** https://libtmux.org/en/swift/latest/mcp/reference/mcpservice/

Serves MCP over a stream of request lines.

Every request runs in a task of its own, which is the whole point: a wait
that blocks for thirty seconds must not stop `ping`, a second wait, or the
cancellation that would end it. Serving them one at a time makes the
server's slowest tool its latency for everything.

## Members

- `init(handler:)` (method)
- `serve(_:write:)` (method): Reads requests from `lines` and writes each answer through `write`.
