# MCPService

- **Package:** libtmux-swift
- **Language:** Swift
- **Kind:** struct
- **Source:** https://github.com/libtmux/libtmux-swift/blob/f02a4668570e1cc5198c941413750e021f42c214/Sources/LibTmuxMCP/Serve.swift#L9
- **Page:** https://libtmux.org/reference/swift/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`.
