# discover_mcp_configs

> **Function** in `deepagents_cli`

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

Find MCP config files from standard locations.

Checks three paths in precedence order (lowest to highest):

1. `~/.deepagents/.mcp.json` (user-level global)
2. `<project-root>/.deepagents/.mcp.json` (project subdir)
3. `<project-root>/.mcp.json` (project root, Claude Code compat)

Project root is determined from `project_context` when provided, otherwise
by `find_project_root()`, falling back to CWD.

## Signature

```python
discover_mcp_configs(
    *,
    project_context: ProjectContext | None = None,
) -> list[Path]
```

## Returns

`list[Path]`

List of existing config file paths, ordered lowest-to-highest precedence.

---

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