mcp-host-agent
Host-level deployment and supervision agent for the MCP Worker platform.
Installed once per host, mcp-host-agent manages the local Worker services end
to end: deployment (git clone/pull + dependency install), health polling,
heartbeat aggregation to the Hub, crash self-healing, and the Hub-facing
control endpoints.
Installation
pip install mcp-host-agent
Requires Python 3.10+.
Quick start
# 1. Write the agent configuration (see below).
# 2. Validate it and run the control API.
mcp-host-agent run --config /etc/mavis/agent.yaml
Configuration
The agent is driven by a single agent.yaml file:
hub_url: "https://hub.example.com"
agent_id: "agent-example"
jwt_token: "<jwt>"
agent_token: "<agent-token>" # optional; required for control endpoints
platform: linux # linux | macos
agent_port: 9200 # control API port (default 9200)
workers:
- name: demo-worker
repo: "https://git.example.com/owner/demo-worker.git"
branch: main
port: 9101
python: "3.11"
auto_restart: true
max_restart: 3
How it works
- Deployment — clones/pulls each worker repo into the working directory and
manages it as a
systemd(Linux) orlaunchd(macOS) service. - Supervision — polls each worker's process state and
/healthendpoint, derives its status, and aggregates everything into anAgentHeartbeat. - Self-healing — applies a decision tree (restart → rollback → give up) and escalates unrecoverable failures to the Hub orchestrator.
- Control plane — exposes
/health,/meta, and authenticated/api/v1/agent/*endpoints for the Hub orchestrator.
Supported platforms
| Platform | Runner |
|---|---|
| Linux | systemd |
| macOS | launchd |
Windows is not supported in v1. The agent does not self-heal containers (Docker/K3s pods are managed by their own orchestrators); it manages native host processes only.
Development
pip install -e ".[dev]"
pytest
License
Apache-2.0. See LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_host_agent-1.0.1.tar.gz.
File metadata
- Download URL: mcp_host_agent-1.0.1.tar.gz
- Upload date:
- Size: 21.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
620c68d9f782eaf7d9d1e811cf1b6eb3813c04b46503de50471b3945dcb23eba
|
|
| MD5 |
0ff9b1324ba801128947f38a05959551
|
|
| BLAKE2b-256 |
8de420077de6aa343f1d7830acb1780a4a749f43f82012f477e86a97325bf04d
|
File details
Details for the file mcp_host_agent-1.0.1-py3-none-any.whl.
File metadata
- Download URL: mcp_host_agent-1.0.1-py3-none-any.whl
- Upload date:
- Size: 25.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
263f568d7c9fa611c071838d61d9ec1da16c6daa3ed4643c5194f9684e159d9e
|
|
| MD5 |
966e6ad50d72dcfbd6f24854e51d5d5a
|
|
| BLAKE2b-256 |
bd024ce1f144c00023939cfcdbbb055700299beadb26f01778ca44d80be424eb
|