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

Production-ready MCP (Model Context Protocol) transport implementation for UTCP.

MCP is a protocol for connecting AI assistants to external data sources and tools.
This transport supports JSON-RPC 2.0 communication over HTTP/HTTPS with SSE support.

# `call_tool`

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

Calls a tool using the MCP transport.

# `call_tool_stream`

```elixir
@spec call_tool_stream(String.t(), map(), ExUtcp.Types.provider()) ::
  ExUtcp.Types.stream_call_result()
```

Calls a tool with streaming support using the MCP transport.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `close`

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

Closes the MCP transport.

# `deregister_tool_provider`

```elixir
@spec deregister_tool_provider(ExUtcp.Types.provider()) ::
  ExUtcp.Types.deregister_result()
```

Deregisters a tool provider from the MCP transport.

# `new`

```elixir
@spec new(keyword()) :: %ExUtcp.Transports.Mcp{
  connection_timeout: term(),
  logger: term(),
  max_retries: term(),
  pool_opts: term(),
  retry_config: term(),
  retry_delay: term()
}
```

Creates a new MCP transport with the given options.

# `register_tool_provider`

```elixir
@spec register_tool_provider(ExUtcp.Types.provider()) ::
  ExUtcp.Types.register_result()
```

Registers a tool provider with the MCP transport.

# `send_notification`

```elixir
@spec send_notification(String.t(), map(), ExUtcp.Types.mcp_provider()) ::
  :ok | {:error, String.t()}
```

Sends a JSON-RPC notification to the MCP server.

# `send_request`

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

Sends a JSON-RPC request to the MCP server.

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

Starts the MCP transport GenServer.

# `supports_streaming?`

```elixir
@spec supports_streaming?() :: true
```

Returns whether this transport supports streaming.

# `transport_name`

```elixir
@spec transport_name() :: String.t()
```

Returns the transport name.

---

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