# split_mcp_server_info

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/tool_catalog/split_mcp_server_info)

Split loaded MCP server metadata into tool groups and unavailable servers.

Pure function shared by the CLI discovery path (`collect_mcp_catalog`) and
the interactive `/tools` command, which passes the app's already-loaded
`MCPServerInfo` list rather than re-discovering (Textual's running event
loop forbids the `asyncio.run` discovery path).

Servers that loaded but expose no tools are reported as `UnavailableServer`s
(errored, needing login, or disabled) rather than silently dropped —
surfacing exactly what a user debugging a missing tool needs to see.

## Signature

```python
split_mcp_server_info(
    server_info: Sequence[MCPServerInfo],
) -> tuple[list[ToolGroup], list[UnavailableServer]]
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `server_info` | `Sequence[MCPServerInfo]` | Yes | Loaded MCP server metadata. |

## Returns

`list[ToolGroup]`

`(groups, unavailable)`: per-server tool groups (only servers exposing

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/4bfa52000ef65ac623d8ada0cb67f67cbdd663ea/libs/code/deepagents_code/tool_catalog.py#L396)