vllm_mlx.mcp.config¶
MCP configuration loading and validation.
View the complete module source at #L1-L199.
API details¶
Each callable below includes its exact signature, type annotations, inputs, defaults, return contract, documented exceptions, implementation source, and parsed docstring sections when the source provides them.
vllm_mlx.mcp.config
¶
MCP configuration loading and validation.
vllm_mlx.mcp.config.CONFIG_SEARCH_PATHS
module-attribute
¶
vllm_mlx.mcp.config.load_mcp_config
¶
load_mcp_config(path: Optional[Union[str, Path]] = None) -> MCPConfig
Load MCP configuration from file.
Search order: 1. Explicit path argument 2. VLLM_MLX_MCP_CONFIG environment variable 3. ~/.config/vllm-mlx/mcp.json or mcp.yaml
Parameters:
-
path(Optional[Union[str, Path]], default:None) –Optional explicit path to config file
Returns:
-
MCPConfig–MCPConfig object
Raises:
-
FileNotFoundError–If no config file found
-
ValueError–If config is invalid
Source code in vllm_mlx/mcp/config.py
vllm_mlx.mcp.config._find_config_file
¶
Find the config file to use.
Source code in vllm_mlx/mcp/config.py
vllm_mlx.mcp.config.validate_config
¶
validate_config(data: Dict[str, Any]) -> MCPConfig
Validate and parse configuration dictionary.
Parameters:
-
data(Dict[str, Any]) –Raw configuration dictionary
Returns:
-
MCPConfig–Validated MCPConfig object
Raises:
-
ValueError–If configuration is invalid
Source code in vllm_mlx/mcp/config.py
vllm_mlx.mcp.config.create_example_config
¶
Create an example MCP configuration.
Returns:
-
str–JSON string with example configuration
Source code in vllm_mlx/mcp/config.py
Complete contract reference¶
Expand any definition for its exact inputs, annotations, defaults, return contract, directly raised exceptions, source-grounded behavior, and immutable line link. This section includes private and nested definitions that ordinary API generators omit.
vllm_mlx.mcp.config.load_mcp_config · function
Load MCP configuration from file.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
path |
Optional[Union[str, Path]] |
no |
None |
Optional explicit path to config file |
Returns
- Type:
MCPConfig - Direct return expressions:
MCPConfig();validate_config(data)
Exceptions and behavior
Function load_mcp_config calls _find_config_file, logger.info, MCPConfig, Path(config_path).expanduser; can raise ImportError; has 2 explicit return paths.
Directly raised exceptions: ImportError.
vllm_mlx.mcp.config._find_config_file · function
vllm_mlx.mcp.config._find_config_file(explicit_path: Optional[Union[str, Path]] = None) -> Optional[Path]
Find the config file to use.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
explicit_path |
Optional[Union[str, Path]] |
no |
None |
Optional positional or keyword input; defaults to None. |
Returns
- Type:
Optional[Path] - Direct return expressions:
path;None
Exceptions and behavior
Function _find_config_file calls Path(explicit_path).expanduser, Path, path.exists, FileNotFoundError; can raise FileNotFoundError; has 2 explicit return paths.
Directly raised exceptions: FileNotFoundError.
vllm_mlx.mcp.config.validate_config · function
Validate and parse configuration dictionary.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
data |
Dict[str, Any] |
yes |
none |
Raw configuration dictionary |
Returns
- Type:
MCPConfig - Direct return expressions:
MCPConfig(servers=servers, max_tool_calls=max_tool_calls, default_timeout=default_timeout, allowed_high_risk_tools=set(…
Exceptions and behavior
Function validate_config calls isinstance, ValueError, data.get, servers_data.items; can raise ValueError; returns MCPConfig(servers=servers, max_tool_calls=max_tool_calls, default_timeout=default_timeout, allowed_high_risk_tools=set(….
Directly raised exceptions: ValueError.
vllm_mlx.mcp.config.create_example_config · function
Create an example MCP configuration.
Parameters
This callable has no explicit inputs.
Returns
- Type:
str - Direct return expressions:
json.dumps(example, indent=2)
Exceptions and behavior
Function create_example_config calls json.dumps; returns json.dumps(example, indent=2).
No direct raise statement appears in this definition.
Complete symbol map¶
This map also includes private definitions and nested helpers. The signature column exposes every explicit input even when an internal helper has no dedicated parameter prose.
| Symbol | Kind | Signature and inputs | What it does | Source |
|---|---|---|---|---|
load_mcp_config |
function | load_mcp_config(path: Optional[Union[str, Path]] = None) -> MCPConfig |
Load MCP configuration from file. | #L26-L70 |
_find_config_file |
function | _find_config_file(explicit_path: Optional[Union[str, Path]] = None) -> Optional[Path] |
Find the config file to use. | #L73-L98 |
validate_config |
function | validate_config(data: Dict[str, Any]) -> MCPConfig |
Validate and parse configuration dictionary. | #L101-L163 |
create_example_config |
function | create_example_config() -> str |
Create an example MCP configuration. | #L166-L199 |