ClaudeCode.MCP.Status (ClaudeCode v0.36.3)

View Source

Status information for an MCP server connection.

Returned by ClaudeCode.Session.mcp_status/1.

Fields

  • :name - Server name as configured
  • :status - Current connection status (:connected, :failed, :needs_auth, :pending, :disabled)
  • :server_info - Server info map with name and version (available when connected)
  • :error - Error message (available when status is :failed)
  • :config - Server configuration map
  • :scope - Configuration scope (e.g., "project", "user", "local")
  • :tools - List of tool maps with name, description, and annotations (available when connected)

Summary

Functions

Creates a Status from a JSON map.

Types

status()

@type status() :: :connected | :failed | :needs_auth | :pending | :disabled

t()

@type t() :: %ClaudeCode.MCP.Status{
  config: map() | nil,
  error: String.t() | nil,
  name: String.t(),
  scope: String.t() | nil,
  server_info: %{name: String.t(), version: String.t()} | nil,
  status: status(),
  tools: [map()] | nil
}

Functions

new(data)

@spec new(map()) :: t()

Creates a Status from a JSON map.

Examples

iex> ClaudeCode.MCP.Status.new(%{"name" => "my-server", "status" => "connected"})
%ClaudeCode.MCP.Status{name: "my-server", status: :connected}