# mcp.server.createTmuxMcpServer

**MCP concept example** A working example of the core library. It can change without notice.

- **Module:** mcp.server
- **Package:** @libtmux/mcp
- **Language:** TypeScript
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-ts/blob/46cccfef2a546de55ce8b308249b8c76339089a0/packages/mcp/src/server.ts#L52
- **Page:** https://libtmux.org/en/ts/latest/mcp/reference/mcp-server-createtmuxmcpserver/

```
function createTmuxMcpServer(
  tmux: Server,
  options: {
    readonly callerEnvironment?: Readonly<
      Record<string, string | undefined>
    >;
    readonly environment?: Readonly<
      Record<string, string | undefined>
    >;
    readonly policy?: Policy;
    readonly startup?: ServerStartup;
  } = {},
): McpServer
```

An MCP server exposing a tmux server through libtmux.

Instructions are built at construction rather than at handshake because they
carry where this process is running, which cannot change while it runs.

## Parameters

- `tmux` (`Server`)
- `options` (`{   readonly callerEnvironment?: Readonly<Record<string, string | undefined>>;   readonly environment?: Readonly<Record<string, string | undefined>>;   readonly policy?: Policy;   readonly startup?: ServerStartup; }`)

  - `callerEnvironment`: Complete environment identifying the host process's tmux pane.
  - `environment`: Complete environment from which to resolve MCP tool policy.
  - `startup`: Socket state and configuration provenance pinned before registration.

  Default: `{}`.

## Guides

Pages that discuss `createTmuxMcpServer`.

- [TypeScript MCP API](/en/ts/latest/mcp/reference/)
