fastmcp/docs/python-sdk/fastmcp-utilities-mcp_config.mdx
2025-06-24 13:02:03 -05:00

50 lines
1.5 KiB
Text

---
title: mcp_config
sidebarTitle: mcp_config
---
# `fastmcp.utilities.mcp_config`
## Functions
### `infer_transport_type_from_url` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/mcp_config.py#L20" target="_blank">↗</a></sup>
```python
infer_transport_type_from_url(url: str | AnyUrl) -> Literal['http', 'sse']
```
Infer the appropriate transport type from the given URL.
## Classes
### `StdioMCPServer` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/mcp_config.py#L40" target="_blank">↗</a></sup>
**Methods:**
#### `to_transport` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/mcp_config.py#L47" target="_blank">↗</a></sup>
```python
to_transport(self) -> StdioTransport
```
### `RemoteMCPServer` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/mcp_config.py#L58" target="_blank">↗</a></sup>
**Methods:**
#### `to_transport` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/mcp_config.py#L71" target="_blank">↗</a></sup>
```python
to_transport(self) -> StreamableHttpTransport | SSETransport
```
### `MCPConfig` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/mcp_config.py#L88" target="_blank">↗</a></sup>
**Methods:**
#### `from_dict` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/mcp_config.py#L92" target="_blank">↗</a></sup>
```python
from_dict(cls, config: dict[str, Any]) -> MCPConfig
```