# `Condukt.MCP.Client`
[🔗](https://github.com/tuist/condukt/blob/1.4.1/lib/condukt/mcp/client.ex#L1)

GenServer that owns the protocol state for a single MCP server
connection.

The process spawns the configured transport, performs the
`initialize` / `notifications/initialized` / `tools/list` handshake,
and then services synchronous tool calls from callers.

In normal use, callers do not interact with this module directly:
`Condukt.MCP.start_all/2` builds a list of clients and turns each
server's tools into `Condukt.Tool.Inline` specs ready to drop into an
agent or workflow tool list. Use `start_link/2` directly when you
need finer control.

# `call_tool`

Calls a tool on the connected server. The result is the raw `content`
block returned by the server, normalized into a single string when
the server returns text-only content. Errors include both transport
errors and `isError: true` tool responses.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `server_info`

Returns the `serverInfo` block returned by the server during the
`initialize` handshake.

# `start_link`

Starts a client and blocks the caller until the connection is ready
or fails.

Options:

  * `:name` - register the GenServer under a name
  * `:fetch_env` - injection point for env-backed auth/secret refs (testing)
  * `:token_request` - injection point for the OAuth token endpoint (testing)
  * `:sse_request` / `:http_request` - injection points for the HTTP
    transports (testing)

# `stop`

Stops the client and closes the underlying transport.

# `tools`

Returns the cached `tools/list` descriptors discovered during
initialization.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
