Anthropic::MCPToolset
Inherits JSON::Serializable < Anthropic::ServerTool < JSON::Serializable < Struct < Value < Object
MCP toolset tool — declares an MCP server's tools for the mcp-client beta
Used together with mcp_servers parameter. Each MCPToolset entry tells the
API which MCP server's tools to expose, with optional per-tool configuration.
message = client.beta.messages.create(
betas: [Anthropic::MCP_CLIENT_BETA],
model: Anthropic::Model::CLAUDE_SONNET_4_6,
max_tokens: 1024,
mcp_servers: [server_def],
server_tools: [Anthropic::MCPToolset.new(mcp_server_name: "my-server")],
messages: [{role: "user", content: "Use my MCP tools"}]
)
Constructors
MCP toolset tool — declares an MCP server's tools for the mcp-client beta
Used together with mcp_servers parameter. Each MCPToolset entry tells the
API which MCP server's tools to expose, with optional per-tool configuration.
message = client.beta.messages.create(
betas: [Anthropic::MCP_CLIENT_BETA],
model: Anthropic::Model::CLAUDE_SONNET_4_6,
max_tokens: 1024,
mcp_servers: [server_def],
server_tools: [Anthropic::MCPToolset.new(mcp_server_name: "my-server")],
messages: [{role: "user", content: "Use my MCP tools"}]
)
Instance methods
The server's tool listing, pinned: when present, the server is not
asked for its tools before sampling and exactly these entries, with
default_config and configs applied, are the toolset's tools. Copy
it from the mcp_tool_listing block of an earlier response. Requires
the mcp-client-2026-09-15 beta (attached automatically when set).