# load_mcp_config_with_error

> **Function** in `deepagents_cli`

📖 [View in docs](https://reference.langchain.com/python/deepagents-cli/mcp_tools/load_mcp_config_with_error)

Load an MCP config file, returning `(config, error)`.

Missing files yield `(None, None)` — not an error. Malformed files
yield `(None, error_text)` so callers can surface the reason to users.

## Signature

```python
load_mcp_config_with_error(
    config_path: Path,
) -> tuple[dict[str, Any] | None, str | None]
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `config_path` | `Path` | Yes | Config path to load. |

## Returns

`dict[str, Any] | None`

`(parsed_config, None)` on success, `(None, None)` when the file

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/64d45f67c86edb4df2ced0e7b82f1a8fd158ec8c/libs/cli/deepagents_cli/mcp_tools.py#L805)