server_info
Data structures and enumerations for MCP server management.
This module defines the core types used for representing MCP server
configuration and runtime state, including the ServerStatus enumeration
and the ServerInfo dataclass. These structures support serialization
and deserialization for persistent server state tracking and configuration
management.
ServerInfo
dataclass
Information about an MCP server.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The name of the server. |
package |
str
|
The Python package that the server comes from. |
module_path |
str
|
The full Python module path for the server. |
log_file |
Optional[Path]
|
Path to the server's log file. |
env_vars |
Optional[Dict[str, Any]]
|
Environment variables for the server process. |
status |
ServerStatus
|
Current status of the server. |
url |
Optional[str]
|
Optional URL for accessing the server. |
pid |
Optional[int]
|
Process ID of the running server, if available. |
host |
str
|
Hostname or IP address where the server is running. |
port |
Optional[int]
|
Network port for the server, if applicable. |
started_at |
Optional[str]
|
ISO timestamp when the server was started. |
last_checked |
Optional[str]
|
ISO timestamp when the server status was last checked. |
Methods:
| Name | Description |
|---|---|
to_dict |
Serialize the ServerInfo instance to a dictionary suitable for JSON. |
from_dict |
Deserialize a dictionary into a ServerInfo instance. |
Source code in src/mada_tools/server_management/server_info.py
from_dict(data)
classmethod
Create ServerInfo from dict.
Returns:
Source code in src/mada_tools/server_management/server_info.py
to_dict()
Convert to dict for JSON serialization.
Returns:
Source code in src/mada_tools/server_management/server_info.py
ServerStatus
Bases: Enum
Server status enumeration.
Attributes:
| Name | Type | Description |
|---|---|---|
STOPPED |
ServerStatus
|
The server is not running. |
STARTING |
ServerStatus
|
The server is in the process of starting. |
RUNNING |
ServerStatus
|
The server is running and healthy. |
UNHEALTHY |
ServerStatus
|
The server is running but failed health checks. |
FAILED |
ServerStatus
|
The server failed to start or encountered a fatal error. |