# `orchestrator.registry.api.connections`
<!-- generated by `orchestrator understand`; the PKG is source of truth, edits here are advisory -->

[← Episteme](../README.md) · [Architecture](../architecture.md)

**Source:** [`src/orchestrator/registry/api/connections.py`](../../src/orchestrator/registry/api/connections.py)

5 types · 8 functions · python

## Changing this safely

**No test module imports this.**

**Most depended-upon here** — a change to these reaches the most code (call graph, ≤4 hops):

- [`_writable`](../../src/orchestrator/registry/api/connections.py#L79) — reaches **4** symbols · **no test path visible**
- [`ServerInfo`](../../src/orchestrator/registry/api/connections.py#L40) — reaches **3** symbols · **no test path visible**
- [`ToolInfo`](../../src/orchestrator/registry/api/connections.py#L32) — reaches **3** symbols · **no test path visible**
- [`_transport`](../../src/orchestrator/registry/api/connections.py#L83) — reaches **3** symbols · **no test path visible**
- [`_factory`](../../src/orchestrator/registry/api/connections.py#L73) — reaches **2** symbols · **no test path visible**
- [`_require_writable`](../../src/orchestrator/registry/api/connections.py#L177) — reaches **2** symbols · **no test path visible**
- [`_test_server`](../../src/orchestrator/registry/api/connections.py#L90) — reaches **2** symbols · **no test path visible**
- [`CheckInfo`](../../src/orchestrator/registry/api/connections.py#L54) — reaches **1** symbol · **no test path visible**

_9 of the symbols other code depends on here have no test path the graph can see — worth a second look before changing them. Absence of a path is not proof of absence of a test: calls through an attribute chain (`obj.method()`) are skipped rather than guessed at, so indirect coverage is invisible._

## Types

### `CheckInfo`

[`src/orchestrator/registry/api/connections.py:54`](../../src/orchestrator/registry/api/connections.py#L54)

- **Extends** (1): `pydantic.BaseModel`
- **Called by** (1): [`connections`](../../src/orchestrator/registry/api/connections.py#L116)
- **Fields**: `detail`, `model_config`, `name`, `optional`, `passed`

### `ConnectionsResponse`

[`src/orchestrator/registry/api/connections.py:63`](../../src/orchestrator/registry/api/connections.py#L63)

- **Extends** (1): `pydantic.BaseModel`
- **Called by** (1): [`connections`](../../src/orchestrator/registry/api/connections.py#L116)
- **Fields**: `config_path`, `mcp_config_present`, `model_config`, `servers`, `sources`, `writable`

### `ServerInfo`

[`src/orchestrator/registry/api/connections.py:40`](../../src/orchestrator/registry/api/connections.py#L40)

- **Extends** (1): `pydantic.BaseModel`
- **Called by** (2): [`_test_server`](../../src/orchestrator/registry/api/connections.py#L90), [`connections`](../../src/orchestrator/registry/api/connections.py#L116)
- **Fields**: `allow`, `enabled`, `error`, `model_config`, `name`, `reachable`, `target`, `tools`, `transport`, `write_enabled`

### `ServerSpec`

[`src/orchestrator/registry/api/connections.py:165`](../../src/orchestrator/registry/api/connections.py#L165)

- **Extends** (1): `pydantic.BaseModel`
- **Fields**: `allow`, `args`, `command`, `config`, `enabled`, `model_config`, `name`, `url`

### `ToolInfo`

[`src/orchestrator/registry/api/connections.py:32`](../../src/orchestrator/registry/api/connections.py#L32)

- **Extends** (1): `pydantic.BaseModel`
- **Called by** (1): [`_test_server`](../../src/orchestrator/registry/api/connections.py#L90)
- **Fields**: `description`, `model_config`, `name`, `read_only`

## Functions

### `_factory`

[`src/orchestrator/registry/api/connections.py:73`](../../src/orchestrator/registry/api/connections.py#L73)

- **Called by** (2): [`add_server`](../../src/orchestrator/registry/api/connections.py#L187), [`connections`](../../src/orchestrator/registry/api/connections.py#L116)

### `_require_writable`

[`src/orchestrator/registry/api/connections.py:177`](../../src/orchestrator/registry/api/connections.py#L177)

- **Called by** (2): [`add_server`](../../src/orchestrator/registry/api/connections.py#L187), [`remove_server`](../../src/orchestrator/registry/api/connections.py#L221)
- **Calls** (2): [`_writable`](../../src/orchestrator/registry/api/connections.py#L79), `fastapi.HTTPException`

### `_test_server`

[`src/orchestrator/registry/api/connections.py:90`](../../src/orchestrator/registry/api/connections.py#L90)

- **Called by** (2): [`add_server`](../../src/orchestrator/registry/api/connections.py#L187), [`connections`](../../src/orchestrator/registry/api/connections.py#L116)
- **Calls** (4): [`ServerInfo`](../../src/orchestrator/registry/api/connections.py#L40), [`ToolInfo`](../../src/orchestrator/registry/api/connections.py#L32), [`_transport`](../../src/orchestrator/registry/api/connections.py#L83), `wait_for`

### `_transport`

[`src/orchestrator/registry/api/connections.py:83`](../../src/orchestrator/registry/api/connections.py#L83)

- **Called by** (1): [`_test_server`](../../src/orchestrator/registry/api/connections.py#L90)

### `_writable`

[`src/orchestrator/registry/api/connections.py:79`](../../src/orchestrator/registry/api/connections.py#L79)

- **Called by** (2): [`_require_writable`](../../src/orchestrator/registry/api/connections.py#L177), [`connections`](../../src/orchestrator/registry/api/connections.py#L116)

### `add_server`

[`src/orchestrator/registry/api/connections.py:187`](../../src/orchestrator/registry/api/connections.py#L187)

- **Calls** (6): [`_factory`](../../src/orchestrator/registry/api/connections.py#L73), [`_require_writable`](../../src/orchestrator/registry/api/connections.py#L177), [`_test_server`](../../src/orchestrator/registry/api/connections.py#L90), `fastapi.HTTPException`, `orchestrator.mcp.MCPServerConfig`, `orchestrator.mcp.upsert_mcp_server`

### `connections`

[`src/orchestrator/registry/api/connections.py:116`](../../src/orchestrator/registry/api/connections.py#L116)

- **Calls** (10): [`CheckInfo`](../../src/orchestrator/registry/api/connections.py#L54), [`ConnectionsResponse`](../../src/orchestrator/registry/api/connections.py#L63), [`ServerInfo`](../../src/orchestrator/registry/api/connections.py#L40), [`_factory`](../../src/orchestrator/registry/api/connections.py#L73), [`_test_server`](../../src/orchestrator/registry/api/connections.py#L90), [`_writable`](../../src/orchestrator/registry/api/connections.py#L79), `gather`, `orchestrator.mcp.load_mcp_configs`, [`resolve_config_path`](../../src/orchestrator/mcp/config.py#L94), [`run_env_checks`](../../src/orchestrator/doctor.py#L125)

### `remove_server`

[`src/orchestrator/registry/api/connections.py:221`](../../src/orchestrator/registry/api/connections.py#L221)

- **Calls** (3): [`_require_writable`](../../src/orchestrator/registry/api/connections.py#L177), `fastapi.HTTPException`, `orchestrator.mcp.remove_mcp_server`

## Imports

`__future__.annotations`, `asyncio`, `fastapi.APIRouter`, `fastapi.HTTPException`, `fastapi.Request`, `fastapi.status`, [`orchestrator.doctor`](../../src/orchestrator/doctor.py#L1), [`orchestrator.mcp`](../../src/orchestrator/mcp/__init__.py#L1), [`orchestrator.mcp.config`](../../src/orchestrator/mcp/config.py#L1), [`orchestrator.registry.api.deps`](../../src/orchestrator/registry/api/deps.py#L1), `pydantic.BaseModel`, `pydantic.ConfigDict`, `pydantic.Field`, `typing.Any`

## Imported by

[`orchestrator.registry.api.app`](../../src/orchestrator/registry/api/app.py#L1)
