# `ExUtcp.Transports.Mcp.Connection`
[🔗](https://github.com/universal-tool-calling-protocol/elixir-utcp/blob/main/lib/ex_utcp/transports/mcp/connection.ex#L1)

Manages MCP connections with JSON-RPC 2.0 communication.

# `call_tool`

```elixir
@spec call_tool(pid(), String.t(), map(), keyword()) :: ExUtcp.Types.call_result()
```

Calls a tool using JSON-RPC.

# `call_tool_stream`

```elixir
@spec call_tool_stream(pid(), String.t(), map(), keyword()) ::
  ExUtcp.Types.call_result()
```

Calls a tool with streaming support.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `close`

```elixir
@spec close(pid()) :: :ok
```

Closes the connection.

# `get_last_used`

```elixir
@spec get_last_used(pid()) :: integer()
```

Gets the last used timestamp.

# `send_notification`

```elixir
@spec send_notification(pid(), String.t(), map(), keyword()) ::
  :ok | {:error, String.t()}
```

Sends a JSON-RPC notification.

# `send_request`

```elixir
@spec send_request(pid(), String.t(), map(), keyword()) :: ExUtcp.Types.call_result()
```

Sends a JSON-RPC request.

# `start_link`

```elixir
@spec start_link(
  ExUtcp.Types.mcp_provider(),
  keyword()
) :: GenServer.on_start()
```

Starts a new MCP connection.

# `update_last_used`

```elixir
@spec update_last_used(pid()) :: :ok
```

Updates the last used timestamp.

---

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