# C++ MCP API

Source: https://libtmux.org/en/cxx/latest/mcp/reference/

> Distinguish installed protocol tools from the C++ source consumer's tool-model API.

For MCP client requests, use the [tool reference](../tools/). This page
covers language APIs for embedding or extending the server.

The installed product is `libtmux-mcp-server`. Its public MCP operations
are available through the protocol. The C++ tool model lives in a source
consumer and is not exported by the installed core package.

## Consumer API

`libtmux::mcp::default_tools()` returns an expected value containing a `ToolRegistry` or an error.
`tools()` enumerates definitions, `find()` looks up a name, and
`call()` invokes a handler against a `Server` with named arguments
and an optional `CallContext`.

`ToolResult` is an expected value containing structured output or a
`ToolError`. `CallContext` provides cooperative cancellation and
progress callbacks. `ToolDefinition` describes parameters, output shape, and
effect annotations independently of a JSON library.

[Consumer declarations](https://github.com/libtmux/libtmux-cxx/blob/393d4b0ad666f18a6581f1eb281741a75a7503f0/apps/mcp/include/libtmux_consumers/mcp.hpp)
and [build target](https://github.com/libtmux/libtmux-cxx/blob/393d4b0ad666f18a6581f1eb281741a75a7503f0/apps/mcp/CMakeLists.txt).

## Protocol API

The [tool reference](../tools/) covers registered names and schemas.
Toolsets and exact names filter the catalog at startup. The static
`tmux://capabilities` resource reports that selection. The server has no
workflow prompts or dynamic resource templates.

Successful tool calls return matching structured content and serialized
JSON text. Strict argument validation precedes tmux execution.
[Protocol tests](https://github.com/libtmux/libtmux-cxx/blob/393d4b0ad666f18a6581f1eb281741a75a7503f0/apps/mcp/tests/protocol_test.cpp)
cover supported lifecycle revisions and result shapes.

[Workspace builder API](../../workspace/reference/) documents a separate source
consumer; it is not a workspace operation in this MCP catalog.

## API declarations

- [libtmux::mcp::ArgumentMap](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-argumentmap/)
- [libtmux::mcp::Arguments](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-arguments/)
- [libtmux::mcp::ArgumentType](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-argumenttype/)
- [libtmux::mcp::CallContext](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-callcontext/)
- [libtmux::mcp::configured_tools](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-configured_tools/)
- [libtmux::mcp::default_tools](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-default_tools/)
- [libtmux::mcp::Effect](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-effect/)
- [libtmux::mcp::FlatArguments](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-flatarguments/)
- [libtmux::json_wire::from_json](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-json_wire-from_json/)
- [libtmux::mcp::Handler](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-handler/)
- [libtmux::mcp::InputControl](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-inputcontrol/)
- [libtmux::mcp::InputSink](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-inputsink/)
- [libtmux::json_wire::is_known_field](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-json_wire-is_known_field/)
- [libtmux::mcp::kConservativeAnnotations](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-kconservativeannotations/)
- [libtmux::json_wire::kind_from](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-json_wire-kind_from/)
- [libtmux::json_wire::kSchemaVersion](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-json_wire-kschemaversion/)
- [libtmux::json_wire::name_of](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-json_wire-name_of/)
- [libtmux::mcp::NestedAuthority](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-nestedauthority/)
- [libtmux::mcp::OutputClass](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-outputclass/)
- [libtmux::mcp::OutputShape](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-outputshape/)
- [libtmux::mcp::Parameter](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-parameter/)
- [libtmux::mcp::parse_tool_selection](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-parse_tool_selection/)
- [libtmux::mcp::ProcessReach](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-processreach/)
- [libtmux::mcp::ReadToolCall](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-readtoolcall/)
- [libtmux::mcp::Sink](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-sink/)
- [libtmux::mcp::StructuredValue](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-structuredvalue/)
- [libtmux::json_wire::to_json](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-json_wire-to_json/)
- [libtmux::mcp::ToolAnnotations](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-toolannotations/)
- [libtmux::mcp::ToolAuthority](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-toolauthority/)
- [libtmux::mcp::ToolDefinition](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-tooldefinition/)
- [libtmux::mcp::ToolError](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-toolerror/)
- [libtmux::mcp::ToolOutput](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-tooloutput/)
- [libtmux::mcp::ToolRegistry](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-toolregistry/)
- [libtmux::mcp::ToolResult](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-toolresult/)
- [libtmux::mcp::ToolSchema](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-toolschema/)
- [libtmux::mcp::ToolSelection](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-toolselection/)
- [libtmux::mcp::Toolset](https://libtmux.org/en/cxx/latest/mcp/reference/libtmux-mcp-toolset/)

[Protocol catalog](https://libtmux.org/en/cxx/latest/mcp/tools.json)
